Rules of Golf SDK allows you to display some elements from The official Rules of Golf app.
- iOS 15 or later.
- Xcode 27 or later, from version 1.4.4. The framework is built with Xcode 27.1, and earlier versions of Xcode may not be able to import it. Note that an app built with Xcode 27 must use the scene-based life cycle (
UIApplicationSceneManifest) to launch on iOS 27.
In Xcode, add a package by selecting File → Add Package Dependencies… in the menu bar.
Paste a link to this repo into the "Search of Enter Package URL" field:
https://github.com/FutureWorkshops/RANDA-RulesOfGolf-iOS-SPM.git
Select "Add Package", specify your target, then "Add Package" again.
Rules of Golf framework is a private framework. In order to use it, you need to obtain a license.
To obtain a license, please provide the bundle identifiers of the apps that will use the framework.
This license file randa-rog.license needs to be added to the main bundle of your app.
Add the following at the top your view controller.
Swift:
import RANDARulesOfGolfObjective-C:
#import “RANDARulesOfGolf/RANDARulesOfGolf.h”The ROG Framework will attempt to choose the language based on the supported languages of your app and the user preferences. If that doesn't work you have the option of setting the language yourself.
Swift:
ROGSDK.setLanguage(language: .french)Objective-C:
[ROGSDK setLanguageWithLanguage:AppLanguageFrench];The provided screens are native UIViewController subclasses and are designed to be presented modally, i.e. they should cover the UI elements of the hosting app and not be placed within your existing view hierarchy. For example, it is strongly advised not to add the viewControllers to your own instances of UINavigationController or UITabBarController, as the screens themselves are already contained within those classes.
If your app is built using a technology such as Flutter or React Native, please see below for guidance on how to present SDK screens.
Swift:
let rogTabBarController = ROGTabBarController()
self.present(rogTabBarController, animated: true)Objective-C:
ROGTabBarController *rogTabBarController = [[ROGTabBarController alloc] init];
[self presentViewController:rogTabBarController animated:YES completion:nil];Swift:
let rogTabBarController = ROGTabBarController(tabs: [.learn, .browse, .search])
self.present(rogTabBarController, animated: true)Objective-C:
ROGTabBarController *rogTabBarController = [[ROGTabBarController alloc] initWithTabIdentifiers:@[ROGSDKTabIdentifiers.learn, ROGSDKTabIdentifiers.browse, ROGSDKTabIdentifiers.search]];
[self presentViewController:rogTabBarController animated:YES completion:nil];Swift:
let rogBrowserNavigationController = ROGBrowserNavigationController()
self.present(rogBrowserNavigationController, animated: true)Objective-C:
ROGBrowserNavigationController *rogBrowserNavigationController = [[ROGBrowserNavigationController alloc] init];
[self presentViewController:rogBrowserNavigationController animated:YES completion:nil];Swift:
let searchNavigationController = ROGSearchNavigationController()
self.present(searchNavigationController, animated: true)Objective-C:
ROGSearchNavigationController *searchNavigationController = [[ROGSearchNavigationController alloc] init];
[self presentViewController: searchNavigationController animated:YES completion:nil];Swift:
let learnNavigationController = ROGLearnNavigationController()
self.present(learnNavigationController, animated: true)Objective-C:
ROGLearnNavigationController * learnNavigationController = [[ROGLearnNavigationController alloc] init];
[self presentViewController: learnNavigationController animated:YES completion:nil];You should avoid trying to host the SDK screens within your own view hierarchies, as you are likely to encounter issues, e.g. with safe area insets. Instead, it is recommended that you present the screens directly on the rootViewController of the application window, which can be achieved by calling the following native code (importing UIKit if necessary):
Swift
let rogTabBarController = ROGTabBarController()
rogTabBarController.modalPresentationStyle = .fullScreen
UIApplication.shared.windows.first?.rootViewController?.present(rogTabBarController, animated: true)Objective-C:
ROGTabBarController *rogTabBarController = [[ROGTabBarController alloc] init];
rogTabBarController.modalPresentationStyle = UIModalPresentationFullScreen;
UIViewController *rootViewController = [[[[UIApplication sharedApplication] windows] firstObject] rootViewController];
[rootViewController presentViewController:rogTabBarController animated:YES completion:nil];The SDK collects the following anonymous events and sends them to The R&A Firebase Analytics account:
- New device: Sent the first time the SDK is shown for the current app installation.
- Session began: Sent when a new session begins.
- Session ended: Sent when a session is considered to have ended (sent just before the next session begins, as this is the only opportunity we have to determine the session end condition of 30 minutes of inactivity).
When a user plays a video, the SDK also sends playback heartbeats to the video provider, Deltatre. Each heartbeat carries the video's id, how far into the video the user is, and an anonymous guest session id. They are sent when playback starts, at regular intervals while it plays, and when it stops.
You may wish to update the privacy declarations on your store listings to reflect this.
