Provides advanced features of HIVE Authentication.
More...
Provides advanced features of HIVE Authentication.
The detailed functions provided by this class are as follows.
- Sign-in/Sign-out
- Connect/Disconnect Providers
- Query Achievement/Leaderboard
- Query/Resolve account conflicts state
§ HIVEAuthV4HelperHandler
AuthV4Helper API request result callback.
- Parameters
-
result | ErrorCodes and Codes available for result values are as follows.
ErrorCode | Code | Description |
kHIVEResultAPITypeSUCCESS | kSuccess | Completed the request without account conflicts |
kHIVEResultAPITypeNEED_INITIALIZE | kAuthV4NotInitialized | Not initialized the HIVE SDK |
kHIVEResultAPITypeINVALID_SESSION | kAuthV4SigninFirst | Called the APIs required sign-in before sign-in |
kHIVEResultAPITypeINVALID_PARAM | kAuthV4AlreadyAuthorized | Called sign-in API again after sign-in |
kHIVEResultAPITypeCONFLICT_PLAYER | kAuthV4ConflictPlayer | The account signed in on user device is mismatched with the PGS/Game Center account on the game
or the player ID of the Provider to be connected already existed |
kHIVEResultAPITypePLAYER_CHANGE | kAuthV4PlayerChange | Succeeded to change the player after accounts conflict |
kHIVEResultAPITypeCANCELED | kAuthV4PlayerResolved | Not changed the currently signed-in account after accounts conflict |
kHIVEResultAPITypeINVALID_SESSION | kAuthV4HelperImplifiedLoginFail | Required Explicit Login due to failure of Implicit Login |
kHIVEResultAPITypeIN_PROGRESS | kAuthV4InProgressSignIn
kAuthV4InProgressConnect
kAuthV4InProgressShowLeaderboard
kAuthV4InProgressShowAchievements | The request is still in progress |
|
playerInfo | Player information depending on results are as follows.
ErrorCode | Code | Player Info |
kHIVEResultAPITypeSUCCESS | kSuccess | The information of signed-in player |
kHIVEResultAPITypeCONFLICT_PLAYER | kAuthV4ConflictPlayer | The information of conflicted player |
kHIVEResultAPITypePLAYER_CHANGE | kAuthV4PlayerChange | The information of the player who successfully changed its account |
kHIVEResultAPITypeCANCELED | kAuthV4PlayerResolved | The information of current player |
|
- See also
- HIVEResultAPI, HIVEPlayerInfo
§ connect:handler:()
Provider Connection
Condition of use
- Complete to initialize HIVE SDK
- Complete HIVE SignIn
Key result code
ErrorCode | Code | Description | Solution |
kHIVEResultAPITypeSUCCESS | kSuccess | Succeeded to conenct with Provider
| - |
kHIVEResultAPITypeNEED_INITIALIZE | kAuthV4NotInitialized | HIVE SDK not initialized | Initialize HIVE SDK by implementing AuthV4.setup() API |
kHIVEResultAPITypeCANCELED | kAuthV4AppleLoginCancel | If a sign-in window of Game Center is not displayed or the sign-in on Game Center is cancelled, | use AuthV4.helper.showGameCenterLoginCancelDialog() API or implement directly to inform how to sign in the Game Center |
kHIVEResultAPITypeCONFLICT_PLAYER | kAuthV4ConflictPlayer | the player ID of the Provider to be connected already existed
playerInfo: The information of conflicted account | Follow the resolution in accordance with the type of account conflicts |
- Parameters
-
handler | HIVEAuthV4HelperHandler AuthV4Helper Connect result callback |
§ disconnect:handler:()
Provider connetion
Condition of use
- Complete to initialize HIVE SDK
- Complete HIVE SignIn
Key result code
ErrorCode | Code | Description | Solution |
kHIVEResultAPITypeSUCCESS | kSuccess | Succeeded to discconect with Provider
| - |
kHIVEResultAPITypeNEED_INITIALIZE | kAuthV4NotInitialized | HIVE SDK not initialized | Initialize HIVE SDK by implementing AuthV4.setup() API |
kHIVEResultAPITypeINVALID_PARAM | kAuthV4ProviderAlreadtDisconnected | The Provider requested to disconnect was not connected with the account | - |
- Parameters
-
handler | HIVEAuthV4HelperHandler AuthV4Helper Disconnect result callback |
§ getIDPList()
Receives the Provider lists sent by SDK.
§ resolveConflict:()
In case it is not changed the currently signed-in account after accounts conflict.
Key result code
ErrorCode | Code | Description |
kHIVEResultAPITypeCANCELED | kAuthV4PlayerResolved | Not changed the currently signed-in account after accounts conflict |
- Parameters
-
handler | HIVEAuthV4HelperHandler AuthV4Helper Resolve Conflict result callback |
§ showAchievements:()
Queries Achievements
Condition of use
- Complete to initialize HIVE SDK
- Complete HIVE SignIn
Reference
- It tries to execute the service automatically if the signed-in account is diconnected with PGS/GameCenter.
Key result code
ErrorCode | Code | Description | Solution |
kHIVEResultAPITypeSUCCESS | kSuccess | Succeeded to request Acheivement
| - |
kHIVEResultAPITypeNEED_INITIALIZE | kAuthV4NotInitialized | HIVE SDK not initialized | Initialize HIVE SDK by implementing AuthV4.setup() API |
kHIVEResultAPITypeCANCELED | kAuthV4AppleLoginCancel | If a sign-in window of Game Center is not displayed or the sign-in on Game Center is cancelled, | use AuthV4.helper.showGameCenterLoginCancelDialog() API or implement directly to inform how to sign in the Game Center |
kHIVEResultAPITypeCONFLICT_PLAYER | kAuthV4ConflictPlayer | The account signed in on user device is mismatched with the PGS/Game Center account on the game
or the player ID of the Provider to be connected already existed | Follow the resolution in accordance with the type of account conflicts |
- Parameters
-
handler | HIVEAuthV4HelperHandler AuthV4Helper Show achievements result callback |
§ showConflict:()
Displays conflict status, and HIVE UI avilable to select an account.
Key result code
ErrorCode | Code | Description |
kHIVEResultAPITypePLAYER_CHANGE | kAuthV4PlayerChange | Succeeded to change the player after accounts conflict
|
kHIVEResultAPITypeCANCELED | kAuthV4PlayerResolved | Not changed the currently signed-in account after accounts conflict |
kHIVEResultAPITypeINVALID_PARAM | kAuthV4InvalidConflictInfo | Requested to resolve account conflicts not happened |
- Parameters
-
handler | HIVEAuthV4HelperHandler AuthV4Helper Show Conflict result callback |
§ showConflict:handler:()
Displays conflict status, and HIVE UI which is available to select an account as well as shows game information.
Key result code
ErrorCode | Code | Description |
kHIVEResultAPITypePLAYER_CHANGE | kAuthV4PlayerChange | Succeeded to change the player after accounts conflict
|
kHIVEResultAPITypeCANCELED | kAuthV4PlayerResolved | Not changed the currently signed-in account after accounts conflict |
kHIVEResultAPITypeINVALID_PARAM | kAuthV4InvalidConflictInfo | Requested to resolve account conflicts not happened |
- Parameters
-
conflictData | HIVEConflictSingleViewInfo Game information of the account-conflicted player |
handler | HIVEAuthV4HelperHandler AuthV4Helper Show Conflict result callback |
- See also
- HIVEConflictSingleViewInfo
§ showGameCenterLoginCancelDialog:()
If a sign-in window of Game Center is not displayed, show its status
and display a UI to inform how to sign in the Game Center.
- Parameters
-
handler | HIVEAuthV4DialogDismissHandler callback whether account notification popup is closed or not |
- See also
- HIVEAuthV4DialogDismissHandler
§ showLeaderboard:()
Queries leaderboard
Condition of use
- Complete to initialize HIVE SDK
- Complete HIVE SignIn
Refernce
- It tries to execute the service automatically if the signed-in account is diconnected with PGS/GameCenter.
Key result code
ErrorCode | Code | Description | Solution |
kHIVEResultAPITypeSUCCESS | kSuccess | Succeeded to request leaderboards
| - |
kHIVEResultAPITypeNEED_INITIALIZE | kAuthV4NotInitialized | HIVE SDK not initialized | Initialize HIVE SDK by implementing AuthV4.setup() API |
kHIVEResultAPITypeCANCELED | kAuthV4AppleLoginCancel | If a sign-in window of Game Center is not displayed or the sign-in on Game Center is cancelled, | use AuthV4.helper.showGameCenterLoginCancelDialog() API or implement directly to inform how to sign in the Game Center |
kHIVEResultAPITypeCONFLICT_PLAYER | kAuthV4ConflictPlayer | The account signed in on user device is mismatched with the PGS/Game Center account on the game
or the player ID of the Provider to be connected already existed | Follow the resolution in accordance with the type of account conflicts |
- Parameters
-
handler | HIVEAuthV4HelperHandler AuthV4Helper Show leaderboard result callback |
§ signIn:()
Player sign-in
Condition of use
- Complete to initialize HIVE SDK
Key result code
ErrorCode | Code | Description | Solution |
kHIVEResultAPITypeSUCCESS | kSuccess | Succeeded to sign in
playerInfo: The information of signed-in player | - |
kHIVEResultAPITypeNEED_INITIALIZE | kAuthV4NotInitialized | HIVE SDK not initialized | Initialize HIVE SDK by implementing AuthV4.setup() API |
kHIVEResultAPITypeIN_PROGRESS | kAuthV4InProgressSignIn
| Requested to process SignIn while sign-in is in progress | Wait for the SignIn request in progress |
kHIVEResultAPITypeCONFLICT_PLAYER | kAuthV4ConflictPlayer | The account signed in on user device is mismatched with the PGS/Game Center account on the game
or the player ID of the Provider to be connected already existed
playerInfo: The information of conflicted account | Follow the resolution in accordance with the type of account conflicts |
kHIVEResultAPITypeINVALID_SESSION | kAuthV4HelperImplifiedLoginFail | Required Explicit Login due to failure of Implicit Login | Query the supported Provider lists by calling AuthV4.Helper.getIDPList() and implement Explicit Login UI,
or implement Explicit Login by calling AuthV4.showSignIn() of HIVE UI |
- Parameters
-
handler | HIVEAuthV4HelperHandler AuthV4Helper Sign In result callback |
§ signOut:()
Player sign-out
Condition of use
- Complete to initialize HIVE SDK
- Complete HIVE SignIn
Key result code
ErrorCode | Code | Description | Solution |
kHIVEResultAPITypeSUCCESS | kSuccess | Succeeded to sign out
| - |
kHIVEResultAPITypeNEED_INITIALIZE | kAuthV4NotInitialized | HIVE SDK not initialized | Initialize HIVE SDK by implementing AuthV4.setup() API |
- Parameters
-
handler | HIVEAuthV4HelperHandler AuthV4Helper Sign Out result callback |
§ switchAccount:()
If accounts conflict, sign out the current player
and try to sign in with the account signed in on the user device.
Key result code
ErrorCode | Code | Description |
kHIVEResultAPITypePLAYER_CHANGE | kAuthV4PlayerChange | Succeeded to change the player after accounts conflict
|
- Parameters
-
handler | HIVEAuthV4HelperHandler AuthV4Helper Switch Account result callback |
§ syncAccount:handler:()
Helps to inform whether accounts conflict or not when executing the provided as well as other APIs.
Condition of use
- Complete to initialize HIVE SDK
- Complete HIVE SignIn
Key result code
ErrorCode | Code | Description | Solution |
kHIVEResultAPITypeSUCCESS | kSuccess | Account normal state | - |
kHIVEResultAPITypeNEED_INITIALIZE | kAuthV4NotInitialized | HIVE SDK not initialized | Initialize HIVE SDK by implementing AuthV4.setup() API |
kHIVEResultAPITypeCONFLICT_PLAYER | kAuthV4ConflictPlayer | Mismatched the signed-in account with PGS/GameCenter account on the device | Follow the resolution in accordance with the type of account conflicts |
kHIVEResultAPITypeNOT_SUPPORTED | kAuthV4NotSupportedProviderType | Queried account state with other provider types except PGS/GameCenter | - |
- Parameters
-
providerType | ProviderType to request syncronization |
handler | HIVEAuthV4HelperHandler AuthV4Helper Sync Account result callback |