Add a Plugin to Your Unity Project
To add a Unity package to your project, follow these steps:
- In your Unity development environment, open the Project tab.
- In the left pane of the Project tab, right click the Assets folder, then select Import Package → Custom Package… in the context menu. An Import package… window opens.
- In the Import package… window, navigate to the folder containing the file with the .unity package extension that represents the plugin you wish to import.
- Select the .unitypackage file, and click Open. An Importing package window opens.
- In the Importing package window, review the list of files to be imported and check for conflicts with files already in your project. If a conflict exists, save any local changes somewhere outside of your project.
- Click Import. The package’s files are added to the Assets folder.
- If you saved any local changes outside of your project, use your favorite file merging software to merge the differences between the file(s) you imported and the file(s) you saved.
In-App Purchasing v2 Additional Unity Setup Steps for Android Deployment
If you use the IAP v2 Unity plugin in your app, you must update your manifest to declare the IAP response receiver before creating your Android APK. We included a sample Android Manifest with the IAP response receiver in
If you already have an Android manifest you can add the following under your application XML node:
<receiver android:name="com.amazon.device.iap.ResponseReceiver"> <intent-filter> <action android:name="com.amazon.inapp.purchasing.NOTIFY" android:permission="com.amazon.inapp.purchasing.Permission.NOTIFY" /> </intent-filter> </receiver>
If you don’t already have an Android Manifest, you can rename IapSdkCptServiceSampleAndroidManifest.xml to AndroidManifest.xml. You should update the
android:versionCode attributes of the manifest node.