android - 使用 urbanairship 解决推送通知问题

标签 android push-notification urbanairship.com

当尝试使用 urbanairship 管理应用程序并解决“丢失”推送通知的问题时,我决定编写一个问答来帮助其他开发人员。

客户最常见的提示是,设备上的用户没有收到通知。

有时整个团队都会错过通知,这让我检查客户端应用程序和 urbanairship 仪表板以弄清楚发生了什么。

我在仪表板上发现的最常见错误是:

Received error: Received push with missing authorization on platform

GCM Received error: Received push with invalid authorization on platform GCM

Application does not have permission to send to this device Original Message: Error: mismatched sender ID

我想分享我是如何解决这些问题的。

最佳答案

有几个点会导致错误:

  1. gcmsender id 与项目编号不匹配

在 airshipconfig.properties gcmSender = #########

The Mismatch Sender ID error happens when your Sender ID is incorrect. Ensure you're using your project number, not ID.

enter image description here

  1. 不匹配的 API key

enter image description here

在 urbanairship 仪表板中,转到设置 -> 服务

enter image description here

  1. 包名不匹配

包名称是可选的,如果它们不匹配,虽然这会导致问题并且它可以完全删除 - 包名称,而不是服务!

enter image description here

  1. 无法访问互联网
    我担心的一件事是,缺乏 IT 技能的用户不知道如何使用应用程序,而且我不会忽视互联网访问。
  • If notifications only arrive when connected to WiFi, confirm that Background data is enabled.
  • Background data needs to be enabled on devices. Otherwise pushes can't send from GCM to Android devices until they have active WiFi connection. Pushes are lost after they leave Urban Airship. To enable background data for each version of Android OS, please consult Android documentation. nb*
  1. 在设备上启用通知
  • Notifications are not enabled for the application itself. Notifications are enabled or disabled in the Manage Applications screen. Navigate there for each Android OS by selecting Show Notifications.

enter image description here

enter image description here

引用自 Urbanairship GCM Troubleshooting Guide

nb* 没有确保启用移动数据的合理方法,充其量用户可以在没有 wifi 连接和禁用移动数据时收到警告 Latest update on enabling and disabling mobile data programmatically

额外的:

对于特定设备上的通知问题,我要求客户填写如下表格:

Mobile Type:
Android, iOS, other.
Make:
Example: Sony, Samsung, Apple.
Model
In iOS Example:
Settings -> General -> About -> Model = MF325X/A
In Android Example:
Settings -> About Phone -> -> Model number = E2353
Exact Android or iOS version
In iOS Example:
Settings -> General -> About -> Version = 8.3 (12F70)
In android Example:
Settings -> About Phone -> Android Version

这样一来,操作系统版本之间权限的任何更改、推送通知的管理方式或设备中的已知错误也都可以被探索。

关于android - 使用 urbanairship 解决推送通知问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34920582/

相关文章:

android - 在热点模式下扫描 Android 上的 Wi-Fi 接入点

ios - 如何在出现之前过滤ios推送通知

android - Android中单个设备的多个APP ID的Under Urban Airship

android-studio - 自定义通知布局问题 Android 版本 12

iOS -Urbanairship 生产推送通知无法正常工作

php - Urban Airship 推送 : Response: Got negative response from server: 0

java - 按降序排列日期

android - 使用电话号码和密码的 Firebase Auth

android - SendMail 执行中的应用程序崩溃

swift - 在 ios 设备上使用 firebase 进行丰富的推送通知并使用 FCM 发送推送通知