Bringing Facebook Friend Lists

getProviderFriendsList() method provides the PlayerID of user’s Facebook friends in the same game. Those who plays without Facebook sync are not on the friend lists, and those who synced before return -1 as PlayerID.

Unity®

API Reference: hive.AuthV4.getProviderFriendsList

C++

API Reference: AuthV4::getProviderFriendsList

Kotlin

API Reference: com.hive.AuthV4.getProviderFriendsList

Java

API Reference: com.hive.AuthV4.getProviderFriendsList

Swift

API Reference: AuthV4Interface.getProviderFriendsList

Objective-C

API Reference: HIVEAuthV4:getProviderFriendsList

Responding to COPPA

The Children‘s Online Privacy Protection Act (COPPA) is a United States feneral law, which aims to protect the privacy of children under the age of 13 on-line. To respond to COPPA, Hive released Hive SDK v4.10.0 including getAgeGateU13() API to query whether users are under 13 or not. The API returns true if the player age is under 13.

Sample code
Unity®

API Reference: AuthV4 .getAgeGateU13

C++

API Reference: AuthV4 ::getAgeGateU13

Kotlin

API Reference: AuthV4.getAgeGateU13

Java

API Reference: AuthV4 .INSTANCE.getAgeGateU13

Swift

API Reference: AuthV4Interface.getAgeGateU13

Objective-C

API Reference: HIVEAuthV4 getAgeGateU13

What changes

The followings are implemented if ageGateU13() returns true.

  • iOS
    • Agreement request popup on Push notification is not displayed when calling AuthV4.setup() or Auth.initialize().
    • Push API is not implemented.
  • Android
    • More Games button is not displayed when showing Exit Popup.
    • Unavailable to receive Remote Push, and Push API is not implemented.

Checking terms of services agreement for the users under 16 in GDPR applicable countries

Starting from Hive SDK v4 24.2.0, you can determine whether users under 16 years old have agreed to the terms in countries affected by GDPR (General Data Protection Regulation) using the Configuration.getAgeGateU16Agree() method. If the returned value is true, it means that a user under 16 has agreed to the terms; if false, it means they have not. When using third-party libraries, if you need to restrict app features based on whether the user is under 16, you can utilize the Configuration.getAgeGateU16Agree() method.

Unity®

C++

Kotlin

Java

Swift

Objective-C

Starting from Hive SDK v4 24.3.0, if the app uses the legal guardian consent confirmation terms, you can retrieve whether the app user has obtained legal guardian consent by calling the Configuration.getLegalGuardianConsentAgree() method. If the value is true, it indicates that consent has been given.

Unity®

C++

Kotlin

Java

Swift

Objective-C

Re-asking OS permission

Access permission list required for playing game is organized in AndroidManifest.xml file. Try to send some permissions as string list of relevant API and use them. You can check whether user opts in or opts out of the specific permissions. If some of Dangerous permission are denied, make sure to display the popup which requests access to OS again. Other permissions are automatically opted in or opted out in accordance with the settings on user device. If you type wrong permissions or wrong words, the system regards as the permissions are not declared on the AndroidManifest.xml file and not allowed to access the permissions.

Android 6.0 (API level 23) supports this feature. If OS is iOS or Android API level is earlier than 23, ResultAPI is sent as not supported.

Sample code
Unity®

API Reference: PlatformHelper .requestUserPermissions

C++

API Reference: PlatformHelper ::requestUserPermissions

Kotlin

API Reference: PlatformHelper.requestUserPermissions

Java

API Reference: PlatformHelper .INSTANCE.requestUserPermissions

Using Device Management Service

Device Management Service automatically implements upon login according to settings on Hive Console. After login, a game calls theshowDeviceManagement() method of AuthV4 class and displays the device management list to a user.
When login is canceled due to the failure of device authentication, a game with device management service should handle the AuthV4NotRegisteredDevice code of Result API for attempting to silent login again or carrying out to logout. For more information on the device management service, refer to the operation guide: Introduction to the device management service.

Unity®

API Reference: AuthV4 .showDeviceManagement

C++

API Reference: AuthV4 ::showDeviceManagement

Kotlin

API Reference: AuthV4.showDeviceManagement

Java

API Reference: AuthV4.INSTANCE .showDeviceManagement

Swift

API Reference: AuthV4Interface .showDeviceManagement

Objective-C

API Reference: HIVEAuthV4 showDeviceManagement

Google Play Game Achievement and Leaderboard

To get your game featured on Google Play Games, you need to implement achievement and leaderboard function of Google Play Games.

