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" ... } }
Warning When using Google Play Services (as described here), please make sure GCMBroadcastReceiver and GCMIntentService declarations are not present in your manifest (or remove them, if present). Failing to do so will cause devices not to be registered in Appoxee's servers correctly, and push messages will not be sent to them.
Add the following lines to your app's AndroidManifest.xml file :
Code Block language xml theme RDark firstline 1 title AndroidManifest.xml linenumbers true <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="<app package>"> <!-- Custom GCM permissions --> <permission android:name="${applicationId}.permission.C2D_MESSAGE" android:protectionLevel="signature" /> <uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" /> <application > <!-- Custom push receiver --> <receiver android:name="com.appoxee.gcm.PlayBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" > <!-- Receive the actual message --> <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> <category android:name="${applicationId}" /> </intent-filter> <!-- Receive the registration id --> <intent-filter> <action android:name="com.google.android.c2dm.intent.REGISTRATION" /> <category android:name="${applicationId}" /> </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) --> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- Required for receiving GCM (push) messages --> <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> <!-- Keeps the processor from sleeping when handling received push messages --> <uses-permission android:name="android.permission.WAKE_LOCK" /> <!-- For vibrating when showing notification --> <uses-permission android:name="android.permission.VIBRATE" /> <application > <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> <!-- Must have for Push Support by Appoxee --> <service android:name="com.appoxee.gcm.PlayIntentService" /> <service android:name="com.appoxee.push.PushOpenIntentService" /> <!-- Include for inbox/more-apps/feedback support --> <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"/> <!-- For geo-fences 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>
...