Skip to main content
Version: 10.6.x

IOSBfgManager Class

This is the bfgManager wrapper class for iOS. More...

Public Member Functions

void setParentViewController ()
 Currently only works for iOS More...
 
long userID ()
 Get current user ID.
 
void setUserID (long userID)
 Set the current user ID More...
 
void setAttributionUserID (string userID)
 Set the attribution user ID More...
 
long sessionCount ()
 Currently only works for iOS. Determines the number of sessions in the application.
 
bool isInitialLaunch ()
 Currently only works for iOS. Determines if this is the initial launch or "install" of the application.
 
bool isFirstTime ()
 Currently only works for iOS. Determines if the application has been started from a cold-start.
 
bool isInitialized ()
 Determines if SDK is initialized yet.
 
void showSupport ()
 Launches the Help Center Activity. Requires that parentViewController is set.
 
void showPrivacy ()
 Show the Privacy page using the in-game browser.
 
void showTerms ()
 Show the Terms of Use page with the in-game browser.
 
void showWebBrowser (string startPage)
 Show an in-game browser displaying startPage. More...
 
void removeWebBrowser ()
 Removes the in-game browser shown via showWebBrowser:
 
bool checkForInternetConnection ()
 Returns a boolean indicating whether the device can access the Internet. For convenience, this also displays a built-in alert dialog notifying the user that an Internet connection was not found.
 
bool checkForInternetConnectionAndAlert (bool displayAlert)
 Returns a boolean indicating whether the device can access the Internet. Also can display an alert if the device is not connected. More...
 
void showNoConnectivityAlert (bool showStore)
 
void addPauseResumeDelegate ()
 Currently only works on iOS. Call this method to add a delegate to listen for pause/resume events from the SDK.
 
void removePauseResumeDelegate ()
 Currently only works on iOS. Call this method to remove a pause/resume event delegate.
 
bool isPaused ()
 Test to see if game should be paused. Returns true if the game should be paused.
 
bool getDebugDictionary (ref string jsonDebugDictionary)
 Currently only works on iOS. Currently only works on iOS. Gets the debug dictionary currently being used for purchase testing. More...
 
void setDebugDictionary (string jsonDebugDictionary)
 Currently only works on iOS. Sets the debug dictionary for purchase testing based on the given json. More...
 
void addPolicyListener (NotificationHandler willShowPolicies, NotificationHandler onPoliciesCompleted)
 Adds the policy listener. This method internally creates a notification observer for bfgCommon.BFG_POLICY_LISTENER_WILLSHOWPOLICIES and bfgCommon.BFG_POLICY_LISTENER_ONPOLICIESCOMPLETED. To remove the policy listeners, please call removePolicyListener with the notification observers you have created. More...
 
void removePolicyListener (NotificationHandler willShowPolicies, NotificationHandler onPoliciesCompleted)
 Removes the policy listener. More...
 
bool didAcceptPolicyControl (string policyControl)
 Determines if a given policy control was accepted. More...
 
void setLimitEventAndDataUsage (bool limitData)
 Limits Facebook's use of data to analytics and conversions. More...
 
void requestTrackingAuthorization ()
 Triggers the display of the Apple App Transparency Tracking prompt to request user's permission to retrieve IDFA. More...
 
bool attSelectionRequired ()
 Returns TRUE when user must make an AppTrackingTransparency selection. To be used in conjunction with requestTrackingAuthorization()More...
 
int attStatus ()
 Return an int representing the user's App Tracking Transparency status as defined by Apple's enum: ATTrackingManager.AuthorizationStatus More...
 

Detailed Description

This is the bfgManager wrapper class for iOS.

Member Function Documentation

◆ addPolicyListener()

void BFGSDK.IOSBfgManager.addPolicyListener (NotificationHandler willShowPolicies,
NotificationHandler onPoliciesCompleted 
)
inline
Adds the policy listener. This method internally creates a notification observer for bfgCommon.BFG_POLICY_LISTENER_WILLSHOWPOLICIES and bfgCommon.BFG_POLICY_LISTENER_ONPOLICIESCOMPLETED. To remove the policy listeners, please call removePolicyListener with the notification observers you have created.
Parameters
willShowPoliciesThe listener for willShowPolicies.
onPoliciesCompletedThe listener for onPoliciesCompleted.

