【问题标题】:Android Push notifications not recievingAndroid 推送通知未收到
【发布时间】:2014-10-02 13:21:32
【问题描述】:

这真让我发疯。我是 Android 开发新手,但在 iOS 开发方面经验丰富。我想将 Parse Push 通知实现到 Android 应用程序,一切正常:

  • 设备已在 Parse 注册
  • 发送测试推送消息时,Parse 系统告诉我消息已收到

但是:我的 Android 测试设备上没有收到任何内容。

我已经创建了新的 Parse Apps 和 Android Studio 项目,但没有任何运气。对调试有任何帮助还是这是与 Android Studio 相关的问题?

编辑:我只是按照推送服务快速指南,所以我在清单中添加了一些行并将其添加到我的代码中

 protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_inlog);
       Parse.initialize(this, "xxx", "xxx");
        ParseFacebookUtils.initialize("1515015192073818");
        ParseInstallation.getCurrentInstallation().saveInBackground();

清单:

 <receiver android:name="com.parse.GcmBroadcastReceiver"
            android:permission="com.google.android.c2dm.permission.SEND">
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

                <!--
                  IMPORTANT: Change "com.parse.starter" to match your app's package name.
                -->
                <category android:name="com.pootentieel.andrew.sbpootentieel" />
            </intent-filter>
        </receiver>

【问题讨论】:

  • 你能在这里展示你的 GCMIntentService 类吗..

标签: android push-notification parse-platform


【解决方案1】:

您是否更改了 com.parse.starter 以匹配您的包名称并注册了推送回调接收器活动?

编辑: 转到此链接 github.com/ParsePlatform/PushTutorial 并导入 android 项目并更改密钥。然后运行android项目并发送一个push看看它是否有效。如果它有效,请并排检查两个项目以查看导致问题的原因。如果有帮助,请将此答案标记为正确谢谢:)

【讨论】:

  • 是的,我重新检查了几次快速入门指南。
  • 转到此链接 github.com/ParsePlatform/PushTutorial 并导入 android 项目并更改密钥。然后运行android项目并发送一个push看看它是否有效。如果它有效,请并排检查两个项目以查看导致问题的原因。如果有帮助,请将此答案标记为正确谢谢:)
  • 这不是一个答案,因为它提出了一个问题。应该是评论。
猜你喜欢
  • 1970-01-01
  • 2021-07-03
  • 2015-02-09
  • 2013-10-08
  • 1970-01-01
  • 1970-01-01
  • 2011-08-23
相关资源
最近更新 更多