*For ease of integration, we've included Google Play Service and android-support-v4. However, if you already have this in your project, be sure to deselect at time of import.
No need to drag and drop Prefabs into your scene, attach scripts, simply start referencing NativeEssentials.Instance
in your code and we'll add what we need to your scene at runtime.
If you have an existing AndroidManifest in your project (Assets/Plugins/Android/AndroidManifest.xml
), please reference NativeEssential's template manifest at Assets/Editor Default Resources/AndroidManifest_NativeEssentials.xml
and add the required elements...
In the root <manifest/>
node:
<permission android:name="<YOUR_APP_BUNDLE_IDENTIFIER>.permission.C2D_MESSAGE" android:protectionLevel="signature" />
In the main <activity/>
node:
<meta-data android:name="android.app.lib_name" android:value="unity" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
In the <application/>
node:
<receiver android:name="com.signalphire.androidbuddy.notifications.AndroidBuddyReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="<YOUR_APP_BUNDLE_IDENTIFIER>" />
</intent-filter>
</receiver>
Ensure your main <activity/>
has the follow for the name attribute:
<activity android:name="com.signalphire.nativeessentials.NativeEssentialsActivity .../>
Also be sure to replace all occurrences of <YOUR_APP_BUNDLE_IDENTIFIER>
with your games package name. e.g. com.mycompany.mygame
You can manually add required Android permissions, or use NativeBuddy's Manifest Editor to add/remove required permissions by invoking the Window
→ NativeEssentials
→ Configure AndroidManifest
menu command.
Ensure the Bundle Identifier
value in your Android Player Settings have been set correctly.
Use NativeEssentials' Manifest Editor to create your manifest. The editor can be invoked by the Window
→ NativeEssentials
→ Configure AndroidManifest
menu command
Click on Create AndroidManifest
and enable the required Android permissions
As an advanced option, you can also extend AndroidBuddyActivity
- in this case replace public const string ROOT_ACTIVITY_NAME = "com.signalphire.androidbuddy.NativeEssentialsActivity";
in NativeEssentials.cs, with the package and name of your activity.