Skip to main content
Version: 8.4.x

bfgRave Class

Provides methods for getting information about the current user. More...#import <bfgRave.h>

Class Methods

(void) + listenForRaveReady:
 
(void) + enableFBClassicLoginMode:
 
(void) + setFacebookReadPermissions:
 
(void) + setDelegate:
 
(void) + setRaveAppDataKeyDelegate:
 
(void) + setupLoginStatusCallbackWithExternalCallback:
 
(NSString *_Nullable) + currentRaveId
 
(NSString *_Nullable) + currentRaveDisplayName
 
(NSString *_Nullable) + currentRaveEmail
 
(void) + fetchCurrentRaveProfilePicture:
 
(void) + requestAccountDeletion
 
(void) + requestAccountDeletion:
 
(BOOL) + isCurrentAuthenticated
 
(BOOL) + isCurrentPersonalized
 
(NSString *_Nullable) + lastRaveId
 
(BOOL) + isLastGuest
 
(void) + logoutCurrentUser
 
(void) + presentSignIn
 
(void) + presentSignInWithOrigin:
 
(void) + presentNewsletterSignup
 
(void) + presentNewsletterSignupWithOrigin:
 
(void) + presentProfile
 
(void) + presentProfileWithOrigin:
 
(BOOL) + isRaveInitialized
 
(NSString *) + getAuthSource
 
(NSArray *) + getAllAuthSources
 
(NSString *) + getCurrentFacebookPermissions
 
(void) + getAppAssociatedFacebookFriends:
 
(void) + getAppAssociatedFacebookFriendsJson:
 
(BOOL) + facebookClassicLoginModeEnabled
 
(void) + changeRaveDisplayName:
 
(void) + selectRaveAppDataKey:
 
(void) + fetchCurrentAppDataKey
 

Detailed Description

Provides methods for getting information about the current user.
Since
6.0

Method Documentation

◆ changeRaveDisplayName:

+ (void) changeRaveDisplayName: (NSString *_Nonnull) displayName
Call this to set the Rave display name.
Parameters
displayNameThe name that the Rave display name will be changed to.
Since
6.0

◆ currentRaveDisplayName

+ (NSString *_Nullable) currentRaveDisplayName
Get the Rave display name of the current user.
Returns
The Rave display name of the current user or nil if there isn't one.
Since
6.0

◆ currentRaveEmail

+ (NSString *_Nullable) currentRaveEmail
Get the Rave email of the current user.
Returns
The Rave email of the current user or nil if there isn't one.
Since
6.4

◆ currentRaveId

+ (NSString *_Nullable) currentRaveId
Get the Rave ID of the current user.
Returns
The Rave ID of the current user or nil if there isn't one.
Since
6.0

◆ enableFBClassicLoginMode:

+ (void) enableFBClassicLoginMode: (BOOL) isEnabled
Call this method to enable Facebook's Classic Login mode. Rave has Facebook's Limited Login value set to TRUE by default. The SDK automatically calls this if/when a user opts in to ATT from #bfgManager.requestTrackingAuthorization().NOTE: For Limited Login usage, only the following Facebook Permissions are available: "public_profile, email", if you are calling this method to enable Classic Login, then you have access to other Facebook Read Permissions.
Parameters
BOOLYES if enabling Facebook Classic Login mode, NO to enable Limited Login
Since
7.2.1

◆ facebookClassicLoginModeEnabled

+ (BOOL) facebookClassicLoginModeEnabled
Get the current login mode for Facebook
Returns
YES if classic login mode is enabled; NO if limited login mode is enabled.
Since
7.2.1

◆ fetchCurrentAppDataKey

+ (void) fetchCurrentAppDataKey
Call this to 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 nil as the error value.
Since
6.2.0

◆ fetchCurrentRaveProfilePicture:

+ (void) fetchCurrentRaveProfilePicture: (bfgRaveProfilePictureCompletionBlock) completion
Get the Rave Profile picture of the current user.
Parameters
completionThe block of code to be called when profile picture is fetched.
Since
6.3

◆ getAllAuthSources

+ (NSArray *) getAllAuthSources
Get all authentication sources
Returns
The auth sources: "facebook", "apple", "big_fish", "unknown_auth", "none"
Since
7.2.5

◆ getAppAssociatedFacebookFriends:

+ (void) getAppAssociatedFacebookFriends: (bfgRaveGetAppAssociatedFacebookFriendsCompletionBlock) completion
Gets the list of app-associated Facebook friends for the currently logged-in Facebook user, or nil if the user is not authenticated using Facebook
Since
7.2.4

◆ getAppAssociatedFacebookFriendsJson:

+ (void) getAppAssociatedFacebookFriendsJson: (bfgRaveGetAppAssociatedFacebookFriendsJsonCompletionBlock) completion
Gets the list of app-associated Facebook friends in JSON format for the currently logged-in Facebook user, or nil if the user is not authenticated using Facebook
Since
7.2.4

◆ getAuthSource

+ (NSString *) getAuthSource
Get the authentication source
Returns
The auth source: "facebook", "apple", "big_fish", "unknown_auth", "none"
Since
7.2.1

