Make sure your application build.gradle file include the applicationId attribute for android defaultConfig. Alternately, you can replace ${applicationId} with you application package (e.g com.yourapppackage.app). Example:
Code Block language groovy theme RDark title build.gradle android { ... defaulfConfig { applicationId "com.yourapppackage.app" ... } }
Add the following lines to your app's AndroidManifest.xml file :Add the following lines to your app's AndroidManifest.xml file (Replace "$APP_ID$" with your application id. e.g: com.appoxee.exampleapp) :
Code Block language xml theme RDarkEclipse firstline 1 title AndroidManifest.xml linenumbers true <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="<app package>"> <!-- Required for using internet (which is a must) --> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- Required for Customreceiving GCM (push) permissionsmessages --> <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> <!-- Custom GCM permissions --> <permission android:name="${applicationId}$APP_ID$.permission.C2D_MESSAGE" android:protectionLevel="signature" /> <uses-permission android:name="${applicationId}$APP_ID$.permission.C2D_MESSAGE" /> <!-- Keeps the <applicationprocessor >from sleeping when handling <!-- Custom received push receivermessages --> <receiver <uses-permission android:name="android.permission.WAKE_LOCK" /> <!-- For vibrating when showing notification --> <uses-permission android:name="comandroid.appoxeepermission.gcm.PlayBroadcastReceiverVIBRATE" /> <application > <meta-data android:permissionname="com.google.android.c2dmgms.permission.SENDversion" > android:value="@integer/google_play_services_version" /> <!-- Receive the actual message Must have for Push Support by Appoxee --> <service android:name="com.appoxee.push.PushOpenIntentService" /> <intent-filter> <!-- GCM push receiver, custom permission --> <receiver <action android:name="com.google.android.c2dmgms.intentgcm.RECEIVEGcmReceiver" /> android:exported="true" <category android:namepermission="${applicationId}com.google.android.c2dm.permission.SEND" /> </intent-filter> <!-- Receive the registration id --> <intent-filter> <action android:name="com.google.android.c2dm.intent.REGISTRATIONRECEIVE" /> <category android:name="${applicationId}$APP_ID$" /> </intent-filter> </receiver> </application> </manifest>
When using eclipse (when manifest merging option is off), please add the following manifest:
Code Block language xml theme Eclipse firstline 1 title Eclipse declarations linenumbers true <manifest > <!-- Required for using internet (which is a must) -->!-- Custom intent service to handle incoming messages --> <service <uses-permission android:name="androidcom.appoxee.permissiongcm.INTERNETAppoxeeGcmListenerService" /> <uses-permission android:nameexported="android.permission.ACCESS_NETWORK_STATEfalse" /> <!-- Required for receiving GCM (push) messages --> <uses-permission <intent-filter> <action android:name="com.google.android.c2dm.permissionintent.RECEIVE" /> <!-- Keeps the processor from sleeping when handling received push messages --> </intent-filter> <uses-permission android:name="android.permission.WAKE_LOCK" /> </service> <!-- For vibrating when showing notificationInstanceId --> <uses-permission android:name="android.permission.VIBRATE" /> <service <application > <meta-data android:name="com.googleappoxee.androidgcm.gms.versionAppoxeeInstanceIDListenerService" android:valueexported="@integer/google_play_services_version" />false"> <intent-filter> <!-- Must have for Push Support by Appoxee --> <service<action android:name="com.google.android.appoxeegms.gcmiid.PlayIntentServiceInstanceID" /> <service android:name="com.appoxee.push.PushOpenIntentService" /> </intent-filter> </service> <!-- Additional Includecapabilities forsupport inbox/more-apps/feedback support(inbox, url deep-linking, feedback, more apps screen) --> <activity android:name ="com.appoxee.activities.InboxMessage"/> <activity android:name="com.appoxee.activities.Inbox" /> <activity android:name="com.appoxee.activities.MoreApps"/> <activity android:name="com.appoxee.activities.Feedback"/> <activity android:name="com.appoxee.activities.FeedbackLandingPage"/> <!-- Needed Forfor geo-fencesgeofence support --> <service android:name="com.appoxee.geo.GeofenceTransitionsIntentService"/> <service android:name="com.appoxee.geo.AppoxeeGeofencingManager" /> <receiver android:enabled="true" android:name=".geo.BootCompleteReceiver"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED" /> </intent-filter> </receiver> </application> </manifest>
...