简体   繁体   English

使用Urbanairship故障排除推送通知

[英]Trouble shooting push notifications with urbanairship

When trying to manage an app using urbanairship and trouble shooting 'missing' push notifications, I decided to write a Q&A to assist other developers. 当尝试使用城市飞艇管理应用程序并解决“丢失”的推送通知时,我决定编写问答以协助其他开发人员。

The most common complaint from clients is, a user on a device didn't get a notification. 客户最常抱怨的是,设备上的用户未收到通知。

Occasionally a whole group will miss out on notifications causing me to examine the client app and urbanairship dashboard to figure out what has happened. 有时候,整个团队都会错过通知,导致我检查客户端应用程序和Urbanairship仪表板以了解发生了什么。

The most common errors I have found on the dashboard have been: 我在仪表板上发现的最常见错误是:

Received error: Received push with missing authorization on platform 收到的错误:在平台上收到缺少授权的推送

GCM Received error: Received push with invalid authorization on platform GCM GCM收到错误:在平台GCM上收到无效授权的推送

Application does not have permission to send to this device Original Message: Error: mismatched sender ID 应用程序无权发送到此设备原始消息:错误:发件人ID不匹配

And I wanted to share how I have resolved these. 我想分享我如何解决这些问题。

There are several points that can cause errors: 有几点可能导致错误:

  1. Mismatched gcmsender ids with project number gcmsender ID与项目编号不匹配

In the airshipconfig.properties gcmSender = ######### 在airshipconfig.properties中, gcmSender = #########

The Mismatch Sender ID error happens when your Sender ID is incorrect. 如果您的发件人ID不正确,则会发生不匹配的发件人 ID错误。 Ensure you're using your project number, not ID. 确保您使用的是项目编号,而不是ID。

在此处输入图片说明

  1. Mismatched API keys API密钥不匹配

在此处输入图片说明

In the urbanairship dashboard, go to settings -> services 在Urbanairship仪表板中,转到设置->服务

在此处输入图片说明

  1. Mismatched package names 软件包名称不匹配

The package name is optional, if they do not match though this will cause a problem and it can be removed altogether - the package name, not the service! 软件包名称是可选的,如果它们不匹配,尽管这将导致问题,并且可以将其完全删除-软件包名称,而不是服务!

在此处输入图片说明

  1. Lack of internet access 缺乏上网
    One thing I am wary of is users with lacking IT skills knowing how to use an app, and I don't overlook internet access. 我要警惕的一件事是缺乏IT技能的用户知道如何使用应用程序,而且我也不会忽略互联网访问。
  • If notifications only arrive when connected to WiFi, confirm that Background data is enabled. 如果只有在连接WiFi时通知才到达,请确认已启用后台数据。
  • Background data needs to be enabled on devices. 需要在设备上启用后台数据。 Otherwise pushes can't send from GCM to Android devices until they have active WiFi connection. 否则,只有具有有效的WiFi连接后,推送才能从GCM发送到Android设备。 Pushes are lost after they leave Urban Airship. 推杆离开市区飞艇后丢失。 To enable background data for each version of Android OS, please consult Android documentation. 要为每个版本的Android OS启用后台数据,请查阅Android文档。 nb* NB *
  1. Enabling notifications on the device 在设备上启用通知
  • 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. 通过选择显示通知,为每个Android操作系统导航至该位置。

在此处输入图片说明

在此处输入图片说明

The quotes are taken from Urbanairship GCM Troubleshooting Guide 报价摘自Urbanairship GCM故障排除指南

nb* There are no reasonable ways of ensuring mobile data is enabled, at best the user can receive a warning when there is no wifi connection and mobile data is disable Latest update on enabling and disabling mobile data programmatically nb *没有确保移动数据已启用的合理方法,当没有wifi连接且移动数据被禁用时,用户充其量只能收到一条警告, 有关以编程方式启用和禁用移动数据的最新更新

As an extra: 另外:

For notification problems on a specific device I ask the client to complete a form like so: 对于特定设备上的通知问题,我要求客户端填写如下表格:

Mobile Type: 手机类型:
Android, iOS, other. Android,iOS等。
Make: 使:
Example: Sony, Samsung, Apple. 例如:索尼,三星,苹果。
Model 模型
In iOS Example: 在iOS示例中:
Settings -> General -> About -> Model = MF325X/A 设置->常规->关于->型号= MF325X / A
In Android Example: 在Android示例中:
Settings -> About Phone -> -> Model number = E2353 设置->关于手机->->型号= E2353
Exact Android or iOS version 确切的Android或iOS版本
In iOS Example: 在iOS示例中:
Settings -> General -> About -> Version = 8.3 (12F70) 设置->常规->关于->版本= 8.3(12F70)
In android Example: 在android示例中:
Settings -> About Phone -> Android Version 设置->关于手机-> Android版本

That way any changes in permissions between OS versions, or the way push notifications are managed, or known bugs in a device can be explored also. 这样一来,操作系统版本之间权限的任何更改,推送通知的管理方式或设备中的已知错误都可以被发现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM