无法向GCM注册Android 5和5.1上的推送通知
我正在开发一个AIR应用程序,并使用GCM为Android实现推送通知。除了安卓5.0或5.1操作系统之外,该服务在所有设备上都能完美运行。应用程序根本没有收到来自GCM的注册id。 不会引发使用\u令牌\u事件授予的权限\u或拒绝的权限\u事件。我没有从GCM得到任何回应。 有人有这个问题吗?你能帮帮我吗无法向GCM注册Android 5和5.1上的推送通知,android,actionscript-3,push-notification,google-cloud-messaging,Android,Actionscript 3,Push Notification,Google Cloud Messaging,我正在开发一个AIR应用程序,并使用GCM为Android实现推送通知。除了安卓5.0或5.1操作系统之外,该服务在所有设备上都能完美运行。应用程序根本没有收到来自GCM的注册id。 不会引发使用\u令牌\u事件授予的权限\u或拒绝的权限\u事件。我没有从GCM得到任何回应。 有人有这个问题吗?你能帮帮我吗 我正在使用Air本机扩展从Freshplanet github.com/Freshplanet/ANE-Push-Notification发送推送通知 这是我的代码: PushNot
我正在使用Air本机扩展从Freshplanet github.com/Freshplanet/ANE-Push-Notification发送推送通知 这是我的代码:
PushNotification.getInstance().registerForPushNotification(GOOGLE_PROJECT_ID); PushNotification.getInstance().addEventListener(PushNotificationEvent.PERMISSION_REFUSED_EVENT, onPushNotificationTokenFailed);
function onPushNotificationToken(event:PushNotificationEvent):void {
trace("My push token is: " + event.token);
}
function onPushNotificationTokenFailed(event:PushNotificationEvent):void
{
trace(event.errorCode);
trace(event.errorMessage);
trace();
}
和我的清单文件部分:
<permission android:name="MY_APP_ID.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="MY_APP_ID.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<application>
<activity android:name="com.freshplanet.nativeExtensions.NotificationActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<receiver android:name="com.freshplanet.nativeExtensions.C2DMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="MY_APP_ID" />
</intent-filter>
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="MY_APP_ID" />
</intent-filter>
</receiver>
<service android:name="com.freshplanet.nativeExtensions.LocalNotificationService"/>
<receiver android:name="com.freshplanet.nativeExtensions.LocalBroadcastReceiver" android:process=":remote">
</receiver>
提前谢谢 您必须分享您实现的代码:我正在使用Air本机扩展从Freshplanet推送通知谢谢!:你能分享你的android清单文件编辑你的问题而不是写评论吗