RaveConnectFriendsController#

class: RaveConnectFriendsController

header: <RaveSocial/RaveConnectFriendsController.h>

Enum RaveFriendsControllerState#

  • RaveFriendsControllerStateNotDownloaded: Friends syncing is not enabled

  • RaveFriendsControllerStateDownloading: Friends sycning is in progress

  • RaveFriendsControllerStateDownloaded: Friends sycning is enabled


Protocol RaveConnectFriendsStateObserver#

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

- (void)onFindFriendsStateChanged:(RaveFriendsControllerState)value;

Parameters:

value - Latest state value


controllerWithPlugin#

Constructor for new friends controller:

+(RaveConnectFriendsController *)controllerWithPlugin:(NSString *)pluginKeyName;

Parameters:

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

Returns: Instance of RaveConnectFriendsController for the plugin specified


setFriendsObserver#

Implement RaveConnectFriendsStateObserver and set your observer instance in the controller:

- (void)setFriendsObserver:(RaveConnectFriendsStateObserver)friendsObserver;

Parameters:

friendsObserver - 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:

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

-(void)attemptForgetFriends;

RaveConnectController#

class: RaveConnectController

header: <RaveSocial/RaveConnectController.h>

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


Protocol RaveConnectStateObserver#

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

-(void)onConnectStateChanged:(RaveConnectControllerState)value;

Parameters:

value - Latest state value


controllerWithPlugin#

Constructor for instances of RaveConnectController:

+ (instancetype)controllerWithPlugin:(NSString *)pluginKeyName;
+ (instancetype)controllerWIthPlugin:(NSString *)pluginKeyName autoUpdate:(BOOL)autoUpdate;

Parameters:

pluginKeyName - Key name for plugin to use for this controller

autoUpdate - True to automatically update connect state when observer is set (defaults to false)

Returns: Instance of RaveConnectController for the plugin specified


setConnectObserver#

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

- (void)setConnectObserver:(RaveConnectStateObserver)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:

-(void)attemptConnect;

attemptDisconnect#

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

-(void)attemptDisconnect;

updateConnectState#

Refresh the connect state of the controller with the plugin. Track changes to state through the observer:

- (void)updateConnectState;

Called automatically if autoUpdate is true for this controller.


setPluginKeyName#

Set the pluginKeyName for this controller. Typically shouldn’t be changed after construction:

- (void)setPluginKeyName:(NSString *)pluginKeyName;

Parameters:

pluginKeyName - Key name for plugin to use


setCallback#

Set callback for asynchronous operations on this controller. Used to track errors that occur in the course of normal operations:

- (void)setCallback:(RaveCompletionCallback)callback;

Parameters:

callback - Completion callback for error handling