Skip to main content
Version: 10.7.x

bfgManager Class

Static Public Member Functions

static void setParentViewController ()
 Currently only works for iOS More...
 
static long userID ()
 Get current user ID.
 
static void setUserID (long userID)
 Set the current user ID More...
 
static void setAttributionUserID (string userID)
 Set the current attribution user ID More...
 
static long sessionCount ()
 Determines the number of sessions in the application.
 
static bool isInitialLaunch ()
 Determines if this is the initial launch or "install" of the application.
 
static bool isFirstTime ()
 Currently only works for iOS. Determines if the application has been started from a cold-start.
 
static bool isInitialized ()
 Determines if SDK is initialized yet.
 
static void showSupport ()
 Launches the Help Center Activity. Requires that parentViewController is set.
 
static void showPrivacy ()
 Show the Privacy page using the in-game browser.
 
static void showTerms ()
 Show the Terms of Use page with the in-game browser.
 
static void showWebBrowser (string startPage)
 Show an in-game browser displaying startPage. More...
 
static void removeWebBrowser ()
 Removes the in-game browser shown via showWebBrowser:
 
static 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.
 
static 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...
 
static void showNoConnectivityAlert (bool showStore=false)
 
static void addPauseResumeDelegate ()
 Currently only works on iOS. Call this method to add a delegate to listen for pause/resume events from the SDK.
 
static void removePauseResumeDelegate ()
 Currently only works on iOS. Call this method to remove a pause/resume event delegate.
 
static bool isPaused ()
 Test to see if game should be paused. Returns true if the game should be paused.
 
static bool getDebugDictionary (ref string jsonDebugDictionary)
 Currently only works on iOS. Gets the debug dictionary currently being used for purchase testing. More...
 
static void setDebugDictionary (string jsonDebugDictionary)
 Currently only works on iOS. Sets the debug dictionary for purchase testing based on the given json. More...
 
static 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...
 
static void removePolicyListener (NotificationHandler willShowPolicies, NotificationHandler onPoliciesCompleted)
 Removes the policy listener. More...
 
static bool didAcceptPolicyControl (string policyControl)
 Determines if a given policy control was accepted. More...
 
static void setLimitEventAndDataUsage (bool limitData)
 Limits Facebook's use of data to analytics and conversions. More...
 
static void requestTrackingAuthorization ()
 Triggers the display of the Apple App Transparency Tracking prompt to request user's permission to retrieve IDFA. Utilize the attSelectionRequired() method to determine if the user has made an ATT selection. More...
 
static bool attSelectionRequired ()
 Determine if AppTrackingTransparency dialog should be displayed to the user. Typically used with pre-ATT pop up dialog and in conjunction with the requestTrackingAuthorization() method. More...
 
static int attStatus ()
 Return an int representing the user's App Tracking Transparency status as defined by Apple's enum: ATTrackingManager.AuthorizationStatus More...
 

Member Function Documentation

◆ addPolicyListener()

static void BFGSDK.bfgManager.addPolicyListener (NotificationHandler willShowPolicies,
NotificationHandler onPoliciesCompleted 
)
inlinestatic
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()

static bool BFGSDK.bfgManager.attSelectionRequired ()
inlinestatic
Determine if AppTrackingTransparency dialog should be displayed to the user. Typically used with pre-ATT pop up dialog and in conjunction with the requestTrackingAuthorization() method.
Returns
TRUE if user must interact with ATT dialog
Warning
Only for iOS 14 and above. On Android and lower iOS versions, this method will ALWAYS return FALSE.

◆ attStatus()

static int BFGSDK.bfgManager.attStatus ()
inlinestatic
Return an int representing the user's App Tracking Transparency status as defined by Apple's enum: ATTrackingManager.AuthorizationStatus
  • -1: User is running on a non-iOS device OR a pre-iOS 14 OS; no action required
  • 0: notDetermined
  • 1: restricted
  • 2: denied
  • 3: authorized
Returns
int representing user's App Tracking Transparency status

◆ checkForInternetConnectionAndAlert()

static bool BFGSDK.bfgManager.checkForInternetConnectionAndAlert (bool displayAlert)
inlinestatic
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()

static bool BFGSDK.bfgManager.didAcceptPolicyControl (string policyControl)
inlinestatic
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()

static bool BFGSDK.bfgManager.getDebugDictionary (ref string jsonDebugDictionary)
inlinestatic
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()

static void BFGSDK.bfgManager.removePolicyListener (NotificationHandler willShowPolicies,
NotificationHandler onPoliciesCompleted 
)
inlinestatic
Removes the policy listener.
Parameters
willShowPoliciesThe listener for willShowPolicies.
onPoliciesCompletedThe listener for onPoliciesCompleted.

◆ requestTrackingAuthorization()

static void BFGSDK.bfgManager.requestTrackingAuthorization ()
inlinestatic
Triggers the display of the Apple App Transparency Tracking prompt to request user's permission to retrieve IDFA. Utilize the attSelectionRequired() method to determine if the user has made an ATT selection.
Warning
Only for iOS 14 and above. On Android and lower iOS versions, this method will have no effect.

◆ setAttributionUserID()

static void BFGSDK.bfgManager.setAttributionUserID (string userID)
inlinestatic
Set the current attribution user ID
Parameters
userIDUser ID to set.

◆ setDebugDictionary()

static void BFGSDK.bfgManager.setDebugDictionary (string jsonDebugDictionary)
inlinestatic
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()

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

◆ setParentViewController()

static void BFGSDK.bfgManager.setParentViewController ()
inlinestatic
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()

static void BFGSDK.bfgManager.setUserID (long userID)
inlinestatic
Set the current user ID
Parameters
userIDUser ID to set.

◆ showWebBrowser()

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