bfgreporting.bfgRave Class
Wrapper class for basic Rave functionality. More...Inherits RaveLoginStatusListener, and RaveAppDataKeysManager.RaveAppDataKeysStateObserver.
Classes | |
enum | AccountDeletionRequestResult |
Result codes for when an account deletion request is invoked. More... | |
interface | bfgRaveDelegate |
Interface for the bfgRaveDelegate. More... | |
interface | RaveReadyListener |
RaveReady event callback delegate interface. More... | |
Public Member Functions | |
String | currentRaveId () |
Returns the current Rave Id, or null if Rave is not initialized. More... | |
String[] | getAllCurrentAuthenticatedPlugins () |
Get all current authenticated methods for the Rave user. More... | |
String | getCurrentAuthenticatedPlugin () |
Get the current authenticated method for the Rave user. More... | |
String | getCurrentEmail () |
Helper method to retrieve the user's current Rave email address. More... | |
boolean | getGoogleLoginEnabled () |
Getter method to show/hide "Sign in with Google" option. More... | |
synchronized boolean | isBackgroundInitFinished () |
Is background initialization complete. More... | |
boolean | isCurrentAuthenticated () |
Checks if the current user is authenticated. More... | |
boolean | isCurrentGuest () |
Returns whether the current user is a guest or not. More... | |
boolean | isCurrentPersonalized () |
Is the user logged in and in personalized state. More... | |
boolean | isLastGuest () |
Returns whether the previous user was a guest or not. More... | |
boolean | isRaveInitialized () |
Returns whether Rave is initialized or not. More... | |
String | lastRaveId () |
Returns the previous user's raveId. More... | |
void | listenForRaveReady (@NonNull final RaveReadyListener listener) |
Rave initializes asynchronously and should never be accessed before it has been initialized. More... | |
void | logoutCurrentUser () |
Logs out the current Rave user. More... | |
void | logoutCurrentUserWithScene (@NonNull final Activity activity) throws RaveException |
Logs out the current Rave user using the SignOut scene. More... | |
void | logoutCurrentUserWithScene (@NonNull final Activity activity, @Nullable final String origin) throws RaveException |
Logs out the current Rave user using the SignOut scene. More... | |
void | presentNewsletterSignUp (@NonNull final Activity activity) |
Displays the Rave newsletter sign up page to the user. More... | |
void | presentProfile (@NonNull final Activity activity) |
Shows the Rave Profile modal. More... | |
void | presentProfile (@NonNull final Activity activity, @Nullable final String origin) |
Shows the Rave Profile modal. More... | |
void | presentSignIn (@NonNull final Activity activity) |
Displays the Rave login page to the user. More... | |
void | presentSignIn (@NonNull final Activity activity, @Nullable final String origin) |
Displays the Rave login page to the user. More... | |
void | requestAccountDeletion () |
Sends a Zendesk request for account deletion and logs the user out of Rave. More... | |
void | setDelegate (bfgRaveDelegate raveDelegate) |
Sets the raveDelegate. More... | |
void | setGoogleLoginEnabled (boolean enableGoogleLogin) throws RaveException |
Setter method to show/hide "Sign in with Google" option. More... | |
void | setupLoginStatusCallbackWithExternalCallback (@Nullable final RaveLoginStatusListener externalCallback) |
Sets the externalLoginStatuslistener callback. More... | |
Static Public Member Functions | |
static void | changeRaveDisplayName (@NonNull final String displayName) |
Call this to set the Rave display name. More... | |
static String | currentRaveDisplayName () |
Get the Rave display name of the current user. More... | |
static void | fetchCurrentAppDataKey () |
Initiate a fetch of the current Rave App Data Key. More... | |
static void | finalizeGoogleLoginStatus () |
Helper method to lock Google Login enabled/disabled option. More... | |
static void | selectRaveAppDataKey (@Nullable final String key) |
Select the App Data Key. More... | |
static void | setRaveAppDataKeyDelegate (@Nullable final bfgRaveAppDataKeyDelegate delegate) |
Set the Rave AppDataKeys delegate to be informed of app data key changes and conflicts. More... | |
static synchronized bfgRave | sharedInstance () |
Get singleton instance of bfgRave. More... | |
static void | waitForRaveReady () |
Wait for bfgRave initialization to complete. More... | |
Detailed Description
Wrapper class for basic Rave functionality. Monitors login state changes and caches previous ids.
Member Function Documentation
◆ changeRaveDisplayName()
| 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
displayName The name that the Rave display name will be changed to.
◆ currentRaveDisplayName()
| inlinestatic |
Get the Rave display name of the current user. PREREQUISITES: None, but returns NULL if Rave is not yet initialized (using bfgManager.initializeWithActivity)
- Returns
- The Rave display name of the current user or null if there isn't one.
◆ currentRaveId()
| inline |
Returns the current Rave Id, or null if Rave is not initialized. PREREQUISITES: None, but returns NULL if Rave has not been initialized (using bfgManager.initializeWithActivity)
- Returns
- The current Rave Id, possibly null.
◆ 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.PREREQUISITES: Rave must be initialized (using bfgManager.initializeWithActivity)
- Since
- 6.3
◆ finalizeGoogleLoginStatus()
| inlinestatic |
Helper method to lock Google Login enabled/disabled option. PREREQUISITES: None
◆ getAllCurrentAuthenticatedPlugins()
| inline |
Get all current authenticated methods for the Rave user. PREREQUISITES: Rave must be initialized (using bfgManager.initializeWithActivity)
- Returns
- an array of these types: big_fish, facebook, google, unknown_auth or none (if user is currently not authenticated).
- Since
- 7.3
◆ getCurrentAuthenticatedPlugin()
| inline |
Get the current authenticated method for the Rave user. PREREQUISITES: Rave must be initialized (using bfgManager.initializeWithActivity)
- Returns
- big_fish, facebook, google, unknown_auth or none (if user is currently not authenticated).
- Since
- 6.3
◆ getCurrentEmail()
| inline |
Helper method to retrieve the user's current Rave email address. If the user is not logged into Rave, has not set their email address, or has their account set to not share their email address, it will return null or an empty string.
- Returns
- Current Rave email if logged in, an email address is stored and sharing is allowed, null or an empty string otherwise
◆ getGoogleLoginEnabled()
| inline |
Getter method to show/hide "Sign in with Google" option. PREREQUISITES: None
- Returns
- TRUE if Login using google account is supported.
◆ isBackgroundInitFinished()
| inline |
Is background initialization complete.
- Returns
- TRUE if background initialization is complete.
◆ isCurrentAuthenticated()
| inline |
Checks if the current user is authenticated. PREREQUISITES: Rave must be initialized (using bfgManager.initializeWithActivity)
- Returns
- TRUE if the user is authenticated.
- Since
- 6.2
◆ isCurrentGuest()
| inline |
Returns whether the current user is a guest or not. PREREQUISITES: Rave must be initialized (using bfgManager.initializeWithActivity)
- Returns
- boolean value indicating whether the current user is a guest or not.
◆ isCurrentPersonalized()
| inline |
Is the user logged in and in personalized state.
- Returns
- TRUE if logged in and personalized.
- Since
- 6.2
◆ isLastGuest()
| inline |
Returns whether the previous user was a guest or not. Note: Returns false if the previous user is the same as the current user.PREREQUISITES: None
- Returns
- boolean value indicating if the last user to use the app was a guest or not.
◆ isRaveInitialized()
| inline |
Returns whether Rave is initialized or not. PREREQUISITES: None
- Returns
- boolean value indicating the status of Rave initilization.
◆ lastRaveId()
| inline |
Returns the previous user's raveId. Note: Returns null if the previous user and current user are the same.PREREQUISITES: None
- Returns
- String the previous user's raveId or null.
◆ listenForRaveReady()
| inline |
Rave initializes asynchronously and should never be accessed before it has been initialized. Rather than polling for bfgRave.isRaveInitialized to be TRUE, which cannot be done on the main UI thread, applications should listen for the RaveReady callback to provide a Rave ID and to indicate when Rave is ready for use. To listen for notification that Rave has been initialized and is ready for use, register a callback listener with this method and use the callback listener to indicate when a Rave ID is available and Rave is ready for use.PREREQUISITES: None
- Parameters
listener Callback delegate to execute when Rave is ready for use and a Rave ID has been acquired.
◆ logoutCurrentUser()
| inline |
Logs out the current Rave user. NOTE: This will result in a new Rave id.PREREQUISITES: Rave must be initialized (using bfgManager.initializeWithActivity)
- Since
- 6.2
◆ logoutCurrentUserWithScene() [1/2]
| inline |
Logs out the current Rave user using the SignOut scene. No AuthFlowReporting origin will be set. Note: This will result in a new Rave id.PREREQUISITES: Rave must be initialized (using bfgManager.initializeWithActivity)
- Parameters
activity Parent activity
- Exceptions
RaveException Throws exception, if null Activity provided.
- Since
- 6.2
◆ logoutCurrentUserWithScene() [2/2]
| inline |
Logs out the current Rave user using the SignOut scene. Note: This will result in a new Rave id.PREREQUISITES: Rave must be initialized (using bfgManager.initializeWithActivity)
- Parameters
activity Parent activity origin Friendly activity name, for reporting AuthFlow analytics.
- Exceptions
RaveException Throws exception, if null Activity provided.
- Since
- 6.2
◆ presentNewsletterSignUp()
| inline |
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.PREREQUISITES: Rave must be initialized (using bfgManager.initializeWithActivity)
- Parameters
activity The activity presenting the modal.
◆ presentProfile() [1/2]
| inline |
Shows the Rave Profile modal. PREREQUISITES: Rave must be initialized (using bfgManager.initializeWithActivity)
- Parameters
activity The activity presenting the modal.
◆ presentProfile() [2/2]
| inline |
Shows the Rave Profile modal. PREREQUISITES: Rave must be initialized (using bfgManager.initializeWithActivity)
- Parameters
activity The activity presenting the modal. origin Friendly activity name, for reporting AuthFlow analytics.
◆ presentSignIn() [1/2]
| inline |
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.PREREQUISITES: Rave must be initialized (using bfgManager.initializeWithActivity)
- Parameters
activity The activity presenting the modal.
◆ presentSignIn() [2/2]
| inline |
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.PREREQUISITES: Rave must be initialized (using bfgManager.initializeWithActivity)
- Parameters
activity The activity presenting the modal. origin Name of the origin activity that launched the sign-in AuthFlow (e.g., "leaderboard"); NULL if no origin specified.
◆ requestAccountDeletion()
| inline |
Sends a Zendesk request for account deletion and logs the user out of Rave.
The BFG_RAVE_ACCOUNT_DELETION_REQUEST_FAILURE notification is dispatched upon failure with one of the following AccountDeletionRequestResult failure codes:
- Note
- This method MUST be called after BFG_RAVE_READY notification is received.
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
- 7.7.0
◆ selectRaveAppDataKey()
| 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.PREREQUISITES: Rave must be initialized (using bfgManager.initializeWithActivity)
- Parameters
key The key that the App Data Key will be changed to.
- Since
- 6.3
◆ setDelegate()
| inline |
Sets the raveDelegate. NOTE: Not gated to wait for bfgRave initialization on first launchPREREQUISITES: None
- Parameters
raveDelegate The new delegate.
◆ setGoogleLoginEnabled()
| inline |
Setter method to show/hide "Sign in with Google" option. By default, the Google sign in option is disabled.PREREQUISITES: None
- Parameters
enableGoogleLogin TRUE if Google Login supported.
- Since
- 6.2
◆ setRaveAppDataKeyDelegate()
| inlinestatic |
Set the Rave AppDataKeys delegate to be informed of app data key changes and conflicts. NOTE: The delegate should be set before the first use of bfgRave.sharedInstance()PREREQUISITES: None
- Parameters
delegate The delegate for bfgRaveAppDataKeyDelegate
- Since
- 6.3
◆ setupLoginStatusCallbackWithExternalCallback()
| inline |
Sets the externalLoginStatuslistener callback. NOTE: Not gated to wait for bfgRave initialization on first launchPREREQUISITES: None
- Parameters
externalCallback The callback to be called when login status changes.
◆ sharedInstance()
| inlinestatic |
◆ waitForRaveReady()
| inlinestatic |
Wait for bfgRave initialization to complete. NOTE: This causes Rave initialization to run on the UI thread if it hasn't been processed yet. It does not actually pause the UI thread.