If user signs in your game with Google account among IdPs, it automatically signs in Play Games Services(PGS), so achievement and leaderboard are available. In case the user signs out from the settings screen of PGS, player account is signed out as same as the process when signed-out button in game is tapped. For more information about the function of PGS, see Google Play Games Services guide.

Sending PlayerID

If you need to request PlayerID to Google Play Games, implement getGooglePlayerId() method in the ProviderGoogle class. By implementing this method, it sends PlayerID as well as AuthCode, which validates session key.

Followings are sample codes.

Unity®

API Reference: hive.ProviderGoogle.getGooglePlayerId

C++

API Reference: ProviderGoogle::getGooglePlayerId

Android

API Reference: com.hive.ProviderGoogle.getGooglePlayerId

Achievement

Implement ProviderGoogle class to use Achievement function of Google Play Games through Hive.

Request to reveal a hidden achievement

To reveal a hidden achievement to the currently signed-in player, call achievementsReveal() method. It will have no effect but uncover the 0% of achievement.
Followings are sample codes.

Unity®

API Reference: hive.ProviderGoogle.achievementsReveal

C++

API Reference: ProviderGoogle::achievementsReveal

Kotlin

API Reference: ProviderGoogle.achievementsReveal

Java

API Reference: ProviderGoogle .INSTANCE.achievementsReveal

Request to unlock an achievement

To unlock an achievement to the currently signed-in player, call achievementsUnlock() method. This method will mark 100% of achievement regardless of its status; hidden or not.
Followings are sample codes.

Unity®

API Reference: ProviderGoogle.achievementsUnlock

C++

API Reference: ProviderGoogle::achievementsUnlock

Kotlin

API Reference: ProviderGoogle.achievementsUnlock

Java

API Reference: ProviderGoogle .INSTANCE.achievementsUnlock

Request to increment an achievement

To use the request function to increment achievement, set the achievement value as a parameter, and then call achievementsIncrement() method. The achievement value is the sum of the value set when the corresponding API is called and the achievement is automatically achieved when the total sum is max.
Followings are sample codes.

Unity®

API Reference: hive.ProviderGoogle.achievementsIncrement

C++

API Reference: ProviderGoogle::achievementsIncrement

Kotlin

API Reference: ProviderGoogle.achievementsIncrement

Java

API Reference: ProviderGoogle .INSTANCE.achievementsIncrement

Request to show achievement list (Helper)

Call showAchievements() method to request achievement list of Google Play Games.

Followings are sample codes.

Unity®

API Reference: AuthV4 .Helper.showAchievements

C++

API Reference: AuthV4 ::Helper::showAchievements

Kotlin

API Reference: AuthV4.Helper.showAchievements

Java

API Reference: AuthV4.Helper.INSTANCE.showAchievements

 

Request to show achievement list (Auth v4)

Call showAchievements() method to request achievement list of Google Play Games.
Followings are sample codes.

Unity®

API Reference: ProviderGoogle .showAchievements

C++

API Reference: ProviderGoogle ::showAchievements

Kotlin

API Reference: ProviderGoogle.showAchievements

Java

API Reference: ProviderGoogle.INSTANCE.showAchievements

 

Leaderboard

Implement ProviderGoogle class to use Leaderboard function of Google Play Games through Hive.

Leaderboard score updates

Call leaderboardsSubmitScore() method to request leaderboard score updates of Google Play Games.

Followings are sample codes.

Unity®

API Reference: hive.ProviderGoogle.leaderboardsSubmitScore

C++

API Reference: ProviderGoogle::leaderboardsSubmitScore

Kotlin

API Reference: ProviderGoogle.leaderboardsSubmitScore

Java

API Reference: com.hive.ProviderGoogle.leaderboardsSubmitScore

Request to show leaderboard list (Helper)

Call showLeaderboards() method to request leaderboard list of Google Play Games.
Followings are sample codes.

Unity®

API Reference: hive.AuthV4.Helper.showLeaderboard

C++

API Reference: com.hive.AuthV4.Helper.showLeaderboard

Kotlin

API Reference: Helper.showLeaderboard

Java

API Reference: AuthV4.Helper.INSTANCE.showLeaderboard

 

Request to show leaderboard list (Auth v4)

Call showLeaderboards() method to request leaderboard list of Google Play Games.
Followings are sample codes.

Unity®

API Reference: hive.ProviderGoogle.showLeaderboards

C++

API Reference: ProviderGoogle::showLeaderboards

Kotlin

API Reference: ProviderGoogle.showLeaderboards

Java

API Reference: com.hive.ProviderGoogle.showLeaderboards

 

Apple Game Center Game Achievement and Leaderboard

To get your game featured on Apple Game Center, you need to apply achievement and leaderboard function of Apple Game Center.

Regardless authentication status of users, the two functions of Apple Game Center are provided by Hive. That is, achievement and leaderboard uses the Apple Game Center account, but achievement and leaderboard uses the Apple Game Center account, but this account may not be linked to Hive account or differ from Hive account which the player currently signed in.

For more information about the function of Apple Game Center, see Apple Game Center Guide.

Achievement

Implement ProviderApple class to use Achievement function of Apple Game Center through Hive.

Request achievement list

To load an achievement list, call loadAchievements() method.
Followings are sample codes.

Unity®

API Reference: hive.ProviderApple.loadAchievements

C++

API Reference: ProviderApple::loadAchievements

iOS

API Reference: HIVEProviderApple::showAchievements:

Request to report an achievement

To report an achievement, call reportAchievement() method with parameters set to Achievement rate and Notification banner exposure for successful achievements.
Followings are sample codes.

Unity®

API Reference: hive .ProviderApple.reportAchievement

C++

API Reference: ProviderApple ::reportAchievement

Swift

API Reference: ProviderApple.reportAchievement

Objective-C

API Reference: HIVEProviderApple reportAchievement

Request to show achievement UI (Helper)

To show achievement UI, call showAchievements() method.
Followings are sample codes.

Unity®

API Reference: hive.AuthV4.Helper.showAchievements

C++

API Reference: AuthV4 ::Helper::showAchievements

Swift

API Reference: AuthV4Interface .helper().showAchievements

Objective-C

API Reference: [ HIVEAuthV4 helper] showAchievements

Request to show achievement UI

To show achievement UI, call showAchievements() method.
Followings are sample codes.

Unity®

API Reference: ProviderApple.showAchievements

C++

API Reference: ProviderApple::showAchievements

Swift

API Reference: ProviderApple.showAchievements

Objective-C

API Reference: HIVEProviderApple showAchievements

Request to reset an achievement

To reset an achievement, implement resetAchievements() method.
Followings are sample codes.

Unity®

API Reference: hive .ProviderApple.resetAchievements

C++

API Reference: ProviderApple ::resetAchievements

Swift

API Reference: resetAchievements(_:)

Objective-C

API Reference: HIVEProviderApple ::resetAchievements:

Leaderboard

Implement ProviderApple class to use Leaderboard function of Apple Game Center through Hive.

Request to report the leaderboard score

To report the leaderboard score to Apple Game Center, call reportScore() method.
Followings are sample codes.

Unity®

API Reference: hive .ProviderApple.reportScore

C++

API Reference: ProviderApple ::reportScore

Swift

API Reference: HIVEProviderApple::reportScore:leaderboardIdentifier:handler:

Objective-C

API Reference: HIVEProviderApple ::reportScore:leaderboardIdentifier:handler:

Request to show leaderboard UI (Helper)

To show leaderboard UI, call showLeaderboard() method.

Followings are sample codes.

Unity®

API Reference: hive .AuthV4.Helper.showLeaderboard

C++

API Reference: AuthV4 ::Helper::showLeaderboard

Swift

API Reference: showLeaderboard (_:)

Objective-C

API Reference: HIVEProviderApple ::showLeaderboard:

Request to show leaderboard UI

To show leaderboard UI, call showLeaderboard() method.

Followings are sample codes.

Unity®

API Reference: hive .ProviderApple.showLeaderboard

C++

API Reference: ProviderApple ::showLeaderboard

Swift

API Reference: showLeaderboard(_:)

Objective-C

API Reference: HIVEProviderApple ::showLeaderboard:

Post Photos on Social Media

Users can share and post photos on Facebook by importing photos from the gallery of their devices through a game. Followings are sample codes:

Unity®

API Reference: SocialV4. sharePhoto

C++

API Reference: SocialV4::sharePhoto

Kotlin

API Reference: SocialV4.sharePhoto

Java

API Reference: SocialV4.INSTANCE. sharePhoto

Swift

API Reference: SocialV4Interface.sharePhoto

Objective-C

API Reference: HIVESocialV4 sharePhoto

Automatic login to PC games with Hive community login

When you click the Play on PC button on the Hive community website, the PC game will be launched through Crossplay Launcher.

At this time, the PC game is automatically logged in using the ‘login token value’ of the Hive community.
 

Steam Implicit Login (Unity Windows)

Starting from Hive SDK v4 Unity Windows 24.2.0, Steam implicit login is supported. If you choose to use implicit login, you must use AuthV4.Helper.signIn and cannot use AuthV4.signIn(AUTO,...). As it is an implicit login, the app user logs in to the Steam only once after installing the game. When using Steam implicit login, you must implement the removal of the propFolder folder, which stores SDK configuration data, upon app deletion.