Android GCM推送通知未恢复
您可以在下面找到清单文件,它们的GCM推送通知类的配置是否有问题 安卓设备上根本没有收到通知,但苹果设备收到通知Android GCM推送通知未恢复,android,push-notification,google-cloud-messaging,android-notifications,gcmlistenerservice,Android,Push Notification,Google Cloud Messaging,Android Notifications,Gcmlistenerservice,您可以在下面找到清单文件,它们的GCM推送通知类的配置是否有问题 安卓设备上根本没有收到通知,但苹果设备收到通知 package="ac.iec" <uses-permission android:name="android.permission.WAKE_LOCK"/> <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/> <permission and
package="ac.iec"
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
<permission
android:name="ac.iec.permission.C2D_MESSAGE"
android:protectionLevel="signature"/>
<uses-permission android:name="ac.iec.permission.C2D_MESSAGE"/>
<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="ac.iec"/>
</intent-filter>
</receiver>
<service
android:name=".pushnotification.GCMIntentService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
</intent-filter>
</service>
<service
android:name=".pushnotification.MyInstanceIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID"/>
</intent-filter>
</service>
package=“ac.iec”
标签和标签应位于
如果要支持4.4 KitKat之前的设备,请添加以下内容
对接收方的意向筛选器声明的操作:
您错过了一些像这样设置的用户权限
和接收器
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
在清单文件中尝试此代码。
谢谢
使用非常容易使用的FCM。检查此链接
<permission
android:name="your package name.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="your package.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.VIBRATE" />
<!-- GCM Receiver -->
<!-- this package name set your broadcast receiver class -->
<receiver
android:name="package name .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="main package name" />
</intent-filter>
</receiver>