Unity API Reference

Contents

Unity API Reference#

Best Practices for Common Scenarios#

Description#

This section describes usage patterns and guidelines for common integration scenarios enabled using RaveSocial APIs that venture beyond the drop-in experience found in the included scene pack.

The scene pack provides a built in user profile experience, for example, but you may create an app-specific profile experience and this guide explains some common scenarios you may encounter.

Using App Data Keys for Save Game or Cloud Storage ID#

To get a stable index for data lookup, especially if Rave ID was used in the past, then RaveAppDataKeys is the recommended API to use. Simply implement the protocol RaveAppDataKeysStateObserver.

public delegate void RaveAppDataKeysStateObserver(String selectedKey, List<String> unresolvedKeys)

By default the selected key returned by this interface will be the current key for the current user. In a typical case, it will be a randomly generated key in a 32 character hex format. If no key had been previously selected for the current application this random key will be the default. The selected key will be non-nil provided that unresolvedKeys is empty, which will usually be the case. When there are unresolved keys, and you are online, then your integration will need to choose between the unresolved keys. Rave will never make a choice between unresolved keys, this is strictly up to the developers discretion.

The integration will choose between unresolved keys when a merge takes place between two users that have already used the current application. At this point either present the user with a choice between the unresolved keys or choose one automatically. With both keys the application can look up information about the two indexes to choose from or present the information to the user. Once a key has been chosen call RaveAppDataKeys.SelectKey() (see SelectKey for more information).

User Profile Scenarios#

Code samples for custom user profile scenarios are provided in SampleRaveProfileScene.cs included in your distribution package.

Accessing the current user#

RaveUsersManager.CurrentUser is a shortcut method for accessing the current user.

Provided RaveSettings.General.AutoGuestLogin is enabled this value should never be null, even after a log out operation. You can access a variety of fields to populate your profile screen including display name, email, and profile picture URL.

Observing the current user#

New in Rave 3.0.2 is an API to register observers for changes to the current user: RaveUsersManager.AddCurrentUserObserver(). When a change occurs, usually as the result of an asynchronous operation, all registered observers will be notified with the an array of the changed properties of the current user.

It is recommended that you leverage this feature in your custom profile scene for displayName and pictureURL (or pictureImage) since they may change as a result of an asynchronous operation that you’ve triggered that didn’t explicitly change those user fields.

Observers should implement the RaveCurrentUserObserver interface, which consists of one method: RaveCurrentUserObserver.UserChanged(List<string>).

void UserChanged(List<string> changedKeys) {
    if (changedKeys.Contains("displayName")) {
        //  Update UI with new display name
    } else if (changedKeys.Contains("pictureImage")) {
        //  Update UI with new profile picture
    } else if (changedKeys.Contains("pictureURL")) {
        //  Update picture image
    }
}

Displaying the profile picture#

The current user has a reference to the pictureURL, it is always a remotely stored image. It will either be stored on Rave’s servers or on a third party’s server, depending on the source of the image.

Unity provides access to the image URL through RaveUsersManager.CurrentUser.pictureURL

Changing the profile picture#

There is a common method on all platforms that takes a local file url and pushes the binary data for the image to the Rave backend so that the profile picture is available on any device.

RaveUsersManager.PushProfilePicture(imageURL,delegate(string error) {
   if(error != "") {
       // do something in the error case
   }
});

Changing the display name#

New in Rave 3.0.2 is an API to modify the current user without staging the changes in the model. RaveUsersManager.PushUserChanges(RaveUserChanges changes, RaveCompletionCallback callback).

RaveUserChanges changes = new RaveUserChanges();
    changes.displayName = someOtherName;
    RaveUsersManager.PushUserChanges(changes, delegate(string error) {
    if (error != "") {
        // Do something with the error
    }
});

Use this new method rather than the legacy method RaveUsersManager.PushCurrent().

Logging out#

If RaveSettings.General.AutoGuestLogin is enabled a new anonymous user will automatically be created when you log out. Prior to the logOut completion callback firing it is suggested that you prevent the user from interacting with Rave.

RaveSocial.LogOut(delegate(string error) {
    if (error != "") {
        // do something to handle the error
    }
});

Finding friends via Facebook (or another social network)#

RaveConnectFriendsController was introduced in Rave 3.0.1. It provides a way to simplify connection of UI and logic and is recommended for most integrations where friend-only connection is desired for anonymous and personalized users.

The connect friend controller will sync a user’s friend/contact list against their list of Facebook friends, or list of friends from another social provider, adding the Facebook friends that started to play the game since the last friend sync happened. The friend sync executes automatically on a configurable time interval.

If the current user is already authenticated the controller will also automatically connect the social provider (ie. Facebook) to Rave, so the user can sign in with that social provider as another authentication method.

The friend sync executes opportunistically with a configurable time interval. For an overview of app contacts features, see: Contacts

Creating a controller:

    RaveConnectFriendsController controller = new RaveConnectFriendsController(RaveConstants.CONNECT_PLUGIN_FACEBOOK);
    controller.SetObserver(delegate(RaveConnectFriendsControllerState state) {
    // ... see details below
    });

    // Only necessary if you want to filter and display error messages
    controller.SetCallback(delegate(string error) {
    if (error != "") {
        // do something to handle the error
    }
});

Tracking current state:

SetObserver(delegate(RaveConnectFriendsControllerState state) {
    // You will also want to update your UI to reflect the state
    switch (value) {
        case RaveFriendsControllerStateNotDownloaded:
            downloaded = false;
            break;
        case RaveFriendsControllerStateDownloading:
            // do something to indicate busy
            break;
        case RaveFriendsControllerStateDownloaded:
            downloaded = true;
            break;
    }
});

Toggling state:

if (downloaded) {
    controller.AttemptForgetFriends();
} else {
    controller.AttemptGetFriends();
}

Authenticate with Facebook (or another social network)#

RaveConnectController was introduced in Rave 3.0.1. It provides a way to simplify connection of UI and logic and is recommended for most integrations.

This controller will associate the user’s Facebook (or other social provider) account with their game account for authentication purposes and sync the user’s Facebook (or other social provider) friends who are playing this game with the Rave contact system, adding any new friends as contacts. The friend sync executes automatically on a configurable time interval.

After a user has connected using this controller, they will be able to access their user account by signing in via this social network account on other devices.

For an overview of app contacts features, see: Contacts

Creating a controller:

RaveConnectController controller =  new RaveConnectController(RaveConstants.CONNECT_PLUGIN_FACEBOOK);
controller.SetObserver(...); // See details below

// Only necessary if you want to filter and display error messages
controller.SetCallback(delegate(string error) {
        //      do something
});

Tracking current state:

SetObserver(delegate(RaveConnectControllerState value) {
        switch (value) {
        case RaveConnectControllerStateDisabled:
                //      disable UI
                break;
        case RaveConnectControllerStateConnected:
                connected = YES;
                break;
        case RaveConnectControllerStateConnecting:
        //  do something to indicate busy
                break;
        case RaveConnectControllerStateDisconnected:
                connected = NO;
                break;
        case RaveConnectControllerStateDisconnecting:
        //  do something to indicate busy
                break;
        }
});

Toggling state:

if (connected) {
    controller.AttemptConnect();
} else {
    controller.AttemptDisconnect();
}

Opening common scenes#

Opening the login scene#

Opening the login scene allows the user to sign in using their BigFish account. It also provides the user with a convenient shortcut to the create account scene through a button. The following example code shows an example of showing the scene and also capturing the result of any login or account creation that occurs. In the case that an account is created the result will be successful and the signup data will be valid. For details of the signup data see the appropriate documentation in the BigFishScenePack.

RaveSocial.ShowLoginScene(delegate(RaveCallbackResult result, BigFishSignUpData signUpData, string error) {
if(result == RaveCallbackResult.RaveResultSuccessful && signUpData != null) {
        // do something
} else if(result == RaveCallbackResult.RaveResultCanceled) {
        // do something else
} else {
        // show error message if deemed appropriate
}
});

Opening the create account scene#

