Android c2dm消息未收到
当我尝试在设备中接收消息时,我遇到了问题,一切正常,但是当我尝试接收消息时什么也没有发生,我得到:
id=0:1319039498507602%b50b7d2400000031
来自 https://android.apis.google.com/c2dm/send
这意味着消息已发送,不是吗?
但我无法在设备中接收它。 清单:-
> <?xml version="1.0" encoding="utf-8"?> <manifest
> xmlns:android="http://schemas.android.com/apk/res/android"
> package="com.cgt.pushn"
> android:versionCode="1"
> android:versionName="1.0">
> <permission android:name="com.cgt.pushn.permission.C2D_MESSAGE" android:protectionLevel="signature" /> <uses-permission
> android:name="com.cgt.pushn.permission.C2D_MESSAGE" />
>
> <!-- This app has permission to register and receive message -->
> <uses-permission
> android:name="com.google.android.c2dm.permission.RECEIVE" />
>
> <!-- Send the registration id to the server --> <uses-permission
> android:name="android.permission.INTERNET" />
> <uses-permission android:name="android.permission.WAKE_LOCK"/> <uses-permission android:name="android.permission.GET_ACCOUNTS" />
> <uses-permission android:name="android.permission.USE_CREDENTIALS" />
> <uses-permission android:name="android.permission.READ_PHONE_STATE" />
>
> <application android:icon="@drawable/icon" android:label="@string/app_name" >
> <activity android:name=".pushtest"
> android:label="@string/app_name">
> <intent-filter>
> <action android:name="android.intent.action.MAIN" />
> <category android:name="android.intent.category.LAUNCHER"/>
> </intent-filter>
> </activity> <!-- android:name="com.google.android.c2dm.C2DMBroadcastReceiver" -->
>
> <receiver android:name=".BroadcastReciever"
> android:permission="com.google.android.c2dm.permission.SEND"> <!--
> -->
> <intent-filter>
> <action android:name="com.google.android.c2dm.intent.RECEIVE"/>
> <category android:name="com.cgt.pushn" />
> </intent-filter>
> <!-- Receive the registration id -->
> <intent-filter>
> <action android:name="com.google.android.c2dm.intent.REGISTRATION"/>
> <category android:name="com.cgt.pushn"/>
> </intent-filter>
> </receiver>
> </application>
> <uses-sdk android:minSdkVersion="8" />
>
> </manifest>
有人可以帮助我吗?
I'm facing a problem when I try to receive message in my device, everything works fine but when I try to receive it nothing come, I'm getting:
id=0:1319039498507602%b50b7d2400000031
from https://android.apis.google.com/c2dm/send
it mean that message sent, isn't?
but i can't receive it in device.
MANIFEST:-
> <?xml version="1.0" encoding="utf-8"?> <manifest
> xmlns:android="http://schemas.android.com/apk/res/android"
> package="com.cgt.pushn"
> android:versionCode="1"
> android:versionName="1.0">
> <permission android:name="com.cgt.pushn.permission.C2D_MESSAGE" android:protectionLevel="signature" /> <uses-permission
> android:name="com.cgt.pushn.permission.C2D_MESSAGE" />
>
> <!-- This app has permission to register and receive message -->
> <uses-permission
> android:name="com.google.android.c2dm.permission.RECEIVE" />
>
> <!-- Send the registration id to the server --> <uses-permission
> android:name="android.permission.INTERNET" />
> <uses-permission android:name="android.permission.WAKE_LOCK"/> <uses-permission android:name="android.permission.GET_ACCOUNTS" />
> <uses-permission android:name="android.permission.USE_CREDENTIALS" />
> <uses-permission android:name="android.permission.READ_PHONE_STATE" />
>
> <application android:icon="@drawable/icon" android:label="@string/app_name" >
> <activity android:name=".pushtest"
> android:label="@string/app_name">
> <intent-filter>
> <action android:name="android.intent.action.MAIN" />
> <category android:name="android.intent.category.LAUNCHER"/>
> </intent-filter>
> </activity> <!-- android:name="com.google.android.c2dm.C2DMBroadcastReceiver" -->
>
> <receiver android:name=".BroadcastReciever"
> android:permission="com.google.android.c2dm.permission.SEND"> <!--
> -->
> <intent-filter>
> <action android:name="com.google.android.c2dm.intent.RECEIVE"/>
> <category android:name="com.cgt.pushn" />
> </intent-filter>
> <!-- Receive the registration id -->
> <intent-filter>
> <action android:name="com.google.android.c2dm.intent.REGISTRATION"/>
> <category android:name="com.cgt.pushn"/>
> </intent-filter>
> </receiver>
> </application>
> <uses-sdk android:minSdkVersion="8" />
>
> </manifest>
someone could help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您忘记写服务标签。在您的接收者标签上方输入以下标签。
请参阅下面的链接
you forgot to write service tag. Enter below tag above your receiver tag.
see below link