◆ getCurrentFacebookPermissions

+ (NSString *) getCurrentFacebookPermissions
Get the current Facebook permissions
Returns
The permissions string for Facebook. E.g., "public_profile,email,user_friends", "public_profile,email", etc.
Since
7.2.1

◆ isCurrentAuthenticated

+ (BOOL) isCurrentAuthenticated
Get whether the current user is authenticated.
Returns
YES if the current user is a authenticated, NO if unauthenticated.
Since
6.3

◆ isCurrentPersonalized

+ (BOOL) isCurrentPersonalized
Get whether the current user is personalized (e.g., some user data has been customized but user is not authenticated).
Returns
YES if the current user is personalized, NO if non-personalized.
Since
6.3

◆ isLastGuest

+ (BOOL) isLastGuest
Get whether the last user is a guest (unauthenticated).
Returns
YES if the last user is a guest, NO if authenticated.
Since
6.0

◆ isRaveInitialized

+ (BOOL) isRaveInitialized
Returns whether rave is initialized or not.
Since
6.0

◆ lastRaveId

+ (NSString *_Nullable) lastRaveId
Get the Rave ID of the last user that is not the same as the current user.
Returns
The Rave ID of the last user or nil if there isn't one.
Since
6.0

◆ listenForRaveReady:

+ (void) listenForRaveReady: (bfgRaveReadyCompletionBlock) completion
Listen for a rave id to become available
Parameters
completionCompletion block to execute when rave id becomes available. Block will execute on the main thread.
Since
6.8

◆ logoutCurrentUser

+ (void) logoutCurrentUser
Logs out the current user if that user is not a guest.
Since
6.0

◆ presentNewsletterSignup

+ (void) presentNewsletterSignup
Presents the Newsletter signup screen if the current user is not authenticated.
Since
6.3

◆ presentNewsletterSignupWithOrigin:

+ (void) presentNewsletterSignupWithOrigin: (NSString *_Nullable) origin
Presents the Newsletter signup screen if the current user is not authenticated.
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'
Since
6.3

◆ presentProfile

+ (void) presentProfile
Presents the standard profile screen if the current user is authenticated or personalized.
Since
6.0

◆ presentProfileWithOrigin:

+ (void) presentProfileWithOrigin: (NSString *_Nullable) origin
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'
Since
6.3

◆ presentSignIn

+ (void) presentSignIn
Presents the standard sign-in screen if the current user is not authenticated.
Since
6.0

◆ presentSignInWithOrigin:

+ (void) presentSignInWithOrigin: (NSString *_Nullable) origin
Presents the standard sign-in screen if the current user is not authenticated.
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'
Since
6.3

◆ requestAccountDeletion

+ (void) requestAccountDeletion
Sends a Zendesk request for account deletion and logs the user out of Rave.
Note
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:
  • NetworkUnavailable: The user doesn't have a network connection.
  • FailedToSend: A network or client error occurred while sending the account deletion request through Zendesk.
    Since
    7.5.1

◆ requestAccountDeletion:

+ (void) requestAccountDeletion: (_Nullable bfgAccountDeletionRequestCompletionBlock) completion
Request Account Deletion. This is an internally used method required to be public but should not be directly accessed outside of the SDK
Parameters
completionThe block of code to be called when the account deletion request completes
Since
7.5.1

◆ selectRaveAppDataKey:

+ (void) selectRaveAppDataKey: (NSString *_Nonnull) key
Call this to 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.
Since
6.2.0

◆ setDelegate:

+ (void) setDelegate: (id< bfgRaveDelegate > _Nullable) delegate
Set the Rave delegate before initializing bfgManager to receive Rave login status changes.
Parameters
delegateThe delegate for bfgRave.
Since
6.0

◆ setFacebookReadPermissions:

+ (void) setFacebookReadPermissions: (NSString *) permissions
Set Facebook Read Permissions dynamically. If you are using calling this method to modify Facebook Read Permissions to permissions other than "public_profile, email", you must also call enableFBClassicLoginMode: as well.
Parameters
permissionsFacebook permissions required by the app, e.g. "public_profile, email" or "public_profile,email,user_friends"
Since
7.2.1

◆ setRaveAppDataKeyDelegate:

+ (void) setRaveAppDataKeyDelegate: (id< bfgRaveAppDataKeyDelegate >) delegate
Set the Rave AppDataKeys delegate before initializing bfgManager to be informed of app data key changes and conflicts.
Parameters
delegateThe delegate for bfgRaveAppDataKeyDelegate.
Since
6.2.0

◆ setupLoginStatusCallbackWithExternalCallback:

+ (void) setupLoginStatusCallbackWithExternalCallback: (RaveLoginStatusCallback) externalCallback
Call this to directly observe status changes in Rave.
Note
When using this method to observe Rave's status changes it's best to make this call from within the listenForRaveReady callback. This will guarantee that the externalCallback is not made until Rave is fully initialized and ready for use.
Parameters
externalCallbackThe block of code to be called when there is a change in login status.
Since
6.0