Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/203.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android GCM推送通知未恢复_Android_Push Notification_Google Cloud Messaging_Android Notifications_Gcmlistenerservice - Fatal编程技术网

Android 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

您可以在下面找到清单文件,它们的GCM推送通知类的配置是否有问题

安卓设备上根本没有收到通知,但苹果设备收到通知

 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>