[英]Can I update a passkit QR automatically 15 mins after the user views it?
If a user downloads a pass, can the QR be refreshed from the service on a short timeline, such as every 15 mins. 如果用户下载通行证,可以在较短的时间线上(例如每15分钟一次)从服务中刷新QR。
Our systems run out of codes very quickly, so the client needs to get a new code every 15 mins. 我们的系统很快就会用完代码,因此客户需要每15分钟获取一次新代码。 That's fine on other media.
在其他媒体上也可以。 Long term this will be solved by changing the length the codes so we don't run out so quickly, in the short term can this be achieved using passkit?
从长远来看,这将通过更改代码的长度来解决,因此我们不会很快用完,短期内可以使用passkit来实现吗?
You can send a push notification requesting that Wallet update your pass whenever you like, as described in the Updating a Pass documentation; 您可以发送推送通知,要求电子钱包随时更新您的通行证,如更新通行证文档中所述; note, though, that if you send too many pushes too close together, Wallet will start rate-limiting your updates to conserve the user's battery and cellular-data usage.
但是请注意,如果您将太多推推推得太近,Wallet将开始限制更新速率,以节省用户的电池和蜂窝数据使用量。 I don't think the rate-limiting rules are documented anywhere (they're mentioned briefly in the 2013 WWDC session ), so you may have to do some experimenting to find out whether that update schedule is viable.
我认为没有任何地方记录限速规则(在2013年WWDC会议中简要提到了这些规则),因此您可能必须做一些试验才能确定更新时间表是否可行。
As to “after the user views it”: no, there's no API for that; 关于“用户查看之后”:不,没有针对此的API; you get one notification when the user first adds your pass to their library, and one when they either delete it or disable automatic updating for it.
当用户首次将您的通行证添加到他们的图书馆时,您会收到一条通知;而当用户删除或禁用自动更新时,您会收到一条通知。 Assuming whatever scanning system you're using is connected to your server, you might consider “the pass with this code was scanned” as an event that should trigger an update push to all passes with that code on them.
假设您正在使用的扫描系统已连接到服务器,则可以将“已扫描此密码的通行证”视为一个事件,该事件应触发对其中包含该密码的所有通行证的更新推送。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.