我正在尝试在我的Android应用程序中使用GoogleCloudMessaging(GCM)API进行推送通知。
参考http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/和http://developer.android.com/google/play-services/setup.html#Setup,我尝试在AndroidManifest.xml中设置它们,但是出现了一些错误:
- 无法解析符号'GCMBroadcastReceiver'
- 无法解析符号'GCMIntentService'
这个块位于Application标记中。
<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" />
我正在使用Android Studio并完成了以下步骤:
- 在SDK Manager中安装了Google Play服务并与Gradle同步
- 在build.gradle中加入了
compile 'com.google.android.gms:play-services:4.3.23'
- 在AndroidManifest.xml中加入了
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
请问您能否帮我指出可能遗漏的步骤?感谢您的任何帮助!