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.
API Reference: hive.AuthV4.getProviderFriendsList
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
using hive; AuthV4.ProviderType providerType = AuthV4.ProviderType.FACEBOOK; AuthV4.getProviderFriendsList (providerType, (ResultAPI result, AuthV4.ProviderType providerType, Dictionary<String, Int64> providerUserIdList) => { if (!result.isSuccess()) { return; } if (providerUserIdList != null) { foreach (KeyValuePair<String, Int64> providerUserId in providerUserIdList ) { // providerUserId: providerUserId.Key // playerId: providerUserId.Value } } }); |
API Reference: AuthV4::getProviderFriendsList
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; ProviderType providerType = ProviderType::FACEBOOK; AuthV4::getProviderFriendsList (providerType, [=](ResultAPI const & result, ProviderType providerType, map<string,PlayerID> providerUserIdList) { if (!result.isSuccess()) { return; } if (providerUserIdList != null) { for(auto i = providerUserIdList.begin() ; i != providerUserIdList.end(); i++) { // providerUserId: ( i->first).c_str() // playerId: i->second } } }); |
API Reference: com.hive.AuthV4.getProviderFriendsList
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
import com.hive.AuthV4 import com.hive.ResultAPI val providerType = AuthV4.ProviderType.FACEBOOK AuthV4.getProviderFriendsList(providerType, object : AuthV4.AuthV4ProviderFriendsListener { override fun onGetProviderFriendsList(result: ResultAPI, providerType: AuthV4.ProviderType, providerUserIdList: Map<String, Long>?) { if (!result.isSuccess) { return } providerUserIdList?.forEach { // providerUserId: it.key // playerId: it.value } } }) |
API Reference: com.hive.AuthV4.getProviderFriendsList
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
import com.hive.AuthV4; import com.hive.ResultAPI; AuthV4.ProviderType type = AuthV4.ProviderType.FACEBOOK; AuthV4.INSTANCE.getProviderFriendsList(type, (result, providerType, providerUserIdList) -> { if (!result.isSuccess()) { return; } if (providerUserIdList != null) { for (Map.Entry<String, Long> entry : providerUserIdList.entrySet()) { // providerUserId: entry.getKey(); // playerId: entry.getValue(); } } }); |
API Reference: AuthV4Interface.getProviderFriendsList
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
import HIVEService AuthV4Interface.getProviderFriendsList(.Facebook) { result, retProviderType, providerUserIdList in if !result.isSuccess() { return } if let providerUserIdList = providerUserIdList { for (key in providerUserIdList.keys) { // providerUserId: key // playerId: providerUserIdList[key] } } } |
API Reference: HIVEAuthV4:getProviderFriendsList
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#import <HIVEService/HIVEService-Swift.h> [HIVEAuthV4 getProviderFriendsList: HIVEProviderTypeFACEBOOK handler: ^(HIVEResultAPI *result, HIVEProviderType retProviderType, NSDictionary<NSString *,NSNumber *> *providerUserIdList) { if (!result.isSuccess()) { return; } if (providerUserIdList != nil) { for (NSString *key in providerUserIdList) { // providerUserId: key // playerId: [[providerUserIdList objectForKey:key] longlongValue]; } } }]; |
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
API Reference: AuthV4 .getAgeGateU13
1 2 3 |
using hive; Boolean ageGateU13 = AuthV4.getAgeGateU13(); |
API Reference: AuthV4 ::getAgeGateU13
1 2 3 4 5 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; bool ageGateU13 = AuthV4::getAgeGateU13(); |
API Reference: AuthV4.getAgeGateU13
1 2 3 |
import com.hive.AuthV4 val ageGateU13 = AuthV4.getAgeGateU13() |
API Reference: AuthV4 .INSTANCE.getAgeGateU13
1 2 3 |
import com.hive.AuthV4; boolean ageGateU13 = AuthV4.INSTANCE.getAgeGateU13(); |
API Reference: AuthV4Interface.getAgeGateU13
1 2 3 |
import HIVEService Bool ageGateU13 = AuthV4Interface.getAgeGateU13() |
API Reference: HIVEAuthV4 getAgeGateU13
1 2 3 |
#import <HIVEService/HIVEService-Swift.h> BOOL ageGateU13 = [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()
orAuth.initialize()
. - Push API is not implemented.
- Agreement request popup on Push notification is not displayed when calling
- 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.
1 2 3 |
using hive; Boolean ageGateU16Agree = Configuration.getAgeGateU16Agree(); |
1 2 3 4 5 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; bool ageGateU16Agree = Configuration::getAgeGateU16Agree(); |
1 2 3 |
import com.hive.Configuration val ageGateU16Agree = Configuration.ageGateU16Agree() |
1 2 3 |
import com.hive.Configuration; boolean ageGateU16Agree = Configuration.INSTANCE.getAgeGateU16Agree(); |
1 2 3 |
import HIVEService var ageGateU16Agree: Bool = ConfigurationInterface.getAgeGateU16Agree() |
1 2 3 |
#import <HIVEService/HIVEService-Swift.h> BOOL ageGateU16 = [HIVEConfiguration getAgeGateU16Agree]; |
Checking legal guardian consent
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.
1 2 3 |
using hive; Boolean legalGuardianConsentAgree = Configuration.getLegalGuardianConsentAgree(); |
1 2 3 4 5 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; bool ageGateU16Agree = Configuration::getLegalGuardianConsentAgree(); |
1 2 3 |
import com.hive.Configuration val legalGuardianConsentAgree = Configuration.legalGuardianConsentAgree() |
1 2 3 |
import com.hive.Configuration; boolean legalGuardianConsentAgree = Configuration.INSTANCE.getLegalGuardianConsentAgree(); |
1 2 3 |
import HIVEService var legalGuardianConsentAgree: Bool = ConfigurationInterface.getLegalGuardianConsentAgree() |
1 2 3 |
#import <HIVEService/HIVEService-Swift.h> BOOL legalGuardianConsentAgree = [HIVEConfiguration getLegalGuardianConsentAgree]; |
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
API Reference: PlatformHelper .requestUserPermissions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
String[] requestArray = {"android.permission.WRITE_EXTERNAL_STORAGE", "android.permission.BLUETOOTH", "android.permission.READ_CONTACTS"}; List<String> requests = new List<String>(requestArray); PlatformHelper.requestUserPermissions( requests, (ResultAPI result, String[] granted, String[] denied) => { if (result.code == ResultAPI.Code.PlatformHelperOSNotSupported) { //Android only } if (result.code == ResultAPI.Code.PlatformHelperOSVersionNotSupported) { //Android OS version not supported. } if (granted != null && granted.Length > 0) { foreach (String name in granted) { // List of permissions accepted among requests } } if (denied != null && denied.Length > 0) { foreach (String name denied) { // List of permissions denied among requests } } }); |
API Reference: PlatformHelper ::requestUserPermissions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
string requestArray[] = {"android.permission.WRITE_EXTERNAL_STORAGE", "android.permission.BLUETOOTH", "android.permission.READ_CONTACTS"}; vector<string> requests(begin(requestArray), end(requestArray)); PlatformHelper::requestUserPermissions(requests, [=](ResultAPI const & result, vector<string> const & granted, vector<string> const & denied) { if (result.code == hive::ResultAPI::PlatformHelperOSNotSupported) { //Android only } if (result.code == hive::ResultAPI::PlatformHelperOSVersionNotSupported) { //Android OS version not supported. } if (!granted.empty()) { for (string name : granted) { // List of permissions accepted among requests } } if (!denied.empty()) { for (string name : denied) { // List of permissions denied among requests } } }); |
API Reference: PlatformHelper.requestUserPermissions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
import com.hive.PlatformHelper import com.hive.ResultAPI val requests = arrayListOf( "android.permission.WRITE_EXTERNAL_STORAGE", "android.permission.BLUETOOTH", "android.permission.READ_CONTACTS" ) PlatformHelper.requestUserPermissions(requests, object : PlatformHelper.RequestUserPermissionsListener { override fun onRequestUserPermissions(result: ResultAPI, granted: List<String>, denied: List<String>) { when (result.code) { ResultAPI.Code.Success -> { if (granted.isNotEmpty()) { // List of permissions accepted among requests } if (denied.isNotEmpty()) { // List of permissions denied among requests } } ResultAPI.Code.PlatformHelperOSVersionNotSupported -> { //Android OS version not supported. } else -> { // other exception situations } } } }) |
API Reference: PlatformHelper .INSTANCE.requestUserPermissions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
import com.hive.PlatformHelper; import com.hive.ResultAPI; List<String> requests = Arrays.asList( "android.permission.WRITE_EXTERNAL_STORAGE", "android.permission.BLUETOOTH", "android.permission.READ_CONTACTS"); PlatformHelper.INSTANCE.requestUserPermissions(requests, (result, granted, denied) -> { switch (result.getCode()) { case Success: if (!granted.isEmpty()) { // List of permissions accepted among requests } if (!denied.isEmpty()) { // List of permissions denied among requests } break; case PlatformHelperOSVersionNotSupported: //Android OS version not supported. break; default: // other exception situations break; } }); |
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.
API Reference: AuthV4 .showDeviceManagement
1 2 3 4 5 6 7 |
using hive; AuthV4.showDeviceManagement((ResultAPI result) => { if (result.isSuccess()) { // Closed after exposing the device management UI } } |
API Reference: AuthV4 ::showDeviceManagement
1 2 3 4 5 6 7 8 9 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; AuthV4::showDeviceManagement([=](ResultAPI const & result) { if (result.isSuccess()) { // Closed after exposing the device management UI } }); |
API Reference: AuthV4.showDeviceManagement
1 2 3 4 5 6 7 8 9 10 |
import com.hive.AuthV4 import com.hive.ResultAPI AuthV4.showDeviceManagement(object : AuthV4.AuthV4ShowDeviceManagementListener { override fun onAuthV4ShowDeviceManagement(result: ResultAPI) { if (result.isSuccess) { // Closed after exposing the device management UI } } }) |
API Reference: AuthV4.INSTANCE .showDeviceManagement
1 2 3 4 5 6 7 8 |
import com.hive.AuthV4; import com.hive.ResultAPI; AuthV4.INSTANCE.showDeviceManagement(result -> { if (result.isSuccess()) { // Closed after exposing the device management UI } }); |
API Reference: AuthV4Interface .showDeviceManagement
1 2 3 4 5 6 7 |
import HIVEService AuthV4Interface.showDeviceManagement() { result in if result.isSuccess() { // Closed after exposing the device management UI } } |
API Reference: HIVEAuthV4 showDeviceManagement
1 2 3 4 5 6 7 |
#import <HIVEService/HIVEService-Swift.h> [HIVEAuthV4 showDeviceManagement: ^(HIVEResultAPI *result) { if ([result isSuccess]) { // Closed after exposing the device management UI } }]; |
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.
API Reference: hive.ProviderGoogle.getGooglePlayerId
1 2 3 4 5 6 |
// Request the playerID from Google Play Games. ProviderGoogle.getGooglePlyaerId((ResultAPI result, String googlePlayerId, String authCode)=>{ if(result.isSuccess()){ // Success in API call. } }); |
API Reference: ProviderGoogle::getGooglePlayerId
1 2 3 4 5 6 7 |
// Request the playerID from Google Play Games. ProviderGoogle::getGooglePlayerId([=](ResultAPI const &result, std::string const &googlePlayerId, std::string const &authCode) { if (result.isSuccess()) { // Success in API call. } }); |
API Reference: com.hive.ProviderGoogle.getGooglePlayerId
1 2 3 4 5 6 7 8 9 |
// Request the playerID from Google Play Games. ProviderGoogle.getGooglePlayerId(new ProviderGoogle.GooglePlayerIdListener() { @Override public void onPlayerIdResult(ResultAPI resultAPI, String googlePlayerId, String authCode) { if(resultAPI.isSuccess()){ // Success in API call. } } }); |
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.
API Reference: hive.ProviderGoogle.achievementsReveal
1 2 3 4 5 6 7 8 9 10 |
using hive; //Achievement ID String achievementId = "abcdef123456"; ProviderGoogle.achievementsReveal(achievementId, (ResultAPI result) => { if (result.isSuccess()) { // call successful } }); |
API Reference: ProviderGoogle::achievementsReveal
1 2 3 4 5 6 7 8 9 10 11 12 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; //Achievement ID string achievementId = "abcdef123456"; ProviderGoogle::achievementsReveal(achievementId, [=](ResultAPI const & result) { if(result.isSuccess()){ // call successful } }); |
API Reference: ProviderGoogle.achievementsReveal
1 2 3 4 5 6 7 8 9 10 11 12 13 |
import com.hive.ProviderGoogle import com.hive.ResultAPI //Achievement ID val achievementId = "abcdef123456" ProviderGoogle.achievementsReveal(achievementId, object : ProviderGoogle.GoogleAchievementsListener { override fun onAchievementsResult(resultAPI: ResultAPI) { if (resultAPI.isSuccess) { // call successful } } }) |
API Reference: ProviderGoogle .INSTANCE.achievementsReveal
1 2 3 4 5 6 7 8 9 10 11 |
import com.hive.ProviderGoogle; import com.hive.ResultAPI; //Achievement ID String achievementId = "abcdef123456"; ProviderGoogle.INSTANCE.achievementsReveal(achievementId, resultAPI -> { if (resultAPI.isSuccess()) { // call successful } }); |
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.
API Reference: ProviderGoogle.achievementsUnlock
1 2 3 4 5 6 7 8 9 10 |
using hive; //Achievement ID String achievementId = "abcdef123456"; ProviderGoogle.achievementsUnlock(achievementId, (ResultAPI result) => { if (result.isSuccess()) { // call successful } }); |
API Reference: ProviderGoogle::achievementsUnlock
1 2 3 4 5 6 7 8 9 10 11 12 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; //Achievement ID string achievementId = "abcdef123456"; ProviderGoogle::achievementsUnlock(achievementId, [=](ResultAPI const & result) { if(result.isSuccess()){ // call successful } }); |
API Reference: ProviderGoogle.achievementsUnlock
1 2 3 4 5 6 7 8 9 10 11 12 13 |
import com.hive.ProviderGoogle import com.hive.ResultAPI //Achievement ID val achievementId = "abcdef123456" ProviderGoogle.achievementsUnlock(achievementId, object : ProviderGoogle.GoogleAchievementsListener { override fun onAchievementsResult(resultAPI: ResultAPI) { if (resultAPI.isSuccess) { // call successful } } }) |
API Reference: ProviderGoogle .INSTANCE.achievementsUnlock
1 2 3 4 5 6 7 8 9 10 11 |
import com.hive.ProviderGoogle; import com.hive.ResultAPI; //Achievement ID String achievementId = "abcdef123456"; ProviderGoogle.INSTANCE.achievementsUnlock(achievementId, resultAPI -> { if (resultAPI.isSuccess()) { // call successful } }); |
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.
API Reference: hive.ProviderGoogle.achievementsIncrement
1 2 3 4 5 6 7 8 9 10 11 12 |
using hive; //Achievement ID String achievementId = "abcdef123456"; // Achievement numbers int value = 1; ProviderGoogle.achievementsIncrement(achievementId, value, (ResultAPI result) => { if (result.isSuccess()){ // call successful } }); |
API Reference: ProviderGoogle::achievementsIncrement
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; //Achievement ID string achievementId = "abcdef123456"; // Achievement numbers int value = 1; ProviderGoogle::achievementsIncrement(achievementId, value, [=](ResultAPI const & result) { if(result.isSuccess()){ // call successful } }); |
API Reference: ProviderGoogle.achievementsIncrement
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import com.hive.ProviderGoogle import com.hive.ResultAPI //Achievement ID val achievementId = "abcdef123456" // Achievement numbers val value = 1 ProviderGoogle.achievementsIncrement(achievementId, value, object : ProviderGoogle.GoogleAchievementsListener { override fun onAchievementsResult(resultAPI: ResultAPI) { if (resultAPI.isSuccess) { // call successful } } }) |
API Reference: ProviderGoogle .INSTANCE.achievementsIncrement
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
import com.hive.ProviderGoogle; import com.hive.ResultAPI; //Achievement ID String achievementId = "abcdef123456"; // Achievement numbers int value = 1; ProviderGoogle.INSTANCE.achievementsIncrement(achievementId, value, resultAPI -> { if (resultAPI.isSuccess()) { // call successful } }); |
Request to show achievement list (Helper)
Call showAchievements()
method to request achievement list of Google Play Games.
Followings are sample codes.
API Reference: AuthV4 .Helper.showAchievements
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
using hive; AuthV4.Helper.showAchievements ((ResultAPI result, AuthV4.PlayerInfo playerInfo) => { switch (result.code) { case ResultAPI.Code.Success: // Deliver Success with achievement indication break; case ResultAPI.Code.AuthV4ConflictPlayer: // account conflict break; case ResultAPI.Code.AuthV4GoogleLogout: //TODO: // After logging out of Google Play, log out of the game // Relaunching the game must be handled by the development studio break; default: // other exception situations break; } }); |
API Reference: AuthV4 ::Helper::showAchievements
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; AuthV4::Helper::showAchievements([=](ResultAPI const & result, shared_ptr playerInfo) { switch (result.code) { case ResultAPI::Success: // Deliver Success with achievement indication break; case ResultAPI::AuthV4ConflictPlayer: // account conflict break; case ResultAPI::AuthV4GoogleLogout: //TODO: // After logging out of Google Play, log out of the game // Relaunching the game must be handled by the development studio break; default: // other exception situations break; } }); |
API Reference: AuthV4.Helper.showAchievements
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import com.hive.AuthV4 import com.hive.ResultAPI AuthV4.Helper.showAchievements(object : AuthV4.Helper.AuthV4HelperListener { override fun onAuthV4Helper(result: ResultAPI, playerInfo: AuthV4.PlayerInfo?) { when (result.code) { ResultAPI.Code.Success -> { // Deliver Success with achievement indication } ResultAPI.Code.AuthV4ConflictPlayer -> { // account conflict } ResultAPI.Code.AuthV4GoogleLogout -> { //TODO: // After logging out of Google Play, log out of the game // Relaunching the game must be handled by the development studio } else -> { // other exception situations } } } }) |
API Reference: AuthV4.Helper.INSTANCE.showAchievements
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import com.hive.AuthV4; import com.hive.ResultAPI; AuthV4.Helper.INSTANCE.showAchievements((result, playerInfo) -> { switch (result.getCode()) { case Success: // Deliver Success with achievement indication break; case AuthV4ConflictPlayer: // account conflict break; case AuthV4GoogleLogout: //TODO: // After logging out of Google Play, log out of the game // Relaunching the game must be handled by the development studio break; default: // other exception situations break; } }); |
Request to show achievement list (Auth v4)
Call showAchievements()
method to request achievement list of Google Play Games.
Followings are sample codes.
API Reference: ProviderGoogle .showAchievements
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
using hive; ProviderGoogle.showAchievements((ResultAPI result) => { switch (result.code) { case ResultAPI.Code.Success: // Deliver Success with achievement indication break; case ResultAPI.Code.AuthV4GoogleLogout: //TODO: // After logging out of Google Play, log out of the game // Relaunching the game must be handled by the development studio break; default: // other exception situations break; } }); |
API Reference: ProviderGoogle ::showAchievements
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; ProviderGoogle::showAchievements([=](ResultAPI const & result) { switch (result.code) { case ResultAPI::Success: // Deliver Success with achievement indication break; case ResultAPI::AuthV4GoogleLogout: //TODO: // After logging out of Google Play, log out of the game // Relaunching the game must be handled by the development studio break; default: // other exception situations break; } }); |
API Reference: ProviderGoogle.showAchievements
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import com.hive.ProviderGoogle import com.hive.ResultAPI ProviderGoogle.showAchievements(object : ProviderGoogle.GoogleAchievementsListener { override fun onAchievementsResult(resultAPI: ResultAPI) { when(resultAPI.code) { ResultAPI.Code.Success -> { // Deliver Success with achievement indication } ResultAPI.Code.AuthV4GoogleLogout -> { //TODO: // After logging out of Google Play, log out of the game // Relaunching the game must be handled by the development studio } else -> { // other exception situations } } } }) |
API Reference: ProviderGoogle.INSTANCE.showAchievements
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
import com.hive.ProviderGoogle; import com.hive.ResultAPI; ProviderGoogle.INSTANCE.showAchievements(resultAPI -> { switch (resultAPI.getCode()) { case Success: // Deliver Success with achievement indication break; case AuthV4GoogleLogout: //TODO: // After logging out of Google Play, log out of the game // Relaunching the game must be handled by the development studio break; default: // other exception situations break; } }); |
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.
API Reference: hive.ProviderGoogle.leaderboardsSubmitScore
1 2 3 4 5 6 7 8 9 10 11 12 13 |
using hive // Leaderboard ID String leaderboardId = "12345abcde"; // Leaderboard score number long score = 100; ProviderGoogle.leaderboardsSubmitScore(leaderboardId, score, (ResultAPI result) => { if (result.isSuccess()) { // API call successful } }); |
API Reference: ProviderGoogle::leaderboardsSubmitScore
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; // Leaderboard ID string leaderboardId = "12345abcde"; // Leaderboard score number long score = 100; ProviderGoogle::leaderboardsSubmitScore(leaderboardId, score, [=](ResultAPI const & result) { if (result.isSuccess()) { // API call successful } }); |
API Reference: ProviderGoogle.leaderboardsSubmitScore
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import com.hive.ProviderGoogle import com.hive.ResultAPI // Leaderboard ID val leaderboardId = "12345abcde" // Leaderboard score number val score = 100L ProviderGoogle.leaderboardsSubmitScore(leaderboardId, score, object : ProviderGoogle.GoogleLeaderboardsListener { override fun onLeaderboardsResult(resultAPI: ResultAPI) { if (resultAPI.isSuccess) { // API call successful } } }) |
API Reference: com.hive.ProviderGoogle.leaderboardsSubmitScore
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
import com.hive.ProviderGoogle; import com.hive.ResultAPI; // Leaderboard ID String leaderboardId = "12345abcde"; // Leaderboard score number long score = 100; ProviderGoogle.INSTANCE.leaderboardsSubmitScore(leaderboardId, score, resultAPI -> { if (resultAPI.isSuccess()) { // API call successful } }); |
Request to show leaderboard list (Helper)
Call showLeaderboards()
method to request leaderboard list of Google Play Games.
Followings are sample codes.
API Reference: hive.AuthV4.Helper.showLeaderboard
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
using hive; AuthV4.Helper.showLeaderboard ((ResultAPI result, AuthV4.PlayerInfo playerInfo) => { switch (result.code) { case ResultAPI.Code.Success: // Deliver Success with leaderboard display break; case ResultAPI.Code.AuthV4ConflictPlayer: // account conflict break; case ResultAPI.CodeAuthV4GoogleLogout: //TODO: // After logging out of Google Play, log out of the game // Relaunching the game must be handled by the development studio break; default: // other exception situations break; } }); |
API Reference: com.hive.AuthV4.Helper.showLeaderboard
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; AuthV4::Helper::showLeaderboard([=](ResultAPI const & result, shared_ptr playerInfo) { switch (result.code) { case ResultAPI::Success: // Deliver Success with leaderboard display break; case ResultAPI::AuthV4ConflictPlayer: // account conflict break; case ResultAPI::AuthV4GoogleLogout: //TODO: // After logging out of Google Play, log out of the game // Relaunching the game must be handled by the development studio break; default: break; } }); |
API Reference: Helper.showLeaderboard
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import com.hive.AuthV4 import com.hive.ResultAPI AuthV4.Helper.showLeaderboard(object : AuthV4.Helper.AuthV4HelperListener { override fun onAuthV4Helper(result: ResultAPI, playerInfo: AuthV4.PlayerInfo?) { when (result.code) { ResultAPI.Code.Success -> { // Deliver Success with leaderboard display } ResultAPI.Code.AuthV4ConflictPlayer -> { // account conflict } ResultAPI.Code.AuthV4GoogleLogout -> { //TODO: // After logging out of Google Play, log out of the game // Relaunching the game must be handled by the development studio } else -> { // other exception situations } } } }) |
API Reference: AuthV4.Helper.INSTANCE.showLeaderboard
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import com.hive.AuthV4; import com.hive.ResultAPI; AuthV4.Helper.INSTANCE.showLeaderboard((result, playerInfo) -> { switch (result.getCode()) { case Success: // Deliver Success with leaderboard display break; case AuthV4ConflictPlayer: // account conflict break; case AuthV4GoogleLogout: //TODO: // After logging out of Google Play, log out of the game // Relaunching the game must be handled by the development studio break; default: // other exception situations break; } }); |
Request to show leaderboard list (Auth v4)
Call showLeaderboards()
method to request leaderboard list of Google Play Games.
Followings are sample codes.
API Reference: hive.ProviderGoogle.showLeaderboards
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
using hive; ProviderGoogle.showLeaderboards(onLeaderboardsResult, (ResultAPI result) => { switch (result.code) { case ResultAPI.Code.Success: // Deliver Success with leaderboard display break; case ResultAPI.CodeAuthV4GoogleLogout: //TODO: // After logging out of Google Play, log out of the game // Relaunching the game must be handled by the development studio break; default: // other exception situations break; } }); |
API Reference: ProviderGoogle::showLeaderboards
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; ProviderGoogle::showLeaderboard([=](ResultAPI const & result) { switch (result.code) { case ResultAPI::Success: // Deliver Success with leaderboard display break; case ResultAPI::AuthV4GoogleLogout: //TODO: // After logging out of Google Play, log out of the game // Relaunching the game must be handled by the development studio break; default: // other exception situations break; } }); |
API Reference: ProviderGoogle.showLeaderboards
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import com.hive.ProviderGoogle import com.hive.ResultAPI ProviderGoogle.showLeaderboards(object : ProviderGoogle.GoogleLeaderboardsListener { override fun onLeaderboardsResult(resultAPI: ResultAPI) { when(resultAPI.code) { ResultAPI.Code.Success -> { // Deliver Success with leaderboard display } ResultAPI.Code.AuthV4GoogleLogout -> { //TODO: // After logging out of Google Play, log out of the game // Relaunching the game must be handled by the development studio } else -> { // other exception situations } } } }) |
API Reference: com.hive.ProviderGoogle.showLeaderboards
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
import com.hive.ProviderGoogle; import com.hive.ResultAPI; ProviderGoogle.INSTANCE.showLeaderboards(resultAPI -> { switch (resultAPI.getCode()) { case Success: // Deliver Success with leaderboard display break; case AuthV4GoogleLogout: //TODO: // After logging out of Google Play, log out of the game // Relaunching the game must be handled by the development studio break; default: // other exception situations break; } }); |
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.
API Reference: hive.ProviderApple.loadAchievements
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
// Request achievement list to Provider Apple // using hive // Callback handler managing the request for achievement list to Provider Apple public void onLoadAchievements(ResultAPI result, List achievementList) { Logger.log("ProviderTestView.onLoadAchievements() Callback\nresult = " + result.toString() + "\n"); if (result.isSuccess() != true) return; } // Request achievement list to Provider Apple ProviderApple.loadAchievements(onLoadAchievements); |
API Reference: ProviderApple::loadAchievements
1 2 3 4 5 6 7 8 9 10 |
// Request achievement list to Provider Apple ProviderApple::loadAchievements([=](ResultAPI const & result,std::vector<ProviderAppleAchievement>; const & achievements) { // Result callback cout<<"ProviderApple::loadAchievements() Callback"<<endl<<result.toString()<<endl; if (result.isSuccess() != true) return; }); |
API Reference: HIVEProviderApple::showAchievements:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
// Request achievement list to Provider Apple [HIVEProviderApple loadAchievements:^(HIVEResultAPI *result, NSArray<HIVEProviderAppleAchievement *>; *achievements) { Loggerd(@"HIVEProviderApple.loadAchievements:\nresult = %@\nachievements = %@", result, achievements); if (result.isSuccess) { } else { } }]; |
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.
API Reference: hive .ProviderApple.reportAchievement
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
using hive; //Achievement achieved %. Achievement completed at 100 String achievementPercent = "100"; // Whether to display the top banner when an achievement is successful. default false Boolean isShow = true; //Achievement Id String achievementId = "com.hivesdk.achievement.10hit"; ProviderApple.reportAchievement(achievementPercent, isShow, achievementId, (ResultAPI result) => { if (result.isSuccess()) { // call successful } }); |
API Reference: ProviderApple ::reportAchievement
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; //Achievement achieved %. Achievement completed at 100 string achievementPercent = "100"; // Whether to display the top banner when an achievement is successful. default false bool isShow = true; //Achievement Id string achievementId = "com.hivesdk.achievement.10hit"; ProviderApple::reportAchievement(achievementPercent, isShow, achievementId, [=](ResultAPI const & result) { if (result.isSuccess()) { // call successful } }); |
API Reference: ProviderApple.reportAchievement
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
import HIVEService //Achievement achieved %. Achievement completed at 100 letachievementPercent = "100" // Whether to display the top banner when an achievement is successful. default false let isShow = true //Achievement Id let achievementId = "com.hivesdk.achievement.10hit" ProviderApple.reportAchievement(achievementPercent, showsCompletionBanner: isShow, achievementIdentifier: achievementId) { result in if result.isSuccess() { // call successful } } |
API Reference: HIVEProviderApple reportAchievement
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#import <HIVEService/HIVEService-Swift.h> //Achievement achieved %. Achievement complete when 100 NSString *achievementPercent = @"100"; // Whether to display the top banner when an achievement is successful. default NO BOOL isShow = YES; //Achievement Id NSString *achievementId = @"com.hivesdk.achievement.10hit"; [HIVEProviderApple reportAchievement: achievementPercent showsCompletionBanner: isShow achievementIdentifier: achievementId handler: ^(HIVEResultAPI *result) { if ([result isSuccess]) { // call successful } }]; |
Request to show achievement UI (Helper)
To show achievement UI, call showAchievements()
method.
Followings are sample codes.
API Reference: hive.AuthV4.Helper.showAchievements
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
using hive; AuthV4.Helper.showAchievements ((ResultAPI result, AuthV4.PlayerInfo playerInfo) => { switch (result.code) { case ResultAPI.Code.Success: // Deliver Success with achievement indication break; case ResultAPI.Code.AuthV4ConflictPlayer: // account conflict break; case ResultAPI.Code.AuthV4GoogleLogout: //TODO: // After logging out of Google Play, log out of the game // Relaunching the game must be handled by the development studio break; default: // other exception situations break; } }); |
API Reference: AuthV4 ::Helper::showAchievements
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; AuthV4::Helper::showAchievements([=](ResultAPI const & result, shared_ptr playerInfo) { switch (result.code) { case ResultAPI::Success: // Deliver Success with achievement indication break; case ResultAPI::AuthV4ConflictPlayer: // account conflict break; case ResultAPI::AuthV4GoogleLogout: //TODO: // After logging out of Google Play, log out of the game // Relaunching the game must be handled by the development studio break; default: // other exception situations break; } }); |
API Reference: AuthV4Interface .helper().showAchievements
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
// If the currently logged in Hive account is not connected to GameCenter // Automatically attempts to connect to GameCenter import HIVEService AuthV4Interface.helper().showAchievements() { result, playerInfo in switch result.getCode() { case .success: // Deliver Success with achievement indication case .authV4ConflitPlayer: // account conflict default: break } } |
API Reference: [ HIVEAuthV4 helper] showAchievements
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
// If the currently logged in Hive account is not connected to GameCenter // Automatically attempts to connect to GameCenter #import <HIVEService/HIVEService-Swift.h> [[HIVEAuthV4 helper] showAchievements: ^(HIVEResultAPI *result, HIVEPlayerInfo *playerInfo) { switch ([result getCode]) { case HIVEResultAPICodeSuccess: // Deliver Success with achievement indication break; case HIVEResultAPICodeAuthV4ConflictPlayer: // account conflict break; default: // other exception situations break; } }]; |
Request to show achievement UI
To show achievement UI, call showAchievements()
method.
Followings are sample codes.
API Reference: ProviderApple.showAchievements
1 2 3 4 5 6 7 |
using hive; ProviderApple.showAchievements((ResultAPI result) { if (result.isSuccess()) { // call successful } }); |
API Reference: ProviderApple::showAchievements
1 2 3 4 5 6 7 8 9 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; ProviderApple::showAchievements([=](ResultAPI const & result) { if (result.isSuccess()) { // call successful } }); |
API Reference: ProviderApple.showAchievements
1 2 3 4 5 6 7 |
import HIVEService ProviderApple.showAchievements() { result in if result.isSuccess() { // call successful } } |
API Reference: HIVEProviderApple showAchievements
1 2 3 4 5 6 7 |
#import <HIVEService/HIVEService-Swift.h> [HIVEProviderApple showAchievements: ^(HIVEResultAPI *result) { if ([result isSuccess]) { // call successful } }]; |
Request to reset an achievement
To reset an achievement, implement resetAchievements()
method.
Followings are sample codes.
API Reference: hive .ProviderApple.resetAchievements
1 2 3 4 5 6 7 |
using hive; ProviderApple.resetAchievements((ResultAPI result) => { if (result.isSuccess()) { // call successful } }); |
API Reference: ProviderApple ::resetAchievements
1 2 3 4 5 6 7 8 9 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; ProviderApple::resetAchievements([=](ResultAPI const & result) { if (result.isSuccess()) { // call successful } }); |
API Reference: resetAchievements(_:)
1 2 3 4 5 6 7 |
import HIVEService ProviderApple.resetAchievements() { result in if result.isSuccess() { // call successful } } |
API Reference: HIVEProviderApple ::resetAchievements:
1 2 3 4 5 6 7 |
#import <HIVEService/HIVEService-Swift.h> [HIVEProviderApple resetAchievements: ^(HIVEResultAPI *result) { if ([result isSuccess]) { // call successful } }]; |
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.
API Reference: hive .ProviderApple.reportScore
1 2 3 4 5 6 7 8 9 10 |
using hive; String playerScore = "1234"; String leaderBoardId = "com.hivesdk.leaderboard.10hit"; ProviderApple.reportScore(playerScore, leaderBoardId, (ResultAPI result) => { if (result.isSuccess()) { // call successful } }); |
API Reference: ProviderApple ::reportScore
1 2 3 4 5 6 7 8 9 10 11 12 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; string playerScore = "1234"; string leaderBoardId = "com.hivesdk.leaderboard.10hit"; ProviderApple::reportScore(playerScore, leaderBoardId, [=](ResultAPI const & result) { if (result.isSuccess()) { // call successful } }); |
API Reference: HIVEProviderApple::reportScore:leaderboardIdentifier:handler:
1 2 3 4 5 6 7 8 9 10 |
import HIVEService let playerScore = "1234" let leaderBoardId = "com.hivesdk.leaderboard.10hit" ProviderApple.reportScore(playScore, leaderboardIdentifier: leaderboardId) { result in if result.isSuccess() { // call successful } } |
API Reference: HIVEProviderApple ::reportScore:leaderboardIdentifier:handler:
1 2 3 4 5 6 7 8 9 10 |
#import <HIVEService/HIVEService-Swift.h> NSString *playerScore = @"1234"; NSString *leaderBoardId = "com.hivesdk.leaderboard.10hit"; [HIVEProviderApple reportScore: playerScore leaderboardIdentifier: leaderBoardId handler: ^(HIVEResultAPI *result) { if ([result isSuccess]) { // call successful } }]; |
Request to show leaderboard UI (Helper)
To show leaderboard UI, call showLeaderboard()
method.
Followings are sample codes.
API Reference: hive .AuthV4.Helper.showLeaderboard
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
// If the currently logged in Hive account is not connected to GameCenter // Automatically attempts to connect to GameCenter using hive; AuthV4.Helper.showLeaderboard((ResultAPI result, AuthV4.PlayerInfo playerInfo) => { switch (result.code) { case ResultAPI.Code.Success: // Deliver Success with leaderboard display break; case ResultAPI.Code.AuthV4ConflictPlayer: // account conflict break; default: // other exception situations break; } }); |
API Reference: AuthV4 ::Helper::showLeaderboard
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
// If the currently logged in Hive account is not connected to GameCenter // Automatically attempts to connect to GameCenter #include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; AuthV4::Helper::showLeaderboard([=](ResultAPI const & result, shared_ptr<PlayerInfo> playerInfo) { switch (result.code) { case ResultAPI::Success: // Deliver Success with leaderboard display break; case ResultAPI::AuthV4ConflictPlayer: // account conflict break; default: break; } }); |
API Reference: showLeaderboard (_:)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
// If the currently logged in Hive account is not connected to GameCenter // Automatically attempts to connect to GameCenter import HIVEService AuthV4Interface.helper().showLeaderboard() { result, playerInfo in switch result.getCode() { case .success: // Deliver Success with leaderboard display case .authV4ConflictPlayer: // account conflict default: break } } |
API Reference: HIVEProviderApple ::showLeaderboard:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
// If the currently logged in Hive account is not connected to GameCenter // Automatically attempts to connect to GameCenter #import <HIVEService/HIVEService-Swift.h> [[HIVEAuthV4 helper] showLeaderboard: ^(HIVEResultAPI *result, HIVEPlayerInfo *playerInfo) { switch ([result getCode]) { case HIVEResultAPICodeSuccess: // Deliver Success with leaderboard display break; case HIVEResultAPICodeAuthV4ConflictPlayer: // account conflict break; default: // other exception situations break; } }]; |
Request to show leaderboard UI
To show leaderboard UI, call showLeaderboard()
method.
Followings are sample codes.
API Reference: hive .ProviderApple.showLeaderboard
1 2 3 4 5 6 7 |
using hive; ProviderApple.showLeaderboard((ResultAPI result) => { if (result.isSuccess()) { // call successful } }); |
API Reference: ProviderApple ::showLeaderboard
1 2 3 4 5 6 7 8 9 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; ProviderApple::showLeaderboard([=](ResultAPI const & result) { if (result.isSuccess()) { // call successful } }); |
API Reference: showLeaderboard(_:)
1 2 3 4 5 6 7 |
import HIVEService ProviderApple.showLeaderboard() { result in if result.isSuccess() { // call successful } } |
API Reference: HIVEProviderApple ::showLeaderboard:
1 2 3 4 5 6 7 |
#import <HIVEService/HIVEService-Swift.h> [HIVEProviderApple showLeaderboard: ^(HIVEResultAPI *result) { if ([result isSuccess]) { // call successful } }]; |
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:
API Reference: SocialV4. sharePhoto
1 2 3 4 5 6 7 8 9 |
using hive; SocialV4.ProviderType providerType = SocialV4.ProviderType.FACEBOOK; SocialV4.sharePhoto(providerType, (ResultAPI result) => { if (result.isSuccess()) { // call successful } }); |
API Reference: SocialV4::sharePhoto
1 2 3 4 5 6 7 8 9 10 11 |
#include <HIVE_SDK_Plugin/HIVE_CPP.h> using namespace std; using namespace hive; SocialV4::ProviderType providerType = SocialV4::ProviderType::FACEBOOK; SocialV4::sharePhoto(providerType, [=](ResultAPI const & result) { if (result.isSuccess()) { // call successful } }); |
API Reference: SocialV4.sharePhoto
1 2 3 4 5 6 7 8 9 10 11 12 |
import com.hive.SocialV4 import com.hive.ResultAPI val providerType = SocialV4.ProviderType.FACEBOOK SocialV4.sharePhoto(providerType, object : SocialV4.SocialV4SharePhotoListener { override fun onShare(result: ResultAPI) { if (result.isSuccess) { // call successful } } }) |
API Reference: SocialV4.INSTANCE. sharePhoto
1 2 3 4 5 6 7 8 9 10 |
import com.hive.SocialV4; import com.hive.ResultAPI; SocialV4.ProviderType providerType = SocialV4.ProviderType.FACEBOOK; SocialV4.INSTANCE.sharePhoto(providerType, result -> { if (result.isSuccess()) { // call successful } }); |
API Reference: SocialV4Interface.sharePhoto
1 2 3 4 5 6 7 8 9 |
import HIVEService let providerType: SocialProviderType = .Facebook SocialV4Interface.sharePhoto(providerType) { result in if result.isSuccess() { // call successful } } |
API Reference: HIVESocialV4 sharePhoto
1 2 3 4 5 6 7 8 9 |
#import <HIVEService/HIVEService-Swift.h> HIVESocialProviderType providerType = HIVESocialProviderTypeFacebook; [HIVESocialV4 sharePhoto: providerType handler: ^(HIVEResultAPI *result) { if ([result isSuccess]) { // call successful } }]; |
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.