Skip to main content

bfgRave Class

Public Types

enum  AccountDeletionRequestResult { Success = 0 , FailedForAuth , NetworkUnavailable , FailedToSend }
 This is used by bfgRave.requestAccountDeletion() These are the possible payload values provided when subscribing to the bfgCommon.BFG_RAVE_ACCOUNT_DELETION_REQUEST_FAILURE notification: More...
 

Static Public Member Functions

static string currentRaveId ()
 Returns the current Rave Id, or null if Rave is not initialized More...
 
static string currentRaveEmail ()
 Get the Rave email of the current user. More...
 
static bool isAuthenticated ()
 Get whether the current user is authenticated. More...
 
static bool isCurrentGuest ()
 Returns whether the current user is a guest or not. More...
 
static string lastRaveId ()
 Returns the previous user's raveId. Note: Returns null if the previous user and current user are the same. More...
 
static bool isLastGuest ()
 Returns whether the previous user was a guest or not. Note: Returns false if the previous user is the same as the current user. More...
 
static void logoutCurrentUser ()
 Logs out the current Rave user. NOTE: This will result in a new Rave id.
 
static void presentSignIn ()
 Displays the Rave login page to the user. Rave handles checking for any needed permissions, giving the user a friendly message about the permission it's about to request, and then requesting it.
 
static void presentProfile ()
 Shows the Rave Profile model.
 
static bool isRaveInitialized ()
 Returns whether Rave is initialized or not. More...
 
static string currentRaveDisplayName ()
 Get the Rave display name of the current user. More...
 
static void changeRaveDisplayName (string raveDisplayName)
 Call this to set the Rave display name. More...
 
static void fetchCurrentAppDataKey ()
 Initiate a fetch of the current Rave App Data Key. More...
 
static void selectRaveAppDataKey (string key)
 Select the App Data Key. More...
 
static bool isCurrentAuthenticated ()
 Checks if the current user is authenticated. More...
 
static bool isCurrentPersonalized ()
 Is the user logged in and in personalized state. More...
 
static void presentNewsletterSignup ()
 Displays the Rave newsletter sign up page to the user. Rave handles checking for any needed permissions, giving the user a friendly message about the permission it's about to request, and then requesting it.
 
static void presentNewsletterSignupWithOrigin (string origin)
 Displays the Rave newsletter sign up page to the user. Rave handles checking for any needed permissions, giving the user a friendly message about the permission it's about to request, and then requesting it. More...
 
static void presentProfileWithOrigin (string origin)
 Presents the standard profile screen if the current user is authenticated or personalized. More...
 
static void presentSignInWithOrigin (string origin)
 Displays the Rave login page to the user. Rave handles checking for any needed permissions, giving the user a friendly message about the permission it's about to request, and then requesting it. An origin can be provided that identifies which screen or app started the AuthFlow login process. This origin will be provided in the first scene event in AuthFlow reporting analytics. More...
 
static void enableFBClassicLoginMode (bool enabled)
 Rave has Facebook's Limited Login enabled by default. Call this method to enable Facebook's Classic Login mode. The SDK automatically calls this if/when a user opts in to ATT from #bfgManager.requestTrackingAuthorization() More...
 
static void setFacebookReadPermissions (string permissions)
 Set Facebook Read Permissions dynamically More...
 
static string getCurrentFacebookPermissions ()
 Get current Facebook Permissions More...
 
static bool facebookClassicLoginModeEnabled ()
 Determine if Facebook Classic Login mode is enabled More...
 
static string getAuthSource ()
 Get authentication provider with which the user has authenticated More...
 
static string[] getAllAuthSources ()
 Get authentication provider with which the user has authenticated More...
 
static void getAppAssociatedFacebookFriends ()
 Initiate a fetch of app-associated facebook friends for the current user if authenticated through Facebook More...
 
static void requestAccountDeletion ()
 Sends a Zendesk request for account deletion and logs the user out of Rave.
More...
 

Member Enumeration Documentation

◆ AccountDeletionRequestResult

This is used by bfgRave.requestAccountDeletion() These are the possible payload values provided when subscribing to the bfgCommon.BFG_RAVE_ACCOUNT_DELETION_REQUEST_FAILURE notification:
  • Success: Account deletion request was successfully sent through Zendesk
  • FailedForAuth: The user is not authenticated through Rave
  • NetworkUnavailable: The user doesn't have a network connection
  • FailedToSend: A network or client error occurred while sending the account deletion request through Zendesk

Member Function Documentation

◆ changeRaveDisplayName()

static void BFGSDK.bfgRave.changeRaveDisplayName (string raveDisplayName)
inlinestatic
Call this to set the Rave display name. The potential display name value that is passed in must meet the following requirements:
  • String cannot be null
  • String length must be between 4 characters and 16 characters in length
Parameters
raveDisplayNameThe name that the Rave display name will be changed to.

◆ currentRaveDisplayName()

static string BFGSDK.bfgRave.currentRaveDisplayName ()
inlinestatic
Get the Rave display name of the current user.
Returns
The Rave display name of the current user or null if there isn't one.

◆ currentRaveEmail()

static string BFGSDK.bfgRave.currentRaveEmail ()
inlinestatic
Get the Rave email of the current user.
Returns
The Rave email of the current user or null if there isn't one.

◆ currentRaveId()

static string BFGSDK.bfgRave.currentRaveId ()
inlinestatic
Returns the current Rave Id, or null if Rave is not initialized
Returns
The current Rave Id, possibly null.

◆ enableFBClassicLoginMode()

static void BFGSDK.bfgRave.enableFBClassicLoginMode (bool enabled)
inlinestatic
Rave has Facebook's Limited Login enabled by default. Call this method to enable Facebook's Classic Login mode. The SDK automatically calls this if/when a user opts in to ATT from #bfgManager.requestTrackingAuthorization()
Warning
iOS only.
Since
7.2.1
Parameters
enabledTRUE to enable Facebook Classic Login mode, FALSE to enable Limited Login

◆ facebookClassicLoginModeEnabled()

static bool BFGSDK.bfgRave.facebookClassicLoginModeEnabled ()
inlinestatic
Determine if Facebook Classic Login mode is enabled
Returns
Return TRUE if Facebook's Classic Login mode is enabled, FALSE otherwise

◆ fetchCurrentAppDataKey()

static void BFGSDK.bfgRave.fetchCurrentAppDataKey ()
inlinestatic
Initiate a fetch of the current Rave App Data Key. This makes an asynchronous call to Rave to retrieve the App Data Key. If the fetch is successful, the delegate method bfgRaveFetchCurrentAppDataKeyDidSucceed will be called. If the fetch is unsuccessful, the delegate method bfgRaveFetchCurrentAppDataKeyDidFailWithError will be called. In the case where you are offline and have unresolved keys or logged out while offline, calling this method will call the delegate method bfgRaveFetchCurrentAppDataKeyDidFailWithError with null as the error value.

◆ getAllAuthSources()

static string[] BFGSDK.bfgRave.getAllAuthSources ()
inlinestatic
Get authentication provider with which the user has authenticated
Returns
A string representing the authentication provider: "unknown_auth", "facebook", "apple", "big_fish"

◆ getAppAssociatedFacebookFriends()

static void BFGSDK.bfgRave.getAppAssociatedFacebookFriends ()
inlinestatic
Initiate a fetch of app-associated facebook friends for the current user if authenticated through Facebook This makes an asynchronous call to Rave to retrieve a json string containing the app-associated friend data.
  • If successful, the BFG_RAVE_EXTERNALCALLBACK_GET_APP_ASSOCIATED_FACEBOOK_FRIENDS_DID_SUCCEED event will be dispatched containing the json string.
  • If unsuccessful, the BFG_RAVE_EXTERNALCALLBACK_GET_APP_ASSOCIATED_FACEBOOK_FRIENDS_DID_FAIL event will be dispatched containing the error string.
Due to the nature of how data is marshalled between native code and C#, the json string containing the friend data will need to be transformed into a JsonUtility-friendly format.Please refer to the sample project for an example implementation.
Warning
iOS only.
Since
7.2.4

◆ getAuthSource()

static string BFGSDK.bfgRave.getAuthSource ()
inlinestatic
Get authentication provider with which the user has authenticated
Returns
A string representing the authentication provider: "unknown_auth", "facebook", "apple", "big_fish"

◆ getCurrentFacebookPermissions()

static string BFGSDK.bfgRave.getCurrentFacebookPermissions ()
inlinestatic
Get current Facebook Permissions
Returns
A string representing the permissions, e.g. "public_profile,email" or "public_profile,email,user_friends"

◆ isAuthenticated()

static bool BFGSDK.bfgRave.isAuthenticated ()
inlinestatic
Get whether the current user is authenticated.
Returns
YES if the current user is a authenticated, NO if unauthenticated.

◆ isCurrentAuthenticated()

static bool BFGSDK.bfgRave.isCurrentAuthenticated ()
inlinestatic
Checks if the current user is authenticated.
Returns
TRUE if the user is authenticated.

◆ isCurrentGuest()

static bool BFGSDK.bfgRave.isCurrentGuest ()
inlinestatic
Returns whether the current user is a guest or not.
Returns
boolean value indicating whether the current user is a guest or not.

◆ isCurrentPersonalized()

static bool BFGSDK.bfgRave.isCurrentPersonalized ()
inlinestatic
Is the user logged in and in personalized state.
Returns
TRUE if logged in and personalized.

◆ isLastGuest()

static bool BFGSDK.bfgRave.isLastGuest ()
inlinestatic
Returns whether the previous user was a guest or not. Note: Returns false if the previous user is the same as the current user.
Returns
boolean value indicating if the last user to use the app was a guest or not.

◆ isRaveInitialized()

static bool BFGSDK.bfgRave.isRaveInitialized ()
inlinestatic
Returns whether Rave is initialized or not.
Returns
boolean value indicating the status of Rave initilization.

◆ lastRaveId()

static string BFGSDK.bfgRave.lastRaveId ()
inlinestatic
Returns the previous user's raveId. Note: Returns null if the previous user and current user are the same.
Returns
String the previous user's raveId or null.

◆ presentNewsletterSignupWithOrigin()

static void BFGSDK.bfgRave.presentNewsletterSignupWithOrigin (string origin)
inlinestatic
Displays the Rave newsletter sign up page to the user. Rave handles checking for any needed permissions, giving the user a friendly message about the permission it's about to request, and then requesting it.
Parameters
originA string denoting the starting point of the auth flow for reporting. Allows us to measure which areas in the game produce the highest authentication conversions. Example: 'level_end'

◆ presentProfileWithOrigin()

static void BFGSDK.bfgRave.presentProfileWithOrigin (string origin)
inlinestatic
Presents the standard profile screen if the current user is authenticated or personalized.
Parameters
originA string denoting the starting point of the auth flow for reporting. Allows us to measure which areas in the game produce the highest authentication conversions. Example: 'level_end'

◆ presentSignInWithOrigin()

static void BFGSDK.bfgRave.presentSignInWithOrigin (string origin)
inlinestatic
Displays the Rave login page to the user. Rave handles checking for any needed permissions, giving the user a friendly message about the permission it's about to request, and then requesting it. An origin can be provided that identifies which screen or app started the AuthFlow login process. This origin will be provided in the first scene event in AuthFlow reporting analytics.
Parameters
originName of the origin activity that launched the sign-in AuthFlow (e.g., "leaderboard"); NULL if no origin specified.

◆ requestAccountDeletion()

static void BFGSDK.bfgRave.requestAccountDeletion ()
inlinestatic
Sends a Zendesk request for account deletion and logs the user out of Rave.
Warning
This method MUST be called after BFG_RAVE_READY notification is received.
The BFG_RAVE_ACCOUNT_DELETION_REQUEST_SUCCESSFUL notification is dispatched upon success.
The BFG_RAVE_ACCOUNT_DELETION_REQUEST_FAILURE notification is dispatched upon failure with one of the following AccountDeletionRequestResult failure codes:
  • FailedForAuth (1): The user is not authenticated through Rave.
  • NetworkUnavailable (2): The user doesn't have a network connection.
  • FailedToSend (3): A network or client error occurred while sending the account deletion request through Zendesk.
Since
9.4.1 (iOS), 9.5.0 (Android)

◆ selectRaveAppDataKey()

static void BFGSDK.bfgRave.selectRaveAppDataKey (string key)
inlinestatic
Select the App Data Key. NOTE: Only call this after a key is selected(by the user or the game) from the set of unresolved keys.
Parameters
keyThe key that the App Data Key will be changed to.

◆ setFacebookReadPermissions()

static void BFGSDK.bfgRave.setFacebookReadPermissions (string permissions)
inlinestatic
Set Facebook Read Permissions dynamically
Warning
iOS only.
Since
7.2.1
Parameters
permissionsFacebook permissions required by the app, e.g. "public_profile,email" or "public_profile,email,user_friends"