Inherits from NSObject
Declared in KiiSocialConnect.h

Overview

An interface to link users to social networks

The SDK currently support the following social networks :

  1. Facebook
  2. Twitter
  3. LinkedIn
  4. Yahoo
  5. Dropbox
  6. Box
  7. Renren
  8. Sina Weibo
  9. Microsoft Live
  10. QQ
  11. Googleplus
  12. OpenID Connect Simple

Class Methods

accessTokenDictionary:

Retrieve the current user’s social network access token object as NSDictionary. If the user is not associated with the specified provider, returns nil. The dictionary would be cached after the login and link has been executed. Cache would be cleared when new login, link or unlink has been executed. (Regardless of same/different KiiConnectorProvider is specified)

+ (nullable NSDictionary *)accessTokenDictionary:(KiiConnectorProvider)provider

Parameters

provider

One of the supported KiiConnectorProvider values.

Return Value

An NSDictionary representing the access token’s object.

Discussion

Retrieve the current user’s social network access token object as NSDictionary. If the user is not associated with the specified provider, returns nil. The dictionary would be cached after the login and link has been executed. Cache would be cleared when new login, link or unlink has been executed. (Regardless of same/different KiiConnectorProvider is specified)

Please keep the returned value in your application program before execute new login/ link session when you sequencially link the several social network providers with the same user if you need to use them. Following parameters can be assigned to NSDictionary’s key.

Key Value type Value Note
oauth_token String Required for accessing social network API.
oauth_token_secret String Required to generate signature when you call social network API. Present in the bundle for Twitter.
provider_user_id String User id provided by social network. ex.) 'xoauth_yahoo_guid' used by Yahoo profile API.
kii_new_user NSNumber(BOOL) Indicates if user was created during connection.
openID NSString OpenId identifier Present in QQ
oauth_token_expires NSDate Oauth expirations date Present only if logged in using UI and selected providers (Facebook, Google, Box, Renren, Sina Weibo, and Microsoft Live)
id_token NSString ID token provided by OpenID Provider. This field is provided when is used. Present in OpenID Connect
refresh_token NSString Refresh token provided by OpenID Provider. This field is provided when is used and configured OpenID Provider supports refresh token. Present in OpenID Connect

Exceptions

NSInvalidArgumentException

will be thrown if KiiSocialNetworkName is passed as provider.

Declared In

KiiSocialConnect.h

getAccessTokenDictionaryForNetwork:

Retrieve the current user’s access token object by NSDictionary from a social network (Deprecated: This method is deprecated. Use [KiiSocialConnect accessTokenDictionary:] instead.)

+ (nullable NSDictionary *)getAccessTokenDictionaryForNetwork:(KiiSocialNetworkName)network

Parameters

network

One of the supported KiiSocialNetworkName values.

Return Value

An NSDictionary representing the access token’s object.

Discussion

Retrieve the current user’s access token object by NSDictionary from a social network

The network must be set up and linked to the current user. It is recommended you save this to preferences for multi-session use. Following parameters can be assigned to NSDictionary’s key.

Facebook

Key Value type Value Note
access_token String Required for accessing social network API.
access_token_expires String Expiration date for this token

Twitter

Key Value type Value Note
oauth_token String Required for accessing social network API.
oauth_token_secret String Required to generate signature when you call social network API.

QQ

Key Value type Value Note
access_token String Required for accessing social network API.
openID String Required for accessing social network API.

Kii Social Network Connect

Key Value type Value Note
oauth_token String Required for accessing social network API.
oauth_token_secret String Required to generate signature when you call social network API. Present in the bundle for Twitter, LinkedIn, and Yahoo.
provider_user_id String User id provided by social network. ex.) 'xoauth_yahoo_guid' used by Yahoo profile API.
kii_new_user NSNumber(BOOL) Indicates if user was created during connection.
id_token NSString ID token provided by OpenID Provider. This field is provided when is used. Present in OpenID Connect
refresh_token NSString Refresh token provided by OpenID Provider. This field is provided when is used and configured OpenID Provider supports refresh token. Present in OpenID Connect

