Skip to content

Login with SohaGame SDK

Overview

This guide explains how to integrate with Login for iOS. Once authenticated users authorize your game, you can access their data including their display name and avatar.

Before you begin

You will need to Integrate the SohaGame SDK for iOS into your game.

Login

Call loginWithCallback method:

[SohaSDK loginWithCallback:^(SohaUser *user, NSError *error) {
    //Handle login callback
}];

Logout

Call logout method:

[SohaSDK logout];
The SDK will handle the logout, the successful logout will be returned via the following delegate:
- (void)sohaDidLogoutSuccess:(SohaUser *)user {
    NSLog(@"sohaDidLogoutSuccess : %@",user);
}

It is required to handle ingame logout in this delegate.

Delete Account

From June 30, 2022, Apple has required the account deletion feature in app. See more here The SDK already supports account deletion.

First, you need a "Delete account" button in the ingame interface.

When the user clicks this button, call the following method:

[SohaSDK deleteAccount];
The sohaDidDeleteAccountSuccess method of SohaDelegate protocol will be invoked when successful account deletion.

- (void)sohaDidDeleteAccountSuccess:(SohaUser *)user{
    /// logout game
}