通过城市飞艇没有出现设备推送通知存折 [英] Push notifications to Passbook via Urban Airship not appearing on device

查看:167
本文介绍了通过城市飞艇没有出现设备推送通知存折的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现这个职位是在获得成立真正有用的,但我还没有看到推送通知,通过在其上安装了合格的iPhone来了。

I've found this post to be really helpful in getting set up, but I have yet to see the push notification come through on the iPhone on which the pass is installed.

<一个href=\"http://stackoverflow.com/questions/12623623/passkit-push-notifications-not-working-with-urban-airship/12650387#12650387\">Passkit-push-notification-not-working-with-urban-airship

设置我的城市飞艇的网站推​​到苹果的开发服务器应用程序。我安装我的电话一通,并运行,我在上面的帖子发现下面的命令:

I set up my app on urban airship's site pushing to Apple's development servers. I installed a pass on my phone and run the following commands which I found in the above post:

airship = urbanairship.Airship(_UrbanAirshipPassbookKey, _UrbanAirshipPassbookMasterSecret) 
airship.push({'aps': {'alert': 'Go.'}}, device_tokens=tokens)

然后我看到这个推在iPhone控制台窗口的X $ C $的c确认。

I then see confirmation of this push in the iPhone console window in Xcode.

Received push for topic pass.xxx.xxx: {
    ...
    aps =  {
        banner = "Hello";
    };

和iPhone然后将其更新标签背面与通型ID和设备库ID到Web的服务。在这一点上的Web服务是应该发送回变通行证的列表。但是,我反而看到以下错误信息:

and the iPhone then sends its update tag back along with its pass type ID and Device Library ID to the web service. At this point the web service is supposed to send back a list of changed passes. However, I instead see the following error message:

<Warning>: Web service error for pass.mypasstype.id (http://192.168.30.209:8000): Response to 'What changed?' request included 1 serial numbers but the lastUpdated tag (2013-02-11T17:25:25) remained the same.

有谁知道为什么发生这种情况?我需要在通实际修改字段来获取推送通知显示在设备上?

Does anyone know why this is happening? Do I need to actually modify a field in the pass to get the push notification to appear on the device?

推荐答案

简短的回答你的问题是肯定的,你需要修改通场获得一个推送通知显示。这是因为,不像应用推,一个存折推有效载荷并不决定该通知的内容。

The short answer to your question is yes, you do need to modify a field in the pass to get a push notification to show. This is because, unlike with app pushes, a Passbook push payload does not determine the content of the notification.

一个存折推送消息的目的是,以提醒该web服务具有更新的内容的新的通行装置。警报文本由新通的内容来确定。在推载荷的所有内容将被忽略。苹果提醒<一个href=\"https://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/PassKit_PG/Chapters/Updating.html#//apple_ref/doc/uid/TP40012195-CH5-SW1\"相对=nofollow>一个空的JSON字典推送通知。

The purpose of a Passbook push message is to alert the device that the web service has a new pass with updated content. The alert text is determined solely by the new pass contents. Any content in the push payload is ignored. Apple advise a push notification with an empty JSON dictionary.

在推送到,它会触发以下链:

Once a push is sent, it triggers the following chain:


  • 设备收到 passTypeIdentifier lastUpadted 标记推和查询Web服务

  • Web服务提供连续的列表中的所有与 passTypeIdentifier 因为 LASTUPDATED 标记已更改<通行证/ LI>
  • 设备接收串行(S),并请求Web服务发送新.pkpass束为每个新通

  • Web服务发送新.pkpass包

  • 设备接收.pkpass包并检查其对旧通行证更改

  • 如果下列条件都满足时,设备将显示在 changeMes​​sage 键提供的通知:

    • 的值更改

    • changeMes​​sage 包含%@字符串

    • Device receives push and queries web service with the passTypeIdentifier and lastUpadted tag
    • Web service provides a list of serials for all passes with the passTypeIdentifier that have changed since the lastUpdated tag
    • Device receives serial(s) and requests the web service to send the new .pkpass bundle for each new pass
    • Web service send the new .pkpass bundle
    • Device receives the .pkpass bundle and checks it against the old pass for changes
    • If the following criteria are met, the device will display the notification provided in the changeMessage key:
      • The value has changed
      • The changeMessage contains the %@ string

      标识的%@字符串不是present,通将显示一个通知更改传递。如果没有 changeMes​​sage 键present为更改后的值,没有消息将显示。

      Id the %@ string is not present, the pass will show a notification Pass Changed. If no changeMessage key is present for the changed value, no message will show.

      这篇关于通过城市飞艇没有出现设备推送通知存折的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