-
Notifications
You must be signed in to change notification settings - Fork 0
iOS InApp Unity Documentation

NOTES:
- The code samples in this document can be copy/pasted into your source code
- This SDK is designed to work across all Android devices. It supports all versions but activates only on Android OS 2.1 and above. In lower versions, the SDK will not be active.
- Please notice that steps 1-3 are mandatory
- If you have any questions, contact us via support@startapp.com
##Step 1, Adding the SDK files to your Unity project
In order to add StartApp SDK to your application please follow the following steps:
1. Unzip all files to a temporary folder
2. From the unzipped assets folder, select all files and folders and drag them to your project window
##Step 2, Updating your Manifest File
Update the manifest.xml (in the Android folders) as follow:
1. Under the 'manifest' node place your <YOUR_PACKAGE_NAME> within package attribute.
2. Under the 'AppWall' and 'List3DActivity' activities replace <YOUR_PACKAGE_NAME> with the name of your package as declared in your manifest.
<activity android:name="com.startapp.android.publish.list3d.List3DActivity"
android:taskAffinity="<YOUR_PACKAGE_NAME>.StartApp"
android:theme="@android:style/Theme" />
<activity android:name="com.startapp.android.publish.AppWallActivity"
android:configChanges="orientation|keyboardHidden"
android:taskAffinity="<YOUR_PACKAGE_NAME>.StartApp"
android:theme="@android:style/Theme.Translucent" />
##Step 3, Updating your StartApp data file
Update the StartAppData.txt (in the Assets/Resources folders) as follows:
1. Add your StartApp Developer ID after "developerId="
2. Add your StartApp Application ID after "applicationId="
You can find your Developer and Application IDs in the developers’ portal.
After logging in, your developer ID will be at the top right-hand corner of the page:

To find your application ID, click on the
at the top of the main screen and then choose the relevant ID from your app list:

##Step 4, Adding an exit ad to your project
Use the StartAppBackPlugin in components where you would like the user to press 'back' to exit the application. The plugin will show an ad and then exit the application.
1. Drag the StartAppBackPlugin.cs to the components which you would like pressing 'back' to exit the application
2. Do not implement exit on the 'back' in this components
NOTE: there is no need to implement exit on the 'back' button in these components as the plugin will exit the application after showing the ad.
##Step 5, Showing Banners
To add a banner to your application add the following code in the appropriate place:
1. Import the SDK namespace
using StartApp;2. Display the banner
void Start () {
StartAppWrapper.addBanner(
StartAppWrapper.BannerType.AUTOMATIC,
StartAppWrapper.BannerPosition.BOTTOM);
}Parameters
BannerPosition - position of the banner. Can receive one of the following:
StartAppWrapper.BannerPosition.BOTTOM
StartAppWrapper.BannerPosition.TOP
If you wish to add a specific type of banner, please refer to the Advanced Usage.
##Step 6, Showing Interstitial Ads
You can choose to show the interstitial ad in several locations within your application. This could be upon entering (onCreate), between stages, while waiting for an action and more.
We do, however, recommend showing the ad upon exiting the application by using the ‘Back’ button or the ‘Home’ button, as explained in step 4 above.
Add the following code to the appropriate place or places within your activities in which you would like to show the ad:
1. Import the sdk namespace
using StartApp;2. Load the ad
void Start () {
StartAppWrapper.loadAd();
}3. Show the ad
StartAppWrapper.showAd();
StartAppWrapper.loadAd();
