我正在尝试在Android应用(Android Studio)和服务器之间设置Google Cloud Messaging。我按照这里的指示:Set up a GCM Client App on Android。下面的代码是我添加到我的清单文件中的(按照说明)。
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.example.gcm" />
</intent-filter>
</receiver>
<service
android:name="com.example.MyGcmListenerService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<service
android:name="com.example.MyInstanceIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID"/>
</intent-filter>
</service>
这可能是一个简单的问题,但我无法弄清楚com.example.MyGcmListenerService
和com.example.MyInstanceIDListenerService
应该是什么。 Android Studio说找不到这些符号。我没有在网上或在同一说明页面上找到任何这些值的帮助。
这些值是否指的是我需要创建的类?他们是指本地还是远程的东西?我已经安装了所需的SDK组件和云消息传递工具(com.google.android.gms.gcm.GcmReceiver
得到解决)。
很抱歉,如果这很明显。我是Android Studio新手。