Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Unity3d integration

Marek Mar 18, 2013 01:29AM PDT

Hi,

Unity package douesn't include README.txt file.
I want to ask, how to provide key and secret inside Untiy3d project.

Regards,
Marek

Up -7 rated Down
Apsalar Support Mar 18, 2013 10:10AM PDT APSALAR Agent

Hi Marek,

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

1)
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.

2)
Import all these files:
Apsalar/Apsalar.prefab
Plugins/Apsalar.cs
\/—-iOS—-\/
Apsalar/PostbuildScripts/mod_pbxproj.py
Apsalar/PostbuildScripts/PostbuildApsalarScript
Apsalar/PostbuildScripts/ApsalarRunner.py
Plugins/iOS/Apsalar.h
Plugins/iOS/ApsalarUnityWrapper.mm
Plugins/libApsalar.a
\/—-Android—-\/
Plugins/Android/AndroidManifest.xml
Plugins/Android/apsalar-4.0.0.jar

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.

4)
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).

5)
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).

6)
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.

License note
-—————

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

Post Your Public Answer

Your name *
Your email address *
Answer *
support@apsalar.com
http://assets1.desk.com/
apsalarinc
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
Invalid characters found
/customer/en/portal/articles/autocomplete