◆ attSelectionRequired()

bool BFGSDK.IOSBfgManager.attSelectionRequired ()
inline
Returns TRUE when user must make an AppTrackingTransparency selection. To be used in conjunction with requestTrackingAuthorization()
Warning
Only for iOS 14 and above. On Android and lower iOS versions, this method will always return FALSE.

◆ attStatus()

int BFGSDK.IOSBfgManager.attStatus ()
inline
Return an int representing the user's App Tracking Transparency status as defined by Apple's enum: ATTrackingManager.AuthorizationStatus
  • -3: An error occurred and a value could not be determined
  • -2: User is running on a non-iOS device; no action required
  • -1: User is running on a iOS device but pre-iOS 14; no action required
  • 0: notDetermined
  • 1: restricted
  • 2: denied
  • 3: authorized
Returns
int representing user's App Tracking Transparency status

◆ checkForInternetConnectionAndAlert()

bool BFGSDK.IOSBfgManager.checkForInternetConnectionAndAlert (bool displayAlert)
inline
Returns a boolean indicating whether the device can access the Internet. Also can display an alert if the device is not connected.
Parameters
displayAlertWhether an alert should be displayed if there is no connection.

◆ didAcceptPolicyControl()

bool BFGSDK.IOSBfgManager.didAcceptPolicyControl (string policyControl)
inline
Determines if a given policy control was accepted.
Parameters
policyControlThe policy control name to check
Returns
TRUE if the control specified by policyControl was accepted, otherwise FALSE.

◆ getDebugDictionary()

bool BFGSDK.IOSBfgManager.getDebugDictionary (ref string jsonDebugDictionary)
inline
Currently only works on iOS. Currently only works on iOS. Gets the debug dictionary currently being used for purchase testing.
Parameters
jsonDebugDictionaryThe current debug dictionary as a string
Returns
If true, the debug dictionary was successfully retrieved. If false, there was a problem while retrieving the debug dictionary.

◆ removePolicyListener()

void BFGSDK.IOSBfgManager.removePolicyListener (NotificationHandler willShowPolicies,
NotificationHandler onPoliciesCompleted 
)
inline
Removes the policy listener.
Parameters
willShowPoliciesThe listener for willShowPolicies.
onPoliciesCompletedThe listener for onPoliciesCompleted.

◆ requestTrackingAuthorization()

void BFGSDK.IOSBfgManager.requestTrackingAuthorization ()
inline
Triggers the display of the Apple App Transparency Tracking prompt to request user's permission to retrieve IDFA.
Warning
Only for iOS 14 and above. On Android and lower iOS versions, this method will have no effect.

◆ setAttributionUserID()

void BFGSDK.IOSBfgManager.setAttributionUserID (string userID)
inline
Set the attribution user ID
Parameters
userIDUser ID to set.

◆ setDebugDictionary()

void BFGSDK.IOSBfgManager.setDebugDictionary (string jsonDebugDictionary)
inline
Currently only works on iOS. Sets the debug dictionary for purchase testing based on the given json.
Parameters
jsonDebugDictionaryThe new debug dictionary to use

◆ setLimitEventAndDataUsage()

void BFGSDK.IOSBfgManager.setLimitEventAndDataUsage (bool limitData)
inline
Limits Facebook's use of data to analytics and conversions.
Parameters
limitDataLimits data usage if true

◆ setParentViewController()

void BFGSDK.IOSBfgManager.setParentViewController ()
inline
Currently only works for iOS This sets the view controller to use when showing the GDN or interstitials for both launch (startup) and resume events in the UI. The parent view controller is initially set using the initializeWithActivity, but can be changed by calling this method if a different view should become the parent view for receiving GDN and interstitials. If you change your root Activity, you must call this method.

◆ setUserID()

void BFGSDK.IOSBfgManager.setUserID (long userID)
inline
Set the current user ID
Parameters
userIDUser ID to set.

◆ showWebBrowser()

void BFGSDK.IOSBfgManager.showWebBrowser (string startPage)
inline
Show an in-game browser displaying startPage.
Parameters
startPagestartPage URL whose content is to be displayed to the user.