Skip to main content

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()

static void com.bigfishgames.bfglib.bfgreporting.bfgRave.changeRaveDisplayName (@NonNull final String displayName)
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
It's also possible there could be a Rave Exception when attempting to perform the change. Regardless of the outcome, this method will call back the Rave delegate.PREREQUISITES: None
Parameters
displayNameThe name that the Rave display name will be changed to.

◆ currentRaveDisplayName()

static String com.bigfishgames.bfglib.bfgreporting.bfgRave.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()

String com.bigfishgames.bfglib.bfgreporting.bfgRave.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()

static void com.bigfishgames.bfglib.bfgreporting.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.PREREQUISITES: Rave must be initialized (using bfgManager.initializeWithActivity)
Since
6.3

◆ finalizeGoogleLoginStatus()

static void com.bigfishgames.bfglib.bfgreporting.bfgRave.finalizeGoogleLoginStatus ()
inlinestatic
Helper method to lock Google Login enabled/disabled option. PREREQUISITES: None

◆ getAllCurrentAuthenticatedPlugins()

String[] com.bigfishgames.bfglib.bfgreporting.bfgRave.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()

String com.bigfishgames.bfglib.bfgreporting.bfgRave.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()

String com.bigfishgames.bfglib.bfgreporting.bfgRave.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()

boolean com.bigfishgames.bfglib.bfgreporting.bfgRave.getGoogleLoginEnabled ()
inline
Getter method to show/hide "Sign in with Google" option. PREREQUISITES: None
Returns
TRUE if Login using google account is supported.

◆ isBackgroundInitFinished()

synchronized boolean com.bigfishgames.bfglib.bfgreporting.bfgRave.isBackgroundInitFinished ()
inline
Is background initialization complete.
Returns
TRUE if background initialization is complete.

◆ isCurrentAuthenticated()

boolean com.bigfishgames.bfglib.bfgreporting.bfgRave.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()

boolean com.bigfishgames.bfglib.bfgreporting.bfgRave.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()

boolean com.bigfishgames.bfglib.bfgreporting.bfgRave.isCurrentPersonalized ()
inline
Is the user logged in and in personalized state.
Returns
TRUE if logged in and personalized.
Since
6.2

◆ isLastGuest()

boolean com.bigfishgames.bfglib.bfgreporting.bfgRave.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()

boolean com.bigfishgames.bfglib.bfgreporting.bfgRave.isRaveInitialized ()
inline
Returns whether Rave is initialized or not. PREREQUISITES: None
Returns
boolean value indicating the status of Rave initilization.

◆ lastRaveId()

String com.bigfishgames.bfglib.bfgreporting.bfgRave.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()

void com.bigfishgames.bfglib.bfgreporting.bfgRave.listenForRaveReady (@NonNull final RaveReadyListener listener)
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
listenerCallback delegate to execute when Rave is ready for use and a Rave ID has been acquired.

◆ logoutCurrentUser()

void com.bigfishgames.bfglib.bfgreporting.bfgRave.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]

void com.bigfishgames.bfglib.bfgreporting.bfgRave.logoutCurrentUserWithScene (@NonNull final Activity activity) throws RaveException
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
activityParent activity
Exceptions
RaveExceptionThrows exception, if null Activity provided.
Since
6.2

◆ logoutCurrentUserWithScene() [2/2]

void com.bigfishgames.bfglib.bfgreporting.bfgRave.logoutCurrentUserWithScene (@NonNull final Activity activity,
@Nullable final String origin 
) throws RaveException
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
activityParent activity
originFriendly activity name, for reporting AuthFlow analytics.
Exceptions
RaveExceptionThrows exception, if null Activity provided.
Since
6.2

◆ presentNewsletterSignUp()

void com.bigfishgames.bfglib.bfgreporting.bfgRave.presentNewsletterSignUp (@NonNull final Activity activity)
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
activityThe activity presenting the modal.

◆ presentProfile() [1/2]

void com.bigfishgames.bfglib.bfgreporting.bfgRave.presentProfile (@NonNull final Activity activity)
inline
Shows the Rave Profile modal. PREREQUISITES: Rave must be initialized (using bfgManager.initializeWithActivity)
Parameters
activityThe activity presenting the modal.

◆ presentProfile() [2/2]

void com.bigfishgames.bfglib.bfgreporting.bfgRave.presentProfile (@NonNull final Activity activity,
@Nullable final String origin 
)
inline
Shows the Rave Profile modal. PREREQUISITES: Rave must be initialized (using bfgManager.initializeWithActivity)
Parameters
activityThe activity presenting the modal.
originFriendly activity name, for reporting AuthFlow analytics.

◆ presentSignIn() [1/2]

void com.bigfishgames.bfglib.bfgreporting.bfgRave.presentSignIn (@NonNull final Activity activity)
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
activityThe activity presenting the modal.

◆ presentSignIn() [2/2]

void com.bigfishgames.bfglib.bfgreporting.bfgRave.presentSignIn (@NonNull final Activity activity,
@Nullable final String origin 
)
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
activityThe activity presenting the modal.
originName of the origin activity that launched the sign-in AuthFlow (e.g., "leaderboard"); NULL if no origin specified.

◆ requestAccountDeletion()

void com.bigfishgames.bfglib.bfgreporting.bfgRave.requestAccountDeletion ()
inline
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:
  • 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()

static void com.bigfishgames.bfglib.bfgreporting.bfgRave.selectRaveAppDataKey (@Nullable final 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.PREREQUISITES: Rave must be initialized (using bfgManager.initializeWithActivity)
Parameters
keyThe key that the App Data Key will be changed to.
Since
6.3

◆ setDelegate()

void com.bigfishgames.bfglib.bfgreporting.bfgRave.setDelegate (bfgRaveDelegate raveDelegate)
inline
Sets the raveDelegate. NOTE: Not gated to wait for bfgRave initialization on first launchPREREQUISITES: None
Parameters
raveDelegateThe new delegate.

◆ setGoogleLoginEnabled()

void com.bigfishgames.bfglib.bfgreporting.bfgRave.setGoogleLoginEnabled (boolean enableGoogleLogin) throws RaveException
inline
Setter method to show/hide "Sign in with Google" option. By default, the Google sign in option is disabled.PREREQUISITES: None
Parameters
enableGoogleLoginTRUE if Google Login supported.
Since
6.2

◆ setRaveAppDataKeyDelegate()

static void com.bigfishgames.bfglib.bfgreporting.bfgRave.setRaveAppDataKeyDelegate (@Nullable final bfgRaveAppDataKeyDelegate delegate)
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
delegateThe delegate for bfgRaveAppDataKeyDelegate
Since
6.3

◆ setupLoginStatusCallbackWithExternalCallback()

void com.bigfishgames.bfglib.bfgreporting.bfgRave.setupLoginStatusCallbackWithExternalCallback (@Nullable final RaveLoginStatusListener externalCallback)
inline
Sets the externalLoginStatuslistener callback. NOTE: Not gated to wait for bfgRave initialization on first launchPREREQUISITES: None
Parameters
externalCallbackThe callback to be called when login status changes.

◆ sharedInstance()

static synchronized bfgRave com.bigfishgames.bfglib.bfgreporting.bfgRave.sharedInstance ()
inlinestatic
Get singleton instance of bfgRave.
Returns
Single non-null bfgRave instance.

◆ waitForRaveReady()

static void com.bigfishgames.bfglib.bfgreporting.bfgRave.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.