Opening the sign up email scene allows the user to create a BigFish account. It also provides the user with a convenient shortcut to the login scene through a button. The following example code shows an example of showing the scene and also capturing the result of any login or account creation that occurs. In the case that an account is created the result will be successful and the signup data will be valid. For details of the signup data see the appropriate documentation in the BigFishScenePack.

RaveSocial.ShowSignUpEmailScene(delegate(RaveCallbackResult result, BigFishSignUpData signUpData, string error) {
if(result == RaveCallbackResult.RaveResultSuccessful && signUpData != null) {
        // do something
} else if(result == RaveCallbackResult.RaveResultCanceled) {
        // do something else
} else {
        // show error message if deemed appropriate
}
});

Opening the Find Friends scene#

You’ll want to show the Find Friends scene if you want an easy way to attract users to attaching Facebook, Google, Phonebook contacts, etc. to their Rave account.

RaveSocial.ShowFindFriendsScene(delegate(string error) {
// capture when this scene is closed if desired
});

RaveSocial API#

class: RaveSocial

Initialize#

Initialize the SDK:

public static void Initialize()

InitializeRaveWithReadyCallback#

Initialize the SDK and callback on completion:

public static void InitializeRaveWithReadyCallback(RaveCompletionCallback callback)

Parameters:

callback - A completion callback which is called after initialization is complete


VolatileRaveId#

Returns a Rave Id after initialization call has returned. Value may change after ready callback has fired:

public static tring VolatileRaveId;

Returns: Best guess UUID for the Rave user prior to completing initialization


ConnectTo#

Attention

Rather than implementing a fully custom control for connecting your users we suggest as best practice that you instead use your custom UI to wrap one of our connect controllers. Please read Adding a Facebook (or another social provider) button to your App.

Connect the current user to an authentication provider

public static void ConnectTo(string pluginKeyName, RaveCompletionCallback callback)

Parameters:

pluginKeyName - The keyname of the plugin

callback - A callback for the connection attempt


LoginWith#

Attention

Rather than implementing a fully custom control for connecting your users we suggest as best practice that you instead use your custom UI to wrap one of our connect controllers. Please read Adding a Facebook (or another social provider) button to your App.

Logs in with a social plugin. Make sure the current user isn’t already authenticated in before use. This will either connect the current anonymous user to the social plugin, or it will create a new session.

public static void LoginWith(string pluginKeyName, RaveCompletionCallback callback)

Parameters:

pluginKeyName - The keyname of the plugin

callback - A login callback


SignUpWithEmailAndPassword#

Creates a user in with an email and password.

public static void SignUpWithEmailAndPassword(string email, string password, RaveCompletionCallback callback)

Parameters:

email - The user’s email address.

password - The user’s password.

callback - Callback that is called when the sign up completes.

SignInWithEmailAndPassword#

Logs a user in with an email and password.

public static void SignInWithEmailAndPassword(string email, string password, RaveCompletionCallback callback)

Parameters:

email - The user’s email address.

password - The user’s password.

callback - Callback that is called when the sign in completes.

DisconnectFrom#

Disconnects the current user from an authentication provider

public static void DisconnectFrom(string pluginKeyName, RaveCompletionCallback callback)

Parameters:

pluginKeyName - The keyname of the plugin

callback - A completion callback


LogOut#

Logs the current user out of Rave. Deletes the current session and clears the cache.

Providing a null callback will result in operations such as automatic guest login and session deletion happening asynchronously. To guarantee that a race does not happen with any other authentication actions, it is highly recommended that a listener be set and that no other Rave APIs be called until the listener has called back.

If the setting RaveSettings.General.AutoGuestLogin is enabled, a new guest account will be logged in immediately.

public static void LogOut(RaveCompletionCallback callback)

Parameters:

callback - A completion callback


LoginAsGuest#

Logs in as a guest account. Do not call this if already logged in. This will not work if the setting RaveSettings.General.AutoGuestLogin is enabled, as guest login is controlled by Rave in that case and cannot be explicitly controlled.

public static void LoginAsGuest(RaveCompletionCallback callback)

Parameters:

callback - A completion callback


CheckReadinessOf#

Checks the state of a plugin to determine if it is ready to use A plugin is “Ready” if it has a token available from the authentication provider and the current user is connected with a matching ID to the token:

public static void CheckReadinessOf(string pluginKeyName, RaveReadinessCallback callback)

Parameters:

pluginKeyName - The keyname of the plugin

callback - A readiness callback


IsPluginReady#

Returns the cached value of the last time an authentication provider was checked for readiness. A plugin is “Ready” if it has a token available from the provider and the current user is connected with a matching ID to the token:

public static bool IsPluginReady(string pluginKeyName)

Parameters:

pluginKeyName - The keyname of the plugin

Returns: true if the plugin is ready, false if not


IsLoggedIn#

Returns if there is an active session in any state (Guest, Authenticated or otherwise).

public static bool IsLoggedIn()

Returns: true if there is an active session, false if not


IsLoggedInAsGuest#

Returns if there is an active session and the session is for a user in an anonymous (guest) state:

public static bool IsLoggedInAsGuest()

Returns: true if the current user is a guest, false if not or if there is no session


IsPersonalized#

Returns if there is an active session and the session is for a user in personalized state:

public static bool IsPersonalized()

Returns: true if the current user is personalized, false if not or if there is no session


IsAuthenticated#

Returns if there is an active session and the session is for a user in authenticated state:

public static bool IsAuthenticated()

Returns: true if the current user is authenticated, false if not or if there is no session


AppDataKeys API#

header: RaveAppDataKeyManager.cs

class: RaveAppDataKeysManager

App data keys can be used to index cloud or other back-end storage data to a user’s account for a given application. App Data Keys are randomly generated IDs for each user in a 32 character hex format. When the user’s account is merged and both the source and target user of the merge have an active key for a game, the keys will enter an unresolved state and no key will be selected. This API provides the unresolved keys so that an application can provide a selection, either automatically (set by the developer) or via user input. Once a key is selected, the remaining unresolved keys will become rejected. Rejected keys can be selected at any time.

Any key in the list of all available can be selected at any time.

Note

Although the Rave SDK will work correctly in a case where no key is selected, we strongly recommend that the game ensures that a key is selected at all times during a game session. The reason is that when no key is selected, the player’s progress (or other important game data) is not indexed, and therefore progress could be lost. One way to do this is to check whether ADK is selected on game open, and during a network switch.

RaveAppDataKeysStateObserver#

Tip

Best Practice - Every application should be using this API to retrieve the selected app data key or resolve a selected key from the list of unresolved keys.

Implement RaveAppDataKeysStateObserver observer delegate when using the app data keys system to track save keys for cloud storage

appDataKeyStateChanged#

This method will be called after init to establish your current identity or if you are currently in an unresolved state. It will also be called when the system has detected that, after a merge, the current user has no selected app data key. This means that both users in the merge had a selected key and a determination needs to be made about which merged key should become the selected key. See RaveAppDataKeys(Manager) for details on retrieving the unresolved keys and selecting the valid key.

public delegate void RaveAppDataKeysStateObserver(string selectedKey, List<string> unresolvedKeys);

Parameters:

selectedKey - The key selected for this application and user unresolvedKeys - Keys that need to be resolved, there will always be zero or two or more


Callbacks#

RaveAppDataKeysStateCallback#

Callback to provide all possible details for application data keys for this user and application:

public delegate void RaveAppDataKeysStateCallback(string selectedKey, List<string> rejectedKeys, List<string> unresolvedKeys, string error);

Parameters:

selectedKey - The key selected for this application and user rejectedKeys - Keys that have been rejected for use as the selected key unresolvedKeys - Keys that need to be resolved, there will always be zero or two or more error - An error or null


RaveAppDataKeysCallback#

Callback to fetch a subset of the app data keys information:

public delegate void RaveAppDataKeysCallback(List<string> keys, string error);

Parameters:

keys - The array of requested keys error - An error or null


RaveAppDataKeyCallback#

Callback to fetch the selected key:

public delegate void RaveAppDataKeyCallback(string selectedKey, string error);

Parameters:

selectedKey - The app data key selected for the current user error - An error or null


RaveAppDataKeysManager#

Manages app data keys

SetStateObserver#

Set an instance of the appDataKeysStatusObserver:

public void SetStateObserver(RaveAppDataKeysStateObserver stateObserver);

Paramaters:

stateObserver - Observer for changes in status


LastSelectedKey#

Cached last selected key, if any. When possible prefer key from state observer:

string LastSelectedKey();

Returns: Last selected app key or null


FetchCurrentState#

Fetch the selected key, rejected keys, and unresolved keys for this application:

public void FetchCurrentState(RaveAppDataKeysStateCallback callback);

Parameters:

callback - Provides information about data keys for the current application or an error


FetchUnresolved#

Fetch the set of unresolved keys, will either have a count of zero or two or more:

public void FetchUnresolved(RaveAppDataKeysCallback callback);

Parameters:

callback - Callback supplying the keys or an error


FetchSelected#

Fetch the currently selected key for the user. Will be null unless a key has been selected:

public void FetchSelected(RaveAppDataKeyCallback callback);

Parameters:

callback - Callback supplying the selected key or an error


FetchAvailable#

Fetch values available to be used as keys - This list will included every Rave identity associated with the current account:

public void FetchAvailable(RaveAppDataKeysCallback callback);

Parameters:

callback - Callback supplying the requested keys or an error


SelectKey#

Change the selected key to the specified value:

public void SelectKey(string selectedKey, RaveCompletionCallback callback);

Parameters:

selectedKey - The desired value of the new selected key callback - Callback suppyling an error or null on success


DeactivateKey#

Deactivates a key - Requires active network and only works for keys which are selected, rejected or unresolved:

public void DeactivateKey(string key, RaveCompletionCallback callback);

Parameters:

key - The key to deactivate, must be 32 character hex format callback - Callback suppyling an error or null on success


fetchUserKey#

Returns an App Data Key when given a UUID. Essentially a lookup based on UUID:

- public static void FetchUserKey(string raveId, RaveAppDataKeyCallback callback);

Parameters:

  • raveId - The user’s raveID you wish to look up

  • callback - A callback to be called when the operation completes. Contains a selected key or an error


fetchUserKeySet#

Fetch a set of keys given an array of RaveIDs:

- public static void FetchUserKeySet(List<string> raveIds, RaveAppDataKeySetCallback callback);

Parameters:

  • raveIds - A List of desired Rave IDs

  • callback - A callback supplying a list of app data keys or an error


fetchUserKeySetForContacts#

Fetch the current user’s contacts app data keys:

- public static void FetchUserKeySetForContacts(RaveAppDataKeySetCallback callback);

Parameters:

  • callback - a callback to be called when the operation completes. Contains an array of app data key and rave ID pairs or an error


Controllers API#

RaveConnectFriendsController#

class: RaveConnectFriendsController

Enum RaveConnectFriendsControllerState#

  • RaveFriendsControllerStateNotDownloaded: Friends syncing is not enabled

  • RaveFriendsControllerStateDownloading: Friends sycning is in progress

  • RaveFriendsControllerStateDownloaded: Friends sycning is enabled


Delegate RaveConnectFriendsControllerCallback#

Implement this delegate to track state changes in the controller to keep your UI up-to-date:

public delegate void RaveConnectFriendsControllerCallback(RaveConnectFriendsControllerState state);

Parameters:

state - Latest state value


RaveConnectFriendsController#

Constructor for new friends controller:

public RaveConnectFriendsController(string pluginKeyName);

Parameters:

pluginKeyName - Key for the plugin to use with this controller instance

Returns: Instance of RaveConnectFriendsController for the plugin specified


SetObserver#

Implement RaveConnectFriendsControllerCallback and set your observer instance in the controller:

public void SetObserver(RaveConnectFriendsControllerCallback observer);

Parameters:

observer - Reference to object implementing the state observer. Recommend you have a unique observer for each controller/plugin pair.


AttemptGetFriends#

Attempt to sync friends asynchronously. Checks internal logic to ensure that the plugin is enabled and that friends haven’t already been synced. If the user is authenticated will attempt to connect the plugin to the curent user in addition to syncing friends. Track changes to state through the observer:

public void AttemptGetFriends();

AttemptForgetFriends#

Attempt to stop syncing friends asynchronously. Checks internal logic to ensure that the plugin is enabled and that friends have been synced. If the user is authenticated this call will attempt to disconnect the plugin from the current user in addition to stopping syncing. Track changes to state through the observer:

public void AttemptForgetFriends();

RaveConnectController#

Enum RaveConnectControllerState#

  • RaveConnectControllerStateDisabled : Controller is disabled, plugin isn’t available

  • RaveConnectControllerStateConnected : Controller is connected, plugin is ready to use

  • RaveConnectControllerStateConnecting : Controller is in the process of asynchronously attempting to connect, plugin is not ready

  • RaveConnectControllerStateDisconnected : Controller is disconnected, plugin is not ready

  • RaveConnectControllerStateDisconnecting : Controller is in the process of asynchronously attempting to disconnect, plugin is not ready


Delegate RaveConnectControllerCallback#

Implement this observer to track state changes to the controller to keep your UI up-to-date:

public delegate void RaveConnectControllerCallback(RaveConnectControllerState state);

Parameters:

state - Latest state value


RaveConnectController#

Constructor for instances of RaveConnectController:

public RaveConnectController(String pluginKeyName);

Parameters:

pluginKeyName - Key name for plugin to use for this controller

Returns: Instance of RaveConnectController for the plugin specified


SetObserver#

Implement RaveConnectControllerCallback and set your instance in the controller using setObserver:

public void SetObserver(RaveConnectControllerCallback observer);

Parameters:

observer - Observer instance. Recommended that you have a different instance per plugin/controller pair.


AttemptConnect#

Attempt to connect asynchronously. Checks internal logic to ensure that the plugin is enabled and plugin isn’t already connected. Track changes to state through the observer:

public void AttemptConnect();

AttemptDisconnect#

Attempt to disconnect asynchronously. Checks internal logic to ensure that the plugin is connected. Track changes to state through the observer:

public void AttemptDisconnect();

Authenticated Merging API#

There are several important decision points that can occur during an authenticated merge that need to be handled carefully for a successful integration. As a result, authenticated merging is not enabled unless an integrator sets an instance of a RaveMergePolicy. A demonstration policy will be provided in your accompanying scene pack and demo.

To enable merging set an instance of RaveMergePolicy via RaveSocial.SetMergePolicy(). A merge attempt will typically be triggered during a connect operation when attempting to add an authentication source during an account. See Account conflict resolution for more information about conflict scenarios. You are strongly discouraged from automatically deciding to accept the merge as two accounts cannot be unmerged once merged. This obviously could have unintended effects on a player’s progress.

Delegate RaveMergeDecisionCallback#

When a merge policy is invoked you’re given a callback of this type that the SDK uses to determine when your user has decided whether to accept the potential merge.

Use this callback after the user has decided whether to accept the potential merge with the result of their decision.

public delegate void RaveMergeDecisionCallback(bool shouldMerge);

Parameters:

shouldMerge - True if the user decided to proceed with the merge, otherwise false


Class RaveMergeUser#

A typical RaveUser with one additional field added - selectedAppDataKey so that you can potentially preview save game data for the other user.:

public string selectedAppDataKey;

Delegate RaveMergePolicy#

This policies method will be invoked when a decision point is reached for triggering a merge during an account conflict.

public void delegate RaveMergePolicy(RaveMergeUser targetUser, RaveMergeDecisionCallback callback);

Parameters:

targetUser - User the current user will be merged into. Some fields will be filled out, such as displayName and profile picture URL so that you can help the user decide whether or not they mean to merge.

callback - Merge decision callback, use after user has indicated whether they want to continue the merge. You are strongly discouraged from automatically deciding to merge.


Note

See BigFishMergePolicy in BigFishScenePack package for a possible default implementation of a merge policy. Call RaveSocial.EnableDefaultMergePolicy() to use it in your integration.


Achievements API#

Note

In order to use achievements in your application, you must define your achievements in the Rave Developer Portal. See the Achievements section in the portal documentation for instructions on how to create acheivements.

class: RaveAchievementsManager

GetAchievementByKey#

Retrieve a RaveAchievement from the local cache based on key:

public static RaveAchievement GetAchievementByKey(string key)

Parameters:

key - Key for a matching achievement

Returns: Reference to a RaveAchievement or null if no match is found

UpdateAchievements#

Retrieve all Rave achievements from the server and update the local cache with the retrieved data.

public static void UpdateAchievements(RaveCompletionCallback callback)

Parameters:

callback - Callback to call when the update is completed


Achievements#

Retrieves all achievements stored in the local cache.

public static List<RaveAchievement> Achievements { get }

Returns: A List of RaveAchievement objects.


UnlockAchievement#

Unlock an achievement for the current user, specified by achivement key.

public static void UnlockAchievement(string achievementKey, RaveCompletionCallback callback)

Parameters:

achievementKey - A string containing the key of the achievement to be unlocked

callback - Callback to call when the unlock achievement operation is completed


Contacts API#

class: RaveContactsManager

UpdateAll#

Retrieve all Rave contacts from the server and update the local cache with the retrieved data.

public static void UpdateAll(RaveCompletionCallback callback)

Parameters:

callback - callback to call when the update is completed


UpdateAllUsingThisApplication#

Retrieve all Rave contacts from the server that also use the current application and update the local cache with the retrieved data.

public static void UpdateAllUsingThisApplication(RaveCompletionCallback callback)

Parameters:

callback - Callback to call when the update is completed


UpdateAllUsingApplication#

Retrieve all Rave contacts from the server that also use the specified application and update the local cache with the retrieved data.

public static void UpdateAllUsingApplication(string appId, RaveCompletionCallback callback)

Parameters:

appId - Rave Application ID of the specified application

callback - Callback to call when the update is completed


All#

Retrieves all contacts stored in your Rave account from the local cache.

public static List<RaveContact> All { get }

Returns: A List of RaveContact objects.


AllUsingThisApplication#

Retrieves all contacts stored in your Rave account that also use the current application from the local cache.

public List<RaveContact> AllUsingThisApplication { get }

Returns: A List of RaveContact objects.


GetAllUsingApplication#

Retrieves all contacts stored in your Rave account that also use the specified application from the local cache.

public static List<RaveContact> GetAllUsingApplication(string appId)

Parameters:

appId - Rave Application ID of the specified application

Returns: A List of RaveContact objects.


UpdateFacebook#

Retrieve all Rave contacts, that originated from Facebook, from the server and update the local cache with the retrieved data.

public static void UpdateFacebook(RaveCompletionCallback callback)

Parameters:

callback - Callback to call when the update is completed


Facebook#

Retrieves all contacts that originated from Facebook stored in your Rave account from the local cache.

public static List<RaveContact> Facebook { get }

Returns: A List of RaveContact objects.


DeleteContact#

Delete a specified Rave contact and notify the server of the deletion.

public static void DeleteContact(string userUuid, RaveCompletionCallback callback)

Parameters:

userUuid - Rave User ID of the specified contact

callback - Callback to call when the server has completed the delete operation


AddContactsByUsername#

Manually add contacts by username. Username is any arbitrary string that is used to identify the contact.

public static void AddContactsByUsername(string usernames, RaveCompletionCallback callback)

Parameters:

usernames - A list of usernames to add as contacts

callback - Callback to call when the server has completed the add contact operation


FetchAllExternal#

Fetch all external contacts/friends from all social networks and third party providers and filter them as specified.

public static void FetchAllExternal(RaveContactsFilter filter, RaveContactsCallback callback)

Parameters:

filter - Filter to use for fetching contacts. RaveContactsFilter enum: INCLUDE_ALL, INCLUDE_ONLY_USING_APP, EXCLUDE_USING_APP

callback - Callback to call when the server has completed the fetch operation and returns the list of fetched contacts


FetchExternalFrom#

Fetch all external contacts/friends from a social network or third party and filter them as specified.

public static void FetchExternalFrom(string pluginKeyName, RaveContactsFilter filter, RaveContactsCallback callback)

Parameters:

pluginKeyName - Social network or third party plugin key name. Plugin key names are stored in the static RaveConstants class

filter - Filter to use for fetching contacts. RaveContactsFilter enum: INCLUDE_ALL, INCLUDE_ONLY_USING_APP, EXCLUDE_USING_APP

callback - Callback to call when the server has completed the fetch operation and returns the list of fetched contacts


Friends API#

Deprecation Warning

As of v3.13.0, this API is deprecated and planned for removal in a future release. We strongly advise that you adjust your code dependencies to avoid potential disruptions, as continuous updates and support for this API will not be available after its removal.

class: RaveFriendsManager#

Main API for accessing Rave friends


FriendsListQuery#

Start query for friends list:

public static void RaveListQueryBuilder FriendsListQuery(string listKey);

Parameters:

listKey - Key for the friends list to query

Returns: Reference to a list query builder for filtering friends


UpdateFriendsList#

Update cached list of friends for given key:

public static void UpdateFriendsList(string listKey, RaveCompletionCallback callback);

Parameters:

listKey - Key identifier for list being updated

callback - Callback indicating success of operation


RemoveFriend#

Remove friend from specified list:

public static void RemoveFriend(string listKey, string friendId, RaveCompletionCallback callback);

Parameters:

listKey - Key identifier for list friend is being removed from

friendId - Rave id for friend being removed

callback - Callback indicating success of the operation


SendFriendRequest#

Send friend request to another Rave user:

public static void SendFriendRequest(RaveUserReference reference, string listKey, RaveCompletionCallback callback);

Parameters:

reference - Reference to user to befriend

listKey - Identifier for list to send friend request through

callback - Callback indicating success of the operation


FetchSentFriendRequests#

Fetch list of pending friend requests sent by the current user:

public static void FetchSentFriendRequests(string listKey, RaveFriendRequestCallback callback);

Parameters:

listKey - Identifier for the list to query

callback - Callback providing the list of results or an error


CancelFriendRequest#

Cancel a pending sent friend request:

public static void CancelFriendRequest(string listKey, string raveId, RaveCompletionCallback callback);

Parameters:

listKey - Identifier for the list to remove the friend request from

raveId - Rave id for the user that the request is being canceled for

callback - Callback indicating success of the operation


FetchReceivedFriendRequests#

Fetch list of pending friend requests sent by the current user:

public static void FetchReceivedFriendRequests(string listKey, RaveFriendRequestCallback callback);

Parameters:

listKey - Identifier for the list to query

callback - Callback providing the list of results or an error


AcceptFriendRequest#

Accept received friend request:

public static void AcceptFriendRequest(string listKey, string friendId, RaveCompletionCallback callback);

Parameters:

listKey - Identifier for the list to accept friend request in

friendId - Rave id for user accepting friend request from

callback - Callback indicating success of the operation


RejectFriendRequest#

Reject received friend request:

public static void RejectFriendRequest(string listKey, string raveId, RaveCompletionCallback callback);

Parameters:

listKey - Identifier for the list to accept friend request in

raveId - Rave id for user accepting friend request from

callback - Callback indicating success of the operation


Query Recipes#

Now you can filter friends and followers with query builders. For example if you want to find the first ten users alphabetically that have the name “Frank” you would use the following code snippet:

RaveFriendsManager.FriendsListQuery("ExampleListKey").OrderBy(RaveRelationshipOrderByRealName).Where(RaveRelationshipWhereRealName).Like("Frank*").Limit(10).Get()

Or if you wanted to find the third person with the displayName “BubbleGum” this snippet would serve:

RaveFriendsManager.FriendsListQuery("ExampleListKey").Where(RaveRelationshipWhereDisplayName).Equals("BubbleGum").Offset(2).Get()

class: RaveRelationshipListQueryBuilder#

A query builder to query lists of relationships


Get#

Retrieve the query results from the chain of builder calls:

public static List<RaveRelationship> Get();

Returns: The filtered query results


Like#

An SQL standard ‘WHERE field LIKE’ clause:

public static RaveRelationshipListQueryBuilder Like(string pattern);

Parameters:

pattern - The standard SQL LIKE clause

Returns: A list query builder


Equals#

An SQL standard ‘WHERE field ==’ clause:

public static RaveRelationshipListQueryBuilder Equals(string pattern);

Parameters:

pattern - The stander SQL ‘WHERE field ==’ clause

Returns: A list query builder


Where#

Add a standard SQL ‘WHERE’ clause - May only be used once per field:

public static RaveRelationshipListQueryBuilder Where(RaveRelationshipWhere field);

Parameters:

field - The field to match on

Returns: A search query builder


Offset#

The result starting offset - Only one offset is allowed in a query builder chain:

public static RaveRelationshipListQueryBuilder Offset(unit offset);

Parameters:

offset - The offset, starting at 0

Returns: A list query builder


Limit#

The result limit - Only one limit is allowed in a quiery builder chain:

public static RaveRelationshipListQueryBuilder Limit(uint limit);

Parameters:

limit - The limit value

Returns: A list query builder


OrderBy#

The result order - Only one orderBy is allowed in a query builder chain:

public static void RaveRelationshipListQueryBuilder OrderBy(RaveRelationshipOrderBy field);

Parameters:

field - The field to order by

Returns: A list query builder


Followers API#

Deprecation Warning

As of v3.13.0, this API is deprecated and planned for removal in a future release. We strongly advise that you adjust your code dependencies to avoid potential disruptions, as continuous updates and support for this API will not be available after its removal.

class: RaveFollowersManager#

Main API for accessing Rave followers


updateFollowingList#

Update following list for given key:

public static void UpdateFollowersList(string listKey, RaveCompletionCallback callback)

Parameters:

listKey - Identifier for list to update

callback - Callback indicating success of the operation


followingListQuery#

Query following list for given key:

public static RaveRelationshipListQueryBuilder FollowersListQuery(string listKey)

Parameters:

listKey - Identifier for the list to query

Returns: List query builder for given list


updateFollowersList#

Update followers list for given key:

public static void UpdateFollowingList(string listKey, RaveCompletionCallback callback)

listKey - Identifier for list to update

callback - Callback indicating success of the operation


followersListQuery#

Query followers list for given key:

       public static RaveRelationshipListQueryBuilder FollowingListQuery(string listKey)

**Parameters:**

listKey - Identifier for the list to query

Returns: List query builder for given list


followUser#

Follow a user:

public static void FollowUser(string listKey, RaveUserReference reference, RaveCompletionCallback callback)

Parameters:

listKey - Identifier for the list to add the followee to

reference - Reference to Rave user

callback - Callback indicating success of the operation


unfollowUser#

Unfollow a user:

public static void UnfollowUser(string listKey, string raveId, RaveCompletionCallback callback)

Parameters:

listKey - Identifier for the list to remove the followee from

raveId - Rave id for the user to unfollow

callback - Callback indicating success of the operation


Query Recipes#

Now you can filter friends and followers with query builders. For example if you want to find the first ten users alphabetically that have the name “Frank” you would use the following code snippet:

RaveFriendsManager.FriendsListQuery("ExampleListKey").OrderBy(RaveRelationshipOrderByRealName).Where(RaveRelationshipWhereRealName).Like("Frank*").Limit(10).Get()

Or if you wanted to find the third person with the displayName “BubbleGum” this snippet would serve:

RaveFriendsManager.FriendsListQuery("ExampleListKey").Where(RaveRelationshipWhereDisplayName).Equals("BubbleGum").Offset(2).Get()

class: RaveRelationshipListQueryBuilder#

A query builder to query lists of relationships


Get#

Retrieve the query results from the chain of builder calls:

public static List<RaveRelationship> Get();

Returns: The filtered query results


Like#

An SQL standard ‘WHERE field LIKE’ clause:

public static RaveRelationshipListQueryBuilder Like(string pattern);

Parameters:

pattern - The standard SQL LIKE clause

Returns: A list query builder


Equals#

An SQL standard ‘WHERE field ==’ clause:

public static RaveRelationshipListQueryBuilder Equals(string pattern);

Parameters:

pattern - The stander SQL ‘WHERE field ==’ clause

Returns: A list query builder


Where#

Add a standard SQL ‘WHERE’ clause - May only be used once per field:

public static RaveRelationshipListQueryBuilder Where(RaveRelationshipWhere field);

Parameters:

field - The field to match on

Returns: A search query builder


Offset#

The result starting offset - Only one offset is allowed in a query builder chain:

public static RaveRelationshipListQueryBuilder Offset(unit offset);

Parameters:

offset - The offset, starting at 0

Returns: A list query builder


Limit#

The result limit - Only one limit is allowed in a quiery builder chain:

public static RaveRelationshipListQueryBuilder Limit(uint limit);

Parameters:

limit - The limit value

Returns: A list query builder


OrderBy#

The result order - Only one orderBy is allowed in a query builder chain:

public static void RaveRelationshipListQueryBuilder OrderBy(RaveRelationshipOrderBy field);

Parameters:

field - The field to order by

Returns: A list query builder


Groups API#

class: RaveGroups

getGroup#

Retrieve a RaveGroup information object with a specified groupAddress parameter.

public static void GetGroup(string groupAddress, RaveGroupCallback callback);

Parameters:

groupAddress - String representing the address of the group info that is to be accessed.

callback - The callback containing the group search result.


createGroup#

Create a RaveGroup object and register it with the API service. Currently, all created groups will be public groups and will be scoped to the current application. This method form will create a Group with an auto-generated keyname.

public static void CreateGroup(string displayName, RaveGroupCallback callback);

Parameters:

displayName - String containing the name of the group to be displayed to users.

callback - The callback containing the group search result.

Create a RaveGroup object with a specified key and register it with the API service. Currently, all created groups will be public groups and will be scoped to the current application. This method form will create a Group with keyname specified in the second paramer.

public static void CreateGroup(string displayName, string keyname, RaveGroupCallback callback);

Parameters:

displayName - String containing the name of the group to be displayed to users.

keyname - String used uniquely identify a group. This keyname is used to form the full Group Address used to access any group.

callback - The callback containing the group search result.


deleteGroup#

Remove the associated group object records from the Rave API service.

public static void DeleteGroup(RaveCompletionCallback callback);

Parameters:

callback - Callback to call when the delete is completed


updateGroup#

Update the RaveGroup object’s current state with Rave API service.

public static void UpdateGroup(RaveGroupChanges changes, RaveCompletionCallback callback);

Parameters:

changes - The changes to make to the group.

callback - Callback to call when the update is completed


getMembers#

Retrieves all members that have joined this group.

public static List<RaveGroupMember> GetGroupMembers();

Returns: A List of RaveRaveContact objects.


addMembers#

A method to add a list of RaveContact ojects to the group.

public static void AddMembers(List<RaveUserReference> users, RaveCompletionCallback callback);

Parameters:

members - An List reference containing a list of referenced RaveUserReference objects to be added to the group for membership.

callback - Callback to call when the members have been added.


removeMember#

Removes a RaveContact from the membership of the group and update the removal on the Rave API service. Removed contacts can no longer participate in group activity:

public static void RemoveMember(RaveGroupMember member, RaveCompletionCallback callback);

Parameters:

member - A RaveGroupMember object representing the user contact to have their membership status removed from this group.

callback - Callback to call when the members have been removed.


createJoinRequest#

Requests to join the group.:

public static void CreateJoinRequest(RaveCompletionCallback callback);

Parameters

callback - Callback to call when the request has been created.


acceptJoinRequest#

Accept a JoinRequest object reference to allow a user to join the group. User that activates this method must be the Group admin.:

public static void AcceptJoinRequest(RaveJoinRequest request, RaveCompletionCallback callback);

Parameters:

request - A JoinRequest object reference representing the request to be granted to the group

callback - Callback to call when the acceptance is completed


getJoinRequests#

Lists all outstanding requests to join the group. User that activates this method must be the Group admin.

public static void GetJoinRequests(RaveJoinRequestsCallback callback);

Parameters:

callback - A callback containing fetched join requests.


removeJoinRequest#

Reject a RaveJoinRequest object reference to deny a RaveContact user membership to join the group. User that activates this method must be the Group admin.:

public static void RemoveJoinRequest(RaveJoinRequest request, RaveCompletionCallback callback);

Parameters:

request - A JoinRequest object reference representing the request to be denied to the group

callback - Callback to call when the removal is completed


createGroupInvite#

Invites a RaveUser to join the group. User that activates this method must be the Group admin.:

public static void CreateGroupInvite(RaveUserReference invitee, RaveCompletionCallback callback);

Parameters

invitee - A RaveUserReference object reference representing the user that is being invited to join the RaveGroup object.

callback - A callback to call when the group invite has been created.


acceptGroupInvite#

Accept a RaveGroupInvite object reference to confirm a RaveContact user’s invitation to join the group. User that activates this method must be the invitee.:

public static void AcceptGroupInvite(RaveGroupInvite invitation, RaveCompletionCallback callback);

Parameters:

invitation - A RaveGroupInvite object reference representing the invitation to join the group

callback - Callback to call when the acceptance is completed


getGroupInvites#

Lists all outstanding invitations to the group

public static void GetGroupInvites(string groupAddress, RaveGroupInvitesCallback callback);

Paramters:

groupAddress - The address of the group to fetch invites for.

callback - A callback containing group invites.


removeGroupInvite#

Removes an invitation join a group

Reject a Group object reference to not accept membership to join a group. User that activates this method must be the invitee.

public static void RemoveGroupInvite(RaveGroupInvite request, RaveCompletionCallback callback);

Parameters:

request - A GroupInvite object reference representing the membership invitation that the user wants to reject.

callback - Callback to call when the removal is completed


isMember#

Checks to see if a RaveUser is a member of a group or role within the group

public static bool IsMember(RaveUserReference userReference);

Parameters:

userReference - The RaveUserReference object that is to be checked against the group object for membership or role.

Returns: bool answer to whether the specified RaveContact is a member of the group.


blockMembers#

Blocks a list of entities /users from joining a group.

public static void BlockMembers(List<RaveUserReference> users, RaveCompletionCallback callback);

Parameters:

users - An List reference containing a list of referenced RaveUserReference objects to be blocked from requesting or being invited to the group.

callback - Callback to call when the blocking is completed


unblockMember#

Unblocks a list of entities from joining a group

public static void UnblockMembers(List<RaveUserReference> users, RaveCompletionCallback callback);

Parameters:

users - An List reference containing a list of referenced RaveUserReference objects to be unblocked from requesting or being invited to the group.

callback - Callback to call when the unblocking is completed


getGroupBlocks#

Lists all entities blocked from joining a group

public static void GetGroupBlocks(RaveUsersCallback callback);

Paramters:

callback - A callback that contains the blocked users for a group.


changeMemberRole#

Changes the role membership of a particular group from one role to another.

public static void ChangeMemberRole(RaveGroupMember member, RaveGroupRole role, RaveCompletionCallback callback);

Parameters:

member - The GroupMember object representing a user and current membership in the group.

role - An Enum value setting the role a member has in the group

callback - Callback to call when the change is completed


getMember#

returns info about the member, including their role in the group

public static RaveGroupMember GetMember(string uuid);

Parameters:

uuid - RaveID of the user to fetch.

Returns: A RaveGroupMember object which contains basic information about the user contact this membership info represents, and their current tole and memership status in the group.

Gifts API#

class: RaveGiftsManager

Note

In order to use gifts or requests in your application, you must define your gifts that can be given or requested in the Rave Developer Portal. See the Gifts section in the portal documentation for instructions on how to create gifts.

GiftTypes#

Returns the cached list of gift types:

public static List<RaveGiftType> GiftTypes { get }

Returns: The list of cached gift types for this application


GetGiftTypeByKey#

Returns a gift type by key:

public static RaveGiftType GetGiftTypeByKey(string typeKey)

Parameters:

key - The key of the gift type

Returns: A RaveGiftType or null if no matching


UpdateGiftTypes#

Get the list of gift types for this application:

public static void UpdateGiftTypes(RaveCompletionCallback callback)

Parameters:

callback - Server response callback for gift types


Gifts#

Gets a list of the gifts cached for this user:

public static List<RaveGift> Gifts { get }

Returns: The list of cached gifts for this user


UpdateGifts#

Updates the list of gifts from the server:

public static void UpdateGifts(RaveCompletionCallback callback)

Parameters:

callback - Response callback upon completion of the request


GetGiftById#

Returns a gift by giftId:

public static RaveGift GetGiftById(string giftId)

Parameters:

giftId - The giftId to use

Returns: A RaveGift or null if not found or not synced locally


GetGiftRequestById#

Returns a gift request by giftRequestId:

public static RaveGiftRequest GetGiftRequestById(string requestId)

Parameters:

giftRequestId - The giftRequestId to use

Returns: A RaveGiftRequest or null if not found or not synced locally


SendGiftsToUsersWithKey#

Sends a gift to multiple users.

The maximum number of users that can be sent to in one call is 20

public static void SendGiftsToUsersWithKey(string giftTypeKey, List<String> userIds, RaveGiftResultCallback callback))

Parameters:

giftTypeKey - giftTypeKey The key of the gift type to send

userIds - A list of RaveIDs to send to

callback - result callback


SendGifts#

Send a gift to multiple users:

public static void SendGifts(string giftTypeId, List<String> userIds, RaveGiftResultCallback callback)

Parameters:

giftType - The type of the gift to send

users - The list of users to send to the gift to, internally converted

callback - Optional result callback to track success or failure of operation


AcceptGiftId#

Accept gift by gift ID:

public static void AcceptGiftId(string giftId, RaveCompletionCallback callback)

Parameters:

giftId - The gift ID for the gift to accept

callback - Optional result callback to track success or failure of operation


RejectGiftById#

Reject a gift by gift ID:

public static void RejectGiftById(string giftId, RaveCompletionCallback callback)

Parameters:

giftId - The ID of the gift to reject

callback - Optional result callback to track success or failure of operation


GetGiftRequestById#

Returns the list of cached gift requests:

public static RaveGiftRequest GetGiftRequestById(string requestId)

Returns: The list of cached gift requests


GiftRequests#

Returns the local cache of gift requests:

public static List<RaveGiftRequest> GiftRequests { get }

UpdateGiftRequests#

Updates the local cache of gift requests from the server:

public static void UpdateGiftRequests(RaveCompletionCallback callback)

Parameters:

callback - Response callback upon completion of the request


RequestGiftWithKey#

Request a gift from a group of Rave users:

public static void RequestGiftWithKey(string giftTypeKey, List<String> userIds, RaveGiftResultCallback callback)

Parameters:

giftTypeKey - The key of the gift type being requested

userIds - The Rave IDs of the users targeted by the request

callback - Optional result callback to track success or failure of operation


GrantGiftRequestById#

Grant gift request by request ID:

public static void GrantGiftRequestById(string requestId, RaveCompletionCallback callback)

Parameters:

requestId - The request ID for the gift request to grant

callback - Optional result callback to track success or failure of operation


IgnoreGiftRequestById#

Ignore a gift request by request ID:

public static void IgnoreGiftRequestById(string requestId, RaveCompletionCallback callback)

Parameters:

requestId - The UUID of the gift request to ignore

callback - Optional result callback to track success or failure of operation


Leaderboards API#

class: RaveLeaderboardManager

Note

In order to use leaderboards in your application, you must define your leaderboards in the Rave Developer Portal. See the Leaderboards and Tournaments / Timed Leaderboards section in the portal documentation for instructions on how to create leaderboards.

UpdateLeaderboards#

Updates the list of leaderboards from the server:

public static void UpdateLeaderboards(RaveCompletionCallback callback)

Parameters:

callback - A completion callback


Leaderboards#

Retrieves the list of leaderboards from cache:

public static List<RaveLeaderboard> Leaderboards { get }

Returns: A List of RaveLeaderboard objects


GetLeaderboardByKey#

Gets a leaderboard by key:

public static RaveLeaderboard GetLeaderboardByKey(string leaderboardkey)

Parameters:

LeaderboardKey - The key

Returns: A RaveLeaderboard or null if no leaderboard by that name or no leaderboards synced


SubmitScoreByKey#

Submits a score to a leaderboard:

public static void SubmitScoreByKey(string leaderboardKey, float score, RaveCompletionCallback callback)

Parameters:

leaderboardKey - The key of the leaderboard

score - The score to submit

callback - A completion callback


UpdateGlobalScoresByKey#

Updates a leaderboard’s global scores from the server:

public static void UpdateGlobalScoresByKey(string leaderboardKey, float page, float pageSize, RaveCompletionCallback callback)

Parameters:

leaderboardKey - The key of the leaderboard to update

page - Which page to update

pageSize - The size of the page (max 50)

callback - A completion callback


GetGlobalScoresByKey#

Gets the global scores from local cache:

public static List<RaveScore> GetGlobalScoresByKey(string leaderboardKey, float page, float pageSize)

Parameters:

leaderboardKey - The key of the leaderboard to get for

page - Which page to get

pageSize - The size of the page (max 50)

Returns: A List of RaveScore objects


UpdateFriendsScoresByKey#

Updates the user’s friends’ scores for a leaderboard from the server:

public static void UpdateFriendsScoresByKey(string leaderboardKey, float page, float pageSize, RaveCompletionCallback callback)

Parameters:

leaderboardKey - The key of the leaderboard to update

page - Which page to update

pageSize - The size of the page (max 50)

callback - A completion callback


GetFriendsScoresByKey#

Gets the user’s friends’ scores for a leaderboard from local cache:

public static List<RaveScore> GetFriendsScoresByKey(string leaderboardKey, float page, float pageSize)

Parameters:

leaderboardKey - The key of the leaderboard to get for

page - Which page to get

pageSize - The size of the page (max 50)

Returns: A List of RaveScore objects


UpdateMyGlobalScoresByKey#

Updates the page of scores which has the user’s current global score for a leaderboard from the server:

public static void UpdateMyGlobalScoresByKey(string leaderboardKey, float pageSize, RaveCompletionCallback callback)

Parameters:

leaderboardKey - The key of the leaderboard to update

pageSize - The size of the page (max 50)

callback - A completion callback


GetMyGlobalScoresByKey#

Gets the page of scores which has the user’s global scores for a leaderboard from local cache.

This method returns the page of scores which has the user’s current score:

public static List<RaveScore> GetMyGlobalScoresByKey(string leaderboardKey, float pageSize)

Parameters:

leaderboardKey - The key of the leaderboard to get for

pageSize - The size of the page (max 50)

Returns: A List of RaveScore objects


UpdateMyFriendsScoresByKey#

Updates the page of friends’ scores which has the user’s score for a leaderboard from the server:

public static void UpdateMyFriendsScoresByKey(string leaderboardKey, float pageSize, RaveCompletionCallback callback)

Parameters:

leaderboardKey - The key of the leaderboard to update

pageSize - The size of the page (max 50)

callback - A completion callback


GetMyFriendsScoresByKey#

Gets the user’s friends’ scores for a leaderboard from local cache.

This method returns the page of friends’ scores which has the user’s current score:

public static List<RaveScore> GetMyFriendsScoresByKey(string leaderboardKey, float pageSize)

Parameters:

leaderboardKey - The key of the leaderboard to get for

pageSize - The size of the page (max 50)

Returns: A List of RaveScore objects


UpdateMyGlobalScoresAdjacentByKey#

Updates the user’s global scores with adjacency for a leaderboard from the server.

This method centers the list of scores on the user’s current score:

public static void UpdateMyGlobalScoresAdjacentByKey(string leaderboardKey, float adjacent, RaveCompletionCallback callback)

Parameters:

leaderboardKey - The key of the leaderboard to update

adjacent - The number of adjacent scores (before and after the users score) to show

callback - A completion callback


GetMyGlobalScoresAdjacentByKey#

Gets the user’s global scores with adjacency for a leaderboard from local cache

This method centers the list of scores on the user’s current score. The list of scores will be up to 2*adjacent+1 in size depending on the user’s position in the list. If the user is in the first or last adjacent number of scores, there will be less results:

public static List<RaveScore> GetMyGlobalScoresAdjacentByKey(string leaderboardKey, float adjacent)

Parameters:

leaderboardKey - The key of the leaderboard to get for

adjacent - The number of adjacent scores (before and after the users score) to show

Returns: A List of RaveScore objects


UpdateMyFriendsScoresAdjacentByKey#

Updates the user’s friends’ scores with adjacency for a leaderboard from the server.

This method centers the list of scores on the user’s current score:

public static void UpdateMyFriendsScoresAdjacentByKey(string leaderboardKey, float adjacent, RaveCompletionCallback callback)

Parameters:

leaderboardKey - The key of the leaderboard to update

adjacent - The number of adjacent scores (before and after the users score) to show

callback - A completion callback


GetMyFriendsScoresAdjacentByKey#

Gets the user’s friends’ scores with adjacency for a leaderboard from local cache

This method centers the list of scores on the user’s current score. The list of scores will be up to 2*adjacent+1 in size depending on the user’s position in the list. If the user is in the first or last adjacent number of scores, there will be less results:

public static List<RaveScore> GetMyFriendsScoresAdjacentByKey(string leaderboardKey, float adjacent)

Parameters:

leaderboardKey - The key of the leaderboard to get for

adjacent - The number of adjacent scores (before and after the users score) to show

Returns: A List of RaveScore objects


GetHighScoreByKey#

Gets the current high score for a leaderboard from cache:

public static float GetHighScoreByKey(string leaderboardKey)

Parameters:

leaderboardKey - The key of the leaderboard

Returns: The current high score


GetGlobalPositionByKey#

Gets the user’s global position in a leaderboard from cache:

public static float GetGlobalPositionByKey(string leaderboardKey)

Parameters:

leaderboardKey - The key of the leaderboard

Returns: The current global position


GetFriendsPositionByKey#

Gets the user’s position amongst friends in a leaderboard from cache:

public static float GetFriendsPositionByKey(string leaderboardKey)

Parameters:

leaderboardKey - The key of the leaderboard

Returns: The current position amongst friends


GetLeaderboardScores#

Gets the user’s scores given a request:

public static void GetLeaderboardScores(RaveLeaderboardsRequest request, RaveLeaderboardScoresCallback callback)

Parameters:

request - A leaderboard request.

callback - A callback containing the list of scores or an error.


Sharing API#

class: RaveSharingManager


PostToFacebook#

Create a Facebook wall post:

public static void PostToFacebook(string wallPost, RaveCompletionCallback callback)

Parameters

wallPost - The text of the wall post

callback - A completion callback


PostToFacebookWithImage#

Create a Facebook wall post with an image:

public static void PostToFacebookWithImage(string wallPost, string image, RaveCompletionCallback callback)

Parameters

wallPost - The text of the wall post

image - The URL of the image to send. See more about where to put images so that Unity can send them via URLS at this page

callback - A completion callback


PostToGooglePlus#

Share with Google:

public static void PostToGooglePlus(string postText, string imageURL, RaveCompletionCallback callback)

Parameters

wallPost - The text of the post

image - The URL of the image to send. See more about where to put images so that Unity can send them via URLS at this page

callback - A completion callback


ShareWith#

Share with external contacts:

public static void ShareWith(List<RaveContact> externalContacts, string subject, string message, RaveShareRequestCallback callback)

Parameters

externalContacts - A list of RaveContacts to share this post wiath

subject - The subject of the post

message - The text of the post

callback - A share request callback


ShareWithViaPlugin#

Share using another service:

public static void ShareWithViaPlugin(List<RaveContact> externalContacts, string pluginKeyName, string subject, string message, RaveShareRequestCallback callback)

Parameters*

externalContacts - A list of RaveContacts to share this post with

pluginKeyName - The name of the social network plugin to share this post through (“Facebook”, etc)

subject - The subject of the post

message - The text of the post

callback - A completion callback


GetExternalIdForShareInstall#

Retrieve external ID of an app:

public static string GetExternalIdForShareInstall(string appCallUrl, string source)

Parameters

appCallUrl - The sharing URL of a given app.

source - The name of the social network plugin of this app share URL (“Facebook”, etc)


Users API#

Class: RaveUsersManager#

Class: RaveUserChanges#

Use with PushUserChanges to modify the current user by setting any of the following properties:

displayName, realName, email, birthdate, and gender


Interface - RaveCurrentUserObserver#

Observer interface for changes to the current user:

public interface RaveCurrentUserObserver {
    void UserChanged(List<String> changedKeys);
}

Parameters:

changedKeys - A collection of keys that specifies which data has changed. Keys will match properties names in RaveUser.


Delegate - RaveUserCallback New in 3.3.1*#

Completion callback for returning a user:

public delegate void RaveUserCallback(RaveUser user, string error);

Class: RaveUserReference - New in 3.3.1#

Create an instance with RaveUserReference.ByEmail(), RaveUserReference.ByUsername(), or RaveUserReference.ByRaveId() methods

Use with a variety of methods to refer to a Rave user indirectly


FetchUser - New in 3.3.1#

Find a user by reference, updating the local cache with the user’s data.:

public static void FetchUser(RaveUserReference reference, RaveUserCallback callback);

Parameters:

reference - Reference to the user the details for whom should be fetched callback - Callback that will provide the found user or potentially an error


CheckAccountExists#

Completion callback interface for returning whether or not an account exists and has had a password assigned:

public static void CheckAccountExists(string email, RaveAccountExistsCallback callback)

Parameters:

email - The email address to check callback - Callback to call when the check is completed


UpdateCurrent#

Retrieve the current user’s data from the server and update the local cache with the retrieved data.:

public static void UpdateCurrent(RaveCompletionCallback callback)

Parameters:

callback - Callback to call when the update is completed


Current#

Gets the current user stored in the local cache.:

public static RaveUser Current { get }

Returns: A RaveUser object representing the current user


AddCurrentUserObserver - New in 3.0.2#

Register an observer for the current user, multiple concurrent users may be registered at once:

public static void AddCurrentUserObserver(RaveCurrentUserObserver observer);

Parameters:

observer - Observer for changes to the current user


RemoveCurrentUserObserver - New in 3.0.2#

Unregister an observer for the current user, multiple concurrent users may be registered at once:

public static void RemoveCurrentUserObserver(RaveCurrentUserObserver observer);

Parameters:

observer - Observer to unregister


PushUserChanges - New in 3.0.2#

Push changes to the current user to the Rave backend. User state notifications will be triggered if successful:

public static void PushUserChanges(RaveUserChanges userChanges, RaveCompletionCallback callback);

Parameters:

userChanges - The set of changes to the current user (see RaveUserChanges for more details)

callback - Callback to call when the operation is completed


PushProfilePicture#

Push the binary data for a local image to the Rave backend for a users profile picture:

public static void PushProfilePicture(String url, RaveCompletionCallback callback);

Parameters:

url - The url specifying the local image to upload

callback - Callback to call when the operation is completed


FetchRandomUsersForApplication#

Fetches a set of random users from the server. Will return up to 10 random users who are using the current application.:

public static void FetchRandomUsersForApplication(RaveUsersCallback callback)

Parameters:

callback - Callback to call when the fetch operation is completed. The callback is passed the retrieved data


FetchRandomUsersForApplication2#

Fetches a set of random users from the server. Will return up to 10 random users who are using the application specified by the appUuid. The specified application must belong to the same publisher as the current application.:

public static void FetchRandomUsersForApplication2(string appUuid, RaveUsersCallback callback)

Parameters:

appUuid - Unique ID of the application whose users you wish to fetch

callback - Callback to call when the fetch operation is completed. The callback is passed the retrieved data


FetchRandomUsersForApplication3#

Fetches a set of random users from the server. Will return up to 10 random users who are using the application specified by the appUuid. The specified application must belong to the same publisher as the current application.:

public static void FetchRandomUsersForApplication3(string appUuid, float excludeContacts, float limit, RaveUsersCallback callback)

Parameters:

appUuid - Unique ID of the application whose users you wish to fetch

excludeContacts - If the current user’s contacts are included in the results

limit - The maximum number of users to return, up to 25

callback - Callback to call when the fetch operation is completed. The callback is passed the retrieved data


UpdateUserById#

Given a Rave ID, retrieve a user’s data from the server and update the local cache with the retrieved data.:

public static void UpdateUserById(string raveId, RaveCompletionCallback callback)

Parameters:

raveId - The Rave ID of the user

callback - Callback to call when the update is completed


GetUserById#

Gets the current user stored in the local cache.:

public static RaveUser GetUserById(string raveId)

Parameters:

raveId - The Rave ID of the user

Returns: A RaveUser object representing the retrieved user. Returns null if the user doesn’t exist or isn’t stored in the local cache.


FetchAccessToken#

Fetch an access token that can be used to query the Rave back-end server.:

public static void FetchAccessToken(RaveAccessTokenCallback callback)

Parameters:

callback - Callback to call when the fetch operation is completed. The callback is passed the retrieved data


FetchAllIdentities#

Fetch all identities associated with the current user. A single user can contain multiple merged identities across games/devices/logins.:

public static void FetchAllIdentities(RaveIdentitiesCallback callback)

Parameters:

callback - Callback to call when the fetch operation is completed. The callback is passed the retrieved data


FetchIdentitiesForApplication#

Fetch only identities associated with the current user that are associated with the current application. A single user can contain multiple merged identities across games/devices/logins.:

public static void FetchIdentitiesForApplication(RaveIdentitiesCallback callback)

Parameters:

callback - Callback to call when the fetch operation is completed. The callback is passed the retrieved data


CheckThirdPartyAccountExists#

Check if the current third party authentication provider contains an account associated with the provided email address.:

public static void CheckThirdPartyAccountExists(string email, RaveAccountExistsCallback callback)

Parameters:

email - The email address to check against

callback - Callback to call when the check operation is completed. The callback is passed the retrieved data


CheckAccountExists#

Check if there is a Rave acccount associated with the provided email address.:

public static void CheckAccountExists(string email, RaveAccountExistsCallback callback)

Parameters:

email - The email address to check against

callback - Callback to call when the check operation is completed. The callback is passed the retrieved data


PushChangesToCurrentUser - Deprecated in 3.0.2#

Pushes any changes to the current user stores in the local cache back to the server.:

public static void PushChangesToCurrentUser(RaveUser user, RaveCompletionCallback callback)

Parameters:

callback - Callback to call when the push operation is completed


Showing Built-in Scenes#

RaveCallbackResult#

Enum indicating status of a callback:

public enum RaveCallbackResult {
    RaveResultSuccessful,
    RaveResultCanceled,
    RaveResultError,
}

Results:

RaveResultSuccessful - Operation was successful

RaveResultCanceled - Operation was canceled, typically by the user

RaveResultError - Operation failed with an error


BigFishSignupData#

Sign-up data returned by the sign-up callback:

public class BigFishSignUpData : RaveObject {
        public bool acceptedNewsletter;
        public bool passedCoppaCheck;
        public string birthYear;
}

Fields:

acceptedNewsletter - True or false indicated the user accepted the newsletter. False if no checkbox was presented to user.

passedCoppaCheck - True or false indicating whether user passed COPPA check. False if not tested

birthYear - String of the birth year for user tested for COPPA, null otherwise


BigFishSignUpSceneCallback#

The signup data callback common to some BigFish scenes:

public delegate void BigFishSignUpSceneCallback(RaveCallbackResult result,BigFishSignUpData signUpData,string error);

Parameters:

result - Status of callback

signUpData - Sign-up data resulting from user interaction or null if no sign-up occurred

error - Error description or null if none


ShowLoginScene#

Shows the built-in login scene:

public static void ShowLoginScene(BigFishSignUpSceneCallback callback)

This call may result in account creation and a COPPA check

Parameters:

callback - The sign-up callback


ShowSignUpEmailScene#

Shows the built-in account creation scene:

public static void ShowSignUpEmailScene(BigFishSignUpSceneCallback callback)

This call may result in account creation and a COPPA check

Parameters:

callback - The sign-up callback


ShowAccountInfoScreen#

Shows the built-in account info scene:

public static void ShowAccountInfoScreen(BigFishSignUpSceneCallback callback)

Parameters:

callback - The sign-up callback


ShowFindFriendsScreen#

Shows the built-in find friend scene:

public static void ShowFindFriendsScreen(RaveSceneCallback callback)

Parameters:

callback - The scene callback