未收到Android c2dm消息

未收到Android c2dm消息,android,push-notification,android-c2dm,Android,Push Notification,Android C2dm,当我尝试在我的设备中接收消息时,我遇到了一个问题,一切正常,但当我尝试接收消息时,什么也没有出现,我得到: id=0:1319039498507602%b50b7d2400000031 从 这意味着信息被发送了,不是吗 但我无法在设备中接收它。 舱单:- > <?xml version="1.0" encoding="utf-8"?> <manifest > xmlns:android="http://schemas.android.com/apk/res/andr

当我尝试在我的设备中接收消息时,我遇到了一个问题,一切正常,但当我尝试接收消息时,什么也没有出现,我得到:

id=0:1319039498507602%b50b7d2400000031

这意味着信息被发送了,不是吗

但我无法在设备中接收它。 舱单:-

> <?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>
>xmlns:android=”http://schemas.android.com/apk/res/android"
>package=“com.cgt.pushn”
>android:versionCode=“1”
>android:versionName=“1.0”>
>android:name=“com.cgt.pushn.permission.C2D\u消息”/>
> 
>       
>android:name=“com.google.android.c2dm.permission.RECEIVE”/>
> 
>android:name=“android.permission.INTERNET”/>
>        
> 
> 
> 
>     
>android:label=“@string/app_name”>
>             
>                 
>                 
>             
>          
> 
>android:permission=“com.google.android.c2dm.permission.SEND”>
>           
>               
>               
>           
>           
>           
>               
>               
>           
>       
>     
>     
> 
> 

有人能帮我吗?

你忘了写服务标签。在接收器标签上方输入以下标签

    <!-- In order to use the c2dm library, an
     application must declare a class with the name C2DMReceiver, in its 
     own package, extending com.google.android.c2dm.C2DMBaseReceiver -->

     <service android:name=".C2DMReceiver"/> 
      http://www.johnhawthorn.com/2010/12/android-cloud-to-device-messaging-1/