【问题标题】:Ticker text not not shown in status bar upon receiving a push message收到推送消息后,状态栏中未显示代码文本
【发布时间】:2014-10-15 15:46:45
【问题描述】:

我将 Parse.com Push 集成到我的 Android 应用程序中(使用适用于 Android 的 Parse SDK 1.7.0)。我按照 Parse.com 上的快速入门中的说明进行操作:https://www.parse.com/apps/quickstart#parse_push/android/existing

首先,我的应用在收到推送通知时崩溃了。 Logcat 指示与通知图标关联的 nullpointexception 错误。 Parse 文档 (https://parse.com/docs/push_guide#receiving/Android) 表明默认情况下,应用程序的启动器图标用于通知。这不知何故不起作用。将以下标签添加到 AndroidManifest 以自定义通知图标后,此崩溃已修复:<meta-data android:name="com.parse.push.notification_icon" android:resource="@drawable/push_icon"/>

现在已成功接收通知,但 Android 设备的状态栏中未显示任何代码文本。 Parse.com 网站上的屏幕截图显示了要发送的推送通知的预览,确实显示了这个股票代码 tekst,所以它应该被显示。收到推送消息后,通知托盘中显示的通知文本也应在通知图标出现时在状态栏中显示几秒钟。就我而言,只出现通知图标。通知文本仅在通知托盘中可见。

我是唯一一个遇到这种行为的人吗?这可能是最近发布的适用于 Android 的 Parse SDK 1.7.0 中的错误吗?

【问题讨论】:

    标签: android push-notification parse-platform


    【解决方案1】:

    Parse Android SDK 1.8.1 最近发布了。您可以扩展 ParsePushBroadcastReceiver 并覆盖

     protected Notification getNotification(Context context, Intent intent)
     protected int getSmallIconId(Context context, Intent intent)
    

    为了在通知中添加代码。最后不要忘记在 AndroidManifest.xml 中列出自定义接收器并添加 Parse 所需的意图操作。检查链接以获取更多信息。

    https://www.parse.com/docs/push_guide#top/Android

    【讨论】:

      猜你喜欢
      • 2023-03-28
      • 1970-01-01
      • 2012-10-27
      • 1970-01-01
      • 1970-01-01
      • 2020-10-21
      • 1970-01-01
      • 2014-12-16
      • 1970-01-01
      相关资源
      最近更新 更多