Unity package douesn't include README.txt file.
I want to ask, how to provide key and secret inside Untiy3d project.
I just downloaded the latest version and see a file with the following, which includes information about the API key and secret:
Steps to integrate Apsalar in your Unity project
Note: This plugin is includes functionality from
- Apsalar iOS SDK 5.0.0, except for the iapComplete method for manually tracking in-app purchases. The automatic tracking of in-app purchase events is included.
- Apsalar Android SDK 4.0.0
If using other plugins please read the Plugin note before importing this plugin. You can find it on the bottom of this document, just before the license note.
Import all these files:
3a) (iOS build)
At the top of the Apsalar/PostbuildScripts/PostbuildApsalarScript file you see:
my $ApsalarAPIKey = “YourApsalarAPIKey”;
my $ApsalarSecret = “YourApsalarSecret”;
Change YourApsalarAPIKey and YourApsalarSecret, with the APIKey and secret received from Apsalar.
3b) (Android build)
If you are already using a custom AndroidManifest.xml in your Unity project you will have to follow
the instruction Modify the AndroidManifest.xml on http://support.apsalar.com/customer/portal/articles/717507-integrating-the-android-sdk.
Otherwise you will have to adapt the Plugins/AndroidManifest.xml file.
In the folder Plugins/AndroidManifest.xml you will have to adapt two lines:
- On line 4: package=“YourPackage”
- On line 34: android:pathPrefix=“/api/v1/appstore/YourPackage”
In both cases change YourPackage with the package you have created for you app. This should be
the same value as the bundle identifier found in the Player Settings of the Unity project.
Add the prefab called Apsalar to the scene. This prefab can be found in the Apsalar folder.
Set the API key and Secret corresponding to your Apsalar account, using the Inspector tab.
In the Inspector tab of this prefab you will also find three options:
a: You have the option to end the Apsalar Session on going to background.
b: You have the option to restarting the Apsalar session when returning to the foreground.
c: You have the option to enable or disable the auto in-app purchase events. (This is only the initial value, you can enable/disable
this functionality in other scripts).
Add events to your code:
Apsalar is initilized in the Awake() event. This means you can’t send any events in Awake(), use Start instead to send an event on startup.
See the examples in the Apsalar/Example folder on how to send events to Apsalar.
If you are using the example scenes, you will still need to set the Apsalar API key and secret (see steps 3 and 4).
Make sure you create the build by using one of the buttons in the Build Settings window.
The ‘Build and Run’ option in the File menu does not always run the PostprocessBuildPlayer
script which is necessary for a good functionality of the plugin.
The file mod_pbxproj.py is licensed under the Apache License, Version 2.0 (the “License”);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0