I am trying to use GoogleCloudMessaging (GCM) API for push notification in my Android app.
Referring to http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/ and http://developer.android.com/google/play-services/setup.html#Setup, I tried to set them up in AndroidManifest.xml but it gave me some error:
- Cannot resolve symbol 'GCMBroadcastReceiver'
- Cannot resolve symbol 'GCMIntentService'
This block is in Application tag
<receiver
android:name="com.google.android.gcm.GCMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<!-- Receives the actual messages. -->
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<!-- Receives the registration id. -->
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.zaqqle.disqover" />
</intent-filter>
</receiver>
<service android:name=".GCMIntentService" />
I am using Android Studio and what I have done
- installed Google Play Services in SDK Manager and synced with Gradle
- included
compile 'com.google.android.gms:play-services:4.3.23'
in build.gradle - included
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
in AndroidManifest.xml
Could you help me point out where I have missed? Thank for any help!