Mobile integration¶
Plarium ID integration example
Development¶
To develop:
1. Open Unity3d, select the 3D template and create a new project.
2. Select the iOS/Android platform.
3. Import the PlariumPlayUnitySDK.unitypackage file into Unity3d.
4. Create an empty MonoBehaviour script named TestPPAuth.
5. Add the following code to the TestPPAuth file:
6. Open Unity3d and create a canvas with a button and text.
7. Drag the TestPPAuth file to the created canvas game object.
8. Set TestPPAuth.LoginWithPlarium as a button click handler.
9. Add the following code to the TestPPAuth.OnLoginCompleted handler:
10. Activate deep links:
- Open Project Settings.
- Navigate to Supported URL schemes.
- Add oauthtest as custom schema.
11. Use ServerToServer API to associate redirect URL with your app:
For Android, you will also need to create AndroidManifest.xml in the Assets/Plugins/Android folder with the following code:
Note
Make sure to replace oauthtest
in android:scheme
with the schema name and redirect
in android:host
with the hostname.
Testing¶
To test the connection between Plarium Play SDK and iOS/Android:
1. Build the XCode project and run it.
Note
Make sure to add the current scene to the list of scenes in the build.
2. Test the connection.
3. Make sure the link opens properly.
Note
In the output, you will get a user token to validate using Configurator API and get a safe userId
.