Signing in with Sphere
Get your players signed in to your game with their Sphere Account.
For Android and iOS, do read the additional information on setting up deep links to enable authentication.
In Sphere Kit, getting your players signed in is as easy as calling the SignInWithSphere() method in CoreServices. Your player will be directed to the Sphere website to complete login, and the method completes when the user is authenticated.
await CoreServices.SignInWithSphere();If you would like to sign out, just use the SignOut() method.
await CoreServices.SignOut();Android and iOS setup
On Android and iOS, deep links are a special type of URLs that are used to open your game after a successful sign-in from the browser. You will have to configure the same deep link scheme on Android and iOS. Deep link schemes must be all lowercase and only contain letters.
Registering your deep link scheme
After you have determined your deep link scheme, you will need to register it with Sphere Kit, because Sphere Kit will only redirect your players to the links you allow for security reasons.
Platform-specific setup
Follow these steps in addition to the previous steps to complete your deep link setup.
Android
Enable custom manifest
Under the Android logo, expand the Publishing Settings menu, and check the Custom Main Manifest checkbox. This will allow you to define custom properties for your Android app.

In the Project panel, navigate to the location of the Custom Main Manifest (typically Assets/Plugins/Android/AndroidManifest.xml). Open the file in your code editor.
Add deep link scheme to manifest
Insert the following lines of code for both the UnityPlayerActivity and UnityPlayerGameActivity:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="<YOUR_DEEP_LINK_SCHEME>" />
</intent-filter>Your manifest should now look like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application>
<!--Used when Application Entry is set to Activity, otherwise remove this activity block-->
<activity android:name="com.unity3d.player.UnityPlayerActivity"
android:theme="@style/UnityThemeSelector">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="<YOUR_DEEP_LINK_SCHEME>" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
<!--Used when Application Entry is set to GameActivity, otherwise remove this activity block-->
<activity android:name="com.unity3d.player.UnityPlayerGameActivity"
android:theme="@style/BaseUnityGameActivityTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="<YOUR_DEEP_LINK_SCHEME>" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
<meta-data android:name="android.app.lib_name" android:value="game" />
</activity>
</application>
</manifest>iOS
Last updated






