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