Declared In

KiiSocialConnect.h

getAccessTokenExpiresForNetwork:

Retrieve the current user’s access token expiration date from a social network (Deprecated: This method is deprecated. Use [KiiSocialConnect accessTokenDictionary:] instead.)

+ (nullable NSDate *)getAccessTokenExpiresForNetwork:(KiiSocialNetworkName)network

Parameters

network

One of the supported KiiSocialNetworkName values.

Return Value

An NSDate representing the access token’s expiration date, nil if none available.

Discussion

Retrieve the current user’s access token expiration date from a social network

The network must be set up and linked to the current user. It is recommended you save this to preferences for multi-session use.

Declared In

KiiSocialConnect.h

getAccessTokenForNetwork:

Retrieve the current user’s access token from a social network (Deprecated: This method is deprecated. Use [KiiSocialConnect accessTokenDictionary:] instead.)

+ (nullable NSString *)getAccessTokenForNetwork:(KiiSocialNetworkName)network

Parameters

network

One of the supported KiiSocialNetworkName values.

Return Value

An NSString representing the access token, nil if none available.

Discussion

Retrieve the current user’s access token from a social network

The network must be set up and linked to the current user. It is recommended you save this to preferences for multi-session use.

Declared In

KiiSocialConnect.h

handleOpenURL:

Required method by KiiSocialNetwork (Deprecated: Not usable on new social connect login mechanism from v2.2.1.)

+ (BOOL)handleOpenURL:(NSURL *)url

Parameters

url

The URL that is returned by Facebook authentication through delegate.

Discussion

Required method by KiiSocialNetwork

This method must be placed in your AppDelegate file in order for the SNS to properly authenticate with KiiSocialConnect:

// Pre iOS 4.2 support
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
    return [KiiSocialConnect handleOpenURL:url];
}

// For iOS 4.2+ support
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
                                       sourceApplication:(NSString *)sourceApplication 
                                              annotation:(id)annotation {
    return [KiiSocialConnect handleOpenURL:url];
}

Declared In

KiiSocialConnect.h

linkCurrentUser:options:block:

Link the currently logged in user with supported social networks (Facebook, Twitter, Renren, Google and QQ).

+ (void)linkCurrentUser:(KiiConnectorProvider)provider options:(NSDictionary *)options block:(KiiSCNBlock)block

Parameters

provider

One of the supported KiiConnectorProvider values.

options

A dictionary of key/values to pass to KiiSocialConnect. This is mandatory, can not be nil.

block

To be called upon link completion. This is mandatory.

Discussion

Link the currently logged in user with supported social networks (Facebook, Twitter, Renren, Google and QQ).

The provider should be valid KiiConnectorProvider values. Otherwise, an exception will be raised.
Snippet for link with social network:

[KiiSocialConnect linkCurrentUser:kiiConnectorFacebook 
                          options:@{@"accessToken":@"access_token"}
                            block:^(KiiUser *user, KiiConnectorProvider provider, NSError *error) {
    if (error == nil) {
        // link successful. Do someting with the user.
    } else {
        // something went wrong.
    }
}];

Following parameters can be assigned to NSDictionary’s key.

Facebook, Renren, GooglePlus

Key Value type Value Note
accessToken String Required for accessing social network API.

Twitter

Key Value type Value Note
accessToken String Required for accessing social network API.
accessTokenSecret String Required to generate signature when you call social network API.

QQ

Key Value type Value Note
accessToken String Required for accessing social network API.
openID String Required for accessing social network API.

Warning: Dropbox, Box, Yahoo, LinkedIn, Microsoft Live, Sina Weibo is not supported, passing it will throw an exception.

Exceptions

NSInvalidArgumentException

will be thrown if options is not valid.

NSInvalidArgumentException

will be thrown if block is nil.

NSInvalidArgumentException

will be thrown if unsupported provider or KiiSocialNetworkName is passed as provider.

Declared In

KiiSocialConnect.h

linkCurrentUserWithNetwork:usingOptions:andBlock:

Link the currently logged in user with a social network (Deprecated: Use [KiiSocialConnect linkCurrentUser:options:block:])

+ (void)linkCurrentUserWithNetwork:(KiiSocialNetworkName)network usingOptions:(nullable NSDictionary *)options andBlock:(KiiSocialConnectBlock)block

Parameters

network

One of the supported KiiSocialNetworkName values.

options

A dictionary of key/values to pass to KiiSocialConnect. Can be nil for Facebook but should not nil/empty for Twitter. For details about options, refer to <[KiiSocialConnect linkCurrentUserWithNetwork:usingOptions:withDelegate:andCallback:>

block

To be called upon link completion.

Discussion

Link the currently logged in user with a social network

This will initiate the login process for the given network, which for SSO-enabled services like Facebook/Twitter, will send the user to the Facebook/Twitter app for authentication. There must be a currently authenticated KiiUser. Otherwise, you can use the logIn: method to create and log in a KiiUser using Facebook/Twitter. The network must already be set up via setupNetwork:withKey:andSecret:andOptions:

Snippet for link with social network :

[KiiSocialConnect linkCurrentUserWithNetwork:kiiSCNConnector usingOptions:@{@"provider":@(kiiConnectorFacebook)}
    andBlock:^(KiiUser *user, KiiSocialNetworkName name, NSError *error) {
    if (error == nil) {
        // link successful. Do someting with the user.
    } else {
        // something went wrong.
    }
}];

Note: This API access to server. Should not be executed in UI/Main thread.

Exceptions

KiiIllegalStateException

will be thrown if setupNetwork: is not called.

NSInvalidArgumentException

will be thrown if options is not valid (see description above) or if kiiSCNConnector network name is passed.

Declared In

KiiSocialConnect.h

linkCurrentUserWithNetwork:usingOptions:withDelegate:andCallback:

Link the currently logged in user with a social network (Deprecated: Use [KiiSocialConnect linkCurrentUser:options:block:])

+ (void)linkCurrentUserWithNetwork:(KiiSocialNetworkName)network usingOptions:(nullable NSDictionary *)options withDelegate:(id)delegate andCallback:(SEL)callback

Parameters

network

One of the supported KiiSocialNetworkName values.

options

A dictionary of key/values to pass to KiiSocialConnect. Can be nil for Facebook but should not nil/empty for Twitter.

Facebook

Options for passing accessToken directly

Key Value type Value Note
access_token NSString Access token of Facebook. If provided, KiiCloud uses this token while login using Facebook.
access_token_expires NSDate Expire date of access token. Use for social network token validation.

Options by using ACAccount

Key Value type Value Note
permissions NSDictionary Key-Value pairs of permissions defined by Facebook. If not provided, it will pass "email" as the default permission Facebook : Facebook permissions.
use_acaccount NSNumber Select ACAccount class as loggin mechanism from v2.2.1 If @YES, KiiCloud uses iOS native Facebook account then use the accessToken.

Twitter

Key Value type Value Note
twitter_account ACAccount Twitter account that is obtained from account store. This is mandatory if "oauth_token" and "oauth_token_secret" are not provided.
oauth_token NSString OAuth access token of twitter. This is mandatory if "twitter_account" is not provided.
oauth_token_secret NSString OAuth access token secret of twitter. This is mandatory if "twitter_account" is not provided.

QQ

Key Value type Value Note
access_token NSString Access token of QQ. If provided, KiiCloud uses this token while login using QQ.
openid NSString Unique with QQ App ID and user QQ account. QQ : QQ OpenID.

Kii Social Network Connect

    This operation is not supported for kiiSCNConnector network name.

delegate

The object to make any callback requests to.

callback

The callback method to be called when the request is completed. The callback method should have a signature similar to:

 - (void) userLinked:(KiiUser*)user withNetwork:(KiiSocialNetworkName)network andError:(NSError*)error {

     // the process was successful - the user is now linked to the network
     if(error == nil) {
         // do something with the user
     }

     else {
         // there was a problem
     }
 }

Discussion

Link the currently logged in user with a social network

This will initiate the login process for the given network, which for SSO-enabled services like Facebook/Twitter, will send the user to the Facebook/Twitter app for authentication. There must be a currently authenticated KiiUser. Otherwise, you can use the logIn: method to create and log in a KiiUser using Facebook/Twitter. The network must already be set up via setupNetwork:withKey:andSecret:andOptions:

Exceptions

KiiIllegalStateException

will be thrown if setupNetwork: is not called.

NSInvalidArgumentException

will be thrown if options is not valid (see description above) or if kiiSCNConnector network name is passed.

Declared In

KiiSocialConnect.h

logIn:options:block:

Login with specified social network.

+ (void)logIn:(KiiConnectorProvider)provider options:(nullable NSDictionary *)options block:(KiiSCNBlock)block

Parameters

provider

One of the supported KiiConnectorProvider values.

options

A dictionary of key/values to pass to KiiSocialConnect. This can be nil if using UI approach.

block

To be called upon login completion.

Discussion

Login with specified social network.

This will initiate the login process for the given network, with or without UI handled by SDK. If you prefer to handle login UI or using provider specific SDK to obtain access token, pass required params (acces token, access token secret, open ID) according to each provider. Other than kiiConnectorQQ, Kii SDK can handle the UI by passing nil into the options. If the social network user has already linked with a KiiUser, that user will be used as signed user. Otherwise, KiiCloud creates a new user and link with the specified social network account. The provider should be valid KiiConnectorProvider values. Otherwise, an exception will be raised.
Snippet for Login with social network without UI:

[KiiSocialConnect logIn:kiiConnectorFacebook 
                options:@{@"accessToken":@"access_token"}
                  block:^(KiiUser *user, KiiConnectorProvider provider, NSError *error) {
    if (error == nil) {
        // link successful. Do someting with the user.
    } else {
        // something went wrong.
    }
}];

Snippet for Login with social network with UI:

[KiiSocialConnect logIn:kiiConnectorFacebook 
                options:nil
                  block:^(KiiUser *user, KiiConnectorProvider provider, NSError *error) {
    if (error == nil) {
        // link successful. Do someting with the user.
    } else {
        // something went wrong.
    }
}];

Following parameters can be assigned to NSDictionary’s key.

Facebook, Renren, Googleplus

Key Value type Value Note
accessToken String Required for accessing social network API.

Twitter

Key Value type Value Note
accessToken String Required for accessing social network API.
accessTokenSecret String Required to generate signature when you call social network API.

QQ

Key Value type Value Note
accessToken String Required for accessing social network API.
openID String Required for accessing social network API.

Warning: Dropbox, Box, Yahoo, LinkedIn, Microsoft Live, Sina Weibo can only use login with UI.

Exceptions

NSInvalidArgumentException

will be thrown if options is not valid.

NSInvalidArgumentException

will be thrown if block is nil.

NSInvalidArgumentException

will be thrown if KiiSocialNetworkName is passed as provider.

Declared In

KiiSocialConnect.h

logIn:usingOptions:andBlock:

Login with specified social network. (Deprecated: Use [KiiSocialConnect logIn:options:block:] .)

+ (void)logIn:(KiiSocialNetworkName)network usingOptions:(nullable NSDictionary *)options andBlock:(KiiSocialConnectBlock)block

Parameters

network

One of the supported KiiSocialNetworkName values

options

A dictionary of key/values to pass to KiiSocialConnect. Can be nil for Facebook and kiiSCNConnector but should not nil/empty for Twitter. For details about options, refer to <[KiiSocialConnect logIn:usingOptions:withDelegate:andCallback:>

block

To be called upon login completion.

Discussion

Login with specified social network.

This will initiate the login process for the given network, which provides OAuth like Facebook/Twitter, will send the user to the Facebook/Twitter app for authentication. If the social network user has already linked with a KiiUser, that user will be used as signed user. Otherwise, KiiCloud creates a new user and link with the specified social network account.

If successful, the user is cached inside SDK as current user,and accessible via [KiiUser currentUser]. User token is also cached and can be get by [KiiUser accessToken]. Access token won’t be expired unless you set it explicitly by [Kii setAccessTokenExpiration:]

Snippet for login with social network :

[KiiSocialConnect logIn:kiiSCNConnector usingOptions:@{@"provider":@(kiiConnectorFacebook)}
    andBlock:^(KiiUser *user, KiiSocialNetworkName name, NSError *error) {
    if (error == nil) {
        // login successful. Do someting with the user.
    } else {
        // something went wrong.
    }
}];

Note: This API access to server. Should not be executed in UI/Main thread.

Exceptions

KiiIllegalStateException

will be thrown if setupNetwork: is not called.

NSInvalidArgumentException

will be thrown if options is not valid (see description above).

Declared In

KiiSocialConnect.h

logIn:usingOptions:withDelegate:andCallback:

Log a user into the social network provided (Deprecated: Use [KiiSocialConnect logIn:options:block:] .)

+ (void)logIn:(KiiSocialNetworkName)network usingOptions:(nullable NSDictionary *)options withDelegate:(id)delegate andCallback:(SEL)callback

Parameters

network

One of the supported KiiSocialNetworkName values

options

A dictionary of key/values to pass to KiiSocialConnect. Can be nil for Facebook and kiiSCNConnector but should not nil/empty for Twitter and QQ.

Facebook

Options for passing accessToken directly

Key Value type Value Note
access_token NSString Access token of Facebook. If provided, KiiCloud uses this token while login using Facebook.
access_token_expires NSDate Expire date of access token. Use for social network token validation.

Options by using ACAccount

Key Value type Value Note
permissions NSDictionary Key-Value pairs of permissions defined by Facebook. If not provided, it will pass "email" as the default permission Facebook : Facebook permissions.
use_acaccount NSNumber Select ACAccount class as loggin mechanism from v2.2.1 If @YES, KiiCloud uses iOS native Facebook account then use the accessToken.

Twitter

Key Value type Value Note
twitter_account ACAccount Twitter account that is obtained from account store. This is mandatory if "oauth_token" and "oauth_token_secret" are not provided.
oauth_token NSString OAuth access token of twitter. This is mandatory if "twitter_account" is not provided.
oauth_token_secret NSString OAuth access token secret of twitter. This is mandatory if "twitter_account" is not provided.

QQ

Key Value type Value Note
access_token NSString Access token of QQ. If provided, KiiCloud uses this token while login using QQ.
openid NSString Unique with QQ App ID and user QQ account. QQ : QQ OpenID.

Kii Social Network Connect

Key Value type Value Note
provider Provider Provider enum encapsulated on NSNumber object (ex. kiiConnectorFacebook) This is mandatory.

Snippet for Kii Social Network Connect :

[KiiSocialConnect logIn:kiiSCNConnector
           usingOptions:@{@"provider":@(kiiConnectorFacebook)}
           withDelegate:self
            andCallback:@selector(socialLoggedInWithUser:andNetwork:andError:)];
delegate

The object to make any callback requests to.

callback

The callback method to be called when the request is completed. The callback method should have a signature similar to:

 - (void) loggedIn:(KiiUser*)user usingNetwork:(KiiSocialNetworkName)network withError:(NSError*)error {

     // the process was successful - the user is now authenticated
     if(error == nil) {
         // do something with the user
         // you can get information by calling KiiSocialConnect#getAccessTokenDictionaryForNetwork:
         // snippet for kiiSCNConnector :
            NSDictionary* tokenDict = [KiiSocialConnect getAccessTokenDictionaryForNetwork:kiiSCNConnector];
            NSString* token = tokenDict[@"oauth_token"];
            NSString* tokenSecret = tokenDict[@"oauth_token_secret"];
            NSString* providerUserId = tokenDict[@"provider_user_id"];
     }
     else {
         // there was a problem
     }
 }

Discussion

Log a user into the social network provided

This will initiate the login process for the given network, which provides OAuth like Facebook/Twitter, will send the user to the Facebook/Twitter app for authentication. If the social network user has already linked with a KiiUser, that user will be used as signed user. Otherwise, KiiCloud creates a new user and link with the specified social network account. If successful, the user is cached inside SDK as current user,and accessible via [KiiUser currentUser]. User token is also cached and can be get by <[KiiUser accessToken]>. Access token won’t be expired unless you set it explicitly by <[Kii setAccessTokenExpiration:]>

The network must already be set up via setupNetwork:withKey:andSecret:andOptions:

Note: This method should be called from main thread.

Exceptions

KiiIllegalStateException

will be thrown if setupNetwork: is not called.

NSInvalidArgumentException

will be thrown if options is not valid (see description above).

Declared In

KiiSocialConnect.h

logInNavigationController:block:

Get UINavigationController for login with specified social network.

+ (UINavigationController *)logInNavigationController:(KiiConnectorProvider)provider block:(KiiSCNBlock)block

Parameters

provider

One of the supported KiiConnectorProvider values.

block

To be called upon login completion.

Return Value

navigation controller for login, no return nil. Please present this controller yourself.

Discussion

Get UINavigationController for login with specified social network.

This will initiate the login process for the given network, with or without UI handled by SDK. If you prefer to handle login UI or using provider specific SDK to obtain access token, pass required params (acces token, access token secret, open ID) according to each provider. Other than kiiConnectorQQ, Kii SDK can handle the UI by passing nil into the options. If the social network user has already linked with a KiiUser, that user will be used as signed user. Otherwise, KiiCloud creates a new user and link with the specified social network account. The provider should be valid KiiConnectorProvider values. Otherwise, an exception will be raised.
Snippet for Login with social network without UI:

UINavigationController nc = [KiiSocialConnect logInNavigationController:kiiConnectorFacebook block:^(KiiUser user, KiiConnectorProvider provider, NSError *error) { if (error == nil) { // link successful. Do someting with the user. } else { // something went wrong. } }]; [{instance of top view controoler} presentViewController:nc animated:YES completion:nil];

Warning: Dropbox, Box, Yahoo, LinkedIn, Microsoft Live, Sina Weibo can only use login with UI.

Exceptions

NSInvalidArgumentException

will be thrown if block is nil.

NSInvalidArgumentException

will be thrown if KiiSocialNetworkName is passed as provider.

Declared In

KiiSocialConnect.h

setupNetwork:withKey:andSecret:andOptions:

Set up a reference to one of the supported KiiSocialNetworks. (Deprecated: Not usable on new social connect login mechanism from v2.2.1.)

+ (void)setupNetwork:(KiiSocialNetworkName)network withKey:(nullable NSString *)key andSecret:(nullable NSString *)secret andOptions:(nullable NSDictionary *)options

Parameters

network

One of the supported KiiSocialNetworkName values.

key

The SDK key assigned by the social network provider. It should not be nil or empty except for Kii Social Network Connect.In case of QQ just pass nil.

secret

The SDK secret assigned by the social network provider. In case of Twitter, It should not be nil or empty. In case of QQ and Kii Social Network Connect just pass nil.

options

Extra options that can be passed to the SNS, this is not mandatory. Examples could be (Facebook) an NSDictionary of permissions to grant to the authenticated user. In case of qq, twitter and Kii Social Network Connect, options parameter will not be used, please set to nil.

Discussion

Set up a reference to one of the supported KiiSocialNetworks.

The user will not be authenticated or linked to a KiiUser until one of those methods are called explicitly.

Exceptions

NSInvalidArgumentException

will be thrown if key and/or secret is not valid (see description above).

Declared In

KiiSocialConnect.h

unLinkCurrentUser:block:

Unlink the currently logged in user from the social network.

+ (void)unLinkCurrentUser:(KiiConnectorProvider)provider block:(KiiSCNBlock)block

Parameters

provider

One of the supported KiiConnectorProvider values.

block

To be called upon unlink completion. This is mandatory.

Discussion

Unlink the currently logged in user from the social network.

The provider should be valid KiiConnectorProvider values. Otherwise, an exception will be raised.

Snippet for unlink current user with network. :

[KiiSocialConnect unLinkCurrentUser:kiiConnectorFacebook
                              block:^(KiiUser *user, KiiConnectorProvider name, NSError *error) {
    if (error == nil) {
        // unlink successful.
    } else {
        // something went wrong.
    }
}];

Note: This API access to server. Should not be executed in UI/Main thread.

Warning: Dropbox, Box, Yahoo, LinkedIn, Microsoft Live, Sina Weibo is not supported, passing it will throw an exception.

Exceptions

NSInvalidArgumentException

will be thrown if block is nil.

NSInvalidArgumentException

will be thrown if unsupported provider or KiiSocialNetworkName is passed as provider.

Declared In

KiiSocialConnect.h

unLinkCurrentUserWithNetwork:andBlock:

Unlink the currently logged in user from the social network. This operation is not supported for kiiSCNConnector network name. (Deprecated: Use [KiiSocialConnect unLinkCurrentUser:block:])

+ (void)unLinkCurrentUserWithNetwork:(KiiSocialNetworkName)network andBlock:(KiiSocialConnectBlock)block

Parameters

network

One of the supported KiiSocialNetworkName values.

block

To be called upon unlink completion.

Discussion

Unlink the currently logged in user from the social network. This operation is not supported for kiiSCNConnector network name.

The network must already be set up via setupNetwork:withKey:andSecret:andOptions:

Snippet for unlink current user with network. :

[KiiSocialConnect unLinkCurrentUserWithNetwork:kiiSCNConnector
    andBlock:^(KiiUser *user, KiiSocialNetworkName name, NSError *error) {
    if (error == nil) {
        // unlink successful.
    } else {
        // something went wrong.
    }
}];

Note: This API access to server. Should not be executed in UI/Main thread.

Exceptions

KiiIllegalStateException

will be thrown if setupNetwork: is not called.

NSInvalidArgumentException

will be thrown if kiiSCNConnector network name is passed.

Declared In

KiiSocialConnect.h

unLinkCurrentUserWithNetwork:withDelegate:andCallback:

Unlink the currently logged in user from the social network. This operation is not supported for kiiSCNConnector network name. (Deprecated: Use [KiiSocialConnect unLinkCurrentUser:block:])

+ (void)unLinkCurrentUserWithNetwork:(KiiSocialNetworkName)network withDelegate:(id)delegate andCallback:(SEL)callback

Parameters

network

One of the supported KiiSocialNetworkName values.

delegate

The object to make any callback requests to.

callback

The callback method to be called when the request is completed. The callback method should have a signature similar to:

 - (void) userUnLinked:(KiiUser*)user fromNetwork:(KiiSocialNetworkName)network withError:(NSError*)error {

     // the process was successful - the user is no longer linked to the network
     if(error == nil) {
         // do something with the user
     }

     else {
         // there was a problem
     }
 }

Discussion

Unlink the currently logged in user from the social network. This operation is not supported for kiiSCNConnector network name.

The network must already be set up via setupNetwork:withKey:andSecret:andOptions:

Exceptions

KiiIllegalStateException

will be thrown if setupNetwork: is not called.

NSInvalidArgumentException

will be thrown if kiiSCNConnector network name is passed.

Declared In

KiiSocialConnect.h