bfgreporting.bfgRaveAppDataKeys Class
App Data Key helper methods. More...
Classes | |
interface | Callback |
Interface for completion callbacks for all public methods. More... | |
Static Public Member Functions | |
static synchronized void | fetchCurrentAppDataKey (@NonNull final Callback callback) |
Initiate a fetch of the current Rave App Data Key. More... | |
static synchronized void | listenForStateChange (@Nullable final Callback callback) |
Set the Rave AppDataKeys delegate to be informed of app data key changes and conflicts. More... | |
static synchronized void | selectRaveAppDataKey (@NonNull final String newAppDataKey, @NonNull final Callback callback) |
Select the new App Data Key. More... | |
Detailed Description
App Data Key helper methods. This class allows the selectRaveAppDataKey, fetchCurrentAppDataKey, and state change listener capabilities to be implemented using anonymous delegates implemented within the calls to the selectRaveAppDataKey, fetchCurrentAppDataKey, and listenForStateChange methods. This provides an alternate way to access the bfgRave AppDataKeys management methods, keeping implementation of result callbacks local within the call to each of the public support methods for better readability.For example, to listen for AppDataKey state changes, use code similar to the following:
@Override
publicvoid onComplete(final String currentAppDataKey, final String previousAppDataKey, final Collection<String> unresolvedAppDataKeys, final Exception exception) {
//Do something if we got a new app data key
if (currentAppDataKey != null) {
//Do something...
} elseif (unresolvedAppDataKeys != null) {
//Do something to let the user choose a new AppDataKey (e.g. within resolveAppDataKey) from the list of unresolved ones, then call selectRaveAppDataKey to select the new key
final String newAppDataKey = resolveAppDataKey(unresolvedAppDataKeys); //Get user-selected AppDataKey from game-specific UX
}
}
});
App Data Key helper methods.
Definition: bfgRaveAppDataKeys.java:44
static synchronized void listenForStateChange(@Nullable final Callback callback)
Set the Rave AppDataKeys delegate to be informed of app data key changes and conflicts.
Definition: bfgRaveAppDataKeys.java:83
Interface for completion callbacks for all public methods.
Definition: bfgRaveAppDataKeys.java:59
- Since
- 6.3
Member Function Documentation
◆ 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.
- Parameters
callback The delegate for result callback
- Since
- 6.3
◆ listenForStateChange()
| 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()
- Parameters
callback The delegate for result callback
- Since
- 6.3
◆ selectRaveAppDataKey()
| inlinestatic |
Select the new 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
newAppDataKey The key that the App Data Key will be changed to callback The delegate for result callback
- Since
- 6.3