【问题标题】:Not Receiving push notification in GCM在 GCM 中未收到推送通知
【发布时间】:2013-04-17 12:24:06
【问题描述】:

我在我的应用程序中使用 Gcm 服务推送通知。

我正在使用这个Link

客户端注册后无法接收推送通知。

帮助接收来自服务器的推送。

【问题讨论】:

  • 谁能正确指导我
  • 嗨,我也有同样的问题..你能分享一下它的解决方案吗?

标签: php android push-notification google-cloud-messaging


【解决方案1】:

您需要同时检查 Sender id 和 API id。之后,您必须检查 android Manifest 文件,如下所示

<permission
    android:name="your packagename.permission.C2D_MESSAGE"
    android:protectionLevel="signature" />
<uses-permission android:name="your package name.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"        />
<receiver
        android:name="com.google.android.gcm.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="your package name" />
        </intent-filter>
</receiver>

<service android:name="your package name.GCMIntentService" />

【讨论】:

  • 您从 gcm 服务器获得了设备 gcm id 吗?
  • 能否请您发送除上述链接之外的示例应用程序代码
  • 我也使用了相同的代码。我有同样的问题,但现在为我工作。
  • 是我得到..这是id ...... APA91bFNIUaGxHU6bSYN2sinMEVahl5JBKUomSNBwtkGl5yIm0xmoK_RsTCljQH02rX7e5macYkHfmXKlahcOqsQRksomX-YmCfLHiypE1gO23KTYiZ3VdmMYg4jWU4cSBkJ3l7LL3ROlpY_9LazBjlN7Dba3MfO6CxtRHa9G5PSLzxg5w6l9iA 跨度>
  • 可以请给我一个替代解决方案
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-04-07
  • 1970-01-01
  • 1970-01-01
  • 2015-01-11
  • 2015-07-17
相关资源
最近更新 更多