1

I'm having issues getting GCM working for my app. My webapp is using django and uses the following app: https://github.com/bogdal/django-gcm

I have the API_KEY set properly, as per instructions on these pages: http://developer.android.com/google/gcm/index.html

I have the following on my manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.testapp"
          android:launchMode="singleInstance"
          android:versionCode="11"
          android:versionName="1.2.0">

    <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="17"/>

    <permission android:name="com.testapp.permission.C2D_MESSAGE" android:protectionLevel="signature"/>

    <!-- GCM requires a Google account. -->
    <uses-permission android:name="android.permission.GET_ACCOUNTS"/>

    <!-- Keeps the processor from sleeping when a message is received. -->
    <uses-permission android:name="android.permission.WAKE_LOCK"/>

    <!-- This app has permission to register with GCM and receive message -->
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
    <uses-permission android:name="com.testapp.permission.C2D_MESSAGE"/>

    <application
            android:icon="@drawable/icon"
            android:label="@string/app_name"
            android:theme="@style/Theme.MyTheme">

        <receiver
                android:name="com.testapp.pager.GCMBroadcastReceiver"
                android:permission="com.google.android.c2dm.permission.SEND">
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE"/>
                <action android:name="com.google.android.c2dm.intent.REGISTRATION"/>

                <category android:name="com.testapp"/>
            </intent-filter>
        </receiver>

        <service android:name=".pager.GCMIntentService" android:enabled="true"/>
        <service android:name=".services.TimeService"/>

    </application>

</manifest>

Can somebody please point me in the right direction? I tried via various SO posts here, as per below:

Android google cloud messaging sample not working

android GCM doesn't work

Community
  • 1
  • 1
KVISH
  • 12,923
  • 17
  • 86
  • 162
  • Try moving your GCMIntentService to be inside your default package. I found that it doesn't work if it isn't located in the default package name. – tim.paetz Aug 22 '13 at 01:10
  • Also, did you write your own GCMBroadcastReceiver? Otherwise it should be: android:name="com.google.android.gcm.GCMBroadcastReceiver" – tim.paetz Aug 22 '13 at 01:17
  • Yes, I have my own broadcast receiver. I put the GCMIntentService in the default package and it WORKED! THanks! If you answer below, I will accept. – KVISH Aug 22 '13 at 01:54

1 Answers1

5

GCMIntentService needs to be inside your default package name. Android can't find the intent service in other package directories.

tim.paetz
  • 2,635
  • 20
  • 23