如何使用新的 APNS HTTP2 进程让 Apple Pass 更新工作? [英] How to get Apple Pass updates to work using the new APNS HTTP2 process?

查看:24
本文介绍了如何使用新的 APNS HTTP2 进程让 Apple Pass 更新工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到了 Apple 的成功回复,但我的 Pass 从未更新.Pass 甚至从不调用我的服务器来获取任何更新等.

这个文档甚至没有提到 Apple Passes.https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_notification_server_requests/sending/a>

这似乎是旧文档.https://developer.apple.com/library/存档/文档/UserExperience/Conceptual/PassKit_PG/Updating.html

我使用此处找到的方法创建了我的 p8 文件(密钥).https://docs.microsoft.com/en-us/azure/notification-hubs/notification-hubs-push-notification-http2-token-authentication

这是我的标题.

request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("bearer", GetJwtToken());request.Headers.TryAddWithoutValidation(":method", "POST");request.Headers.TryAddWithoutValidation(":path", path);request.Headers.Add("apns-id", Guid.NewGuid().ToString("D"));request.Headers.Add(apns-topic", settings.AppBundleIdentifier);request.Headers.Add(apns-expiration", apnsExpiration.ToString());request.Headers.Add(apns-priority", apnsPriority.ToString());request.Headers.Add("apns-push-type", isBackground ? "background" : "alert");//需要 iOS 13

我正在使用 Pass Type Id 证书创建 Pass.这是一个 PFX 文件.旧的 Pass 更新方法使用 PFX 文件.

解决方案

我为此工作了几天.我终于找到了答案.您必须使用通行证类型 ID (pass.com.yourdomain.coupon) 作为apns-topic",而不是使用应用程序标识符 (com.yourdomain.appname).不要在apns-topic"中包含您的团队 ID.答案在文档中没有.通过阅读这篇文章,我能够弄清楚事情.https://github.com/node-apn/node-apn/issues/第469话

I'm getting a success response back from Apple, but my Pass never updates. The Pass never even calls my Server to get any updates etc.

This documentation doesn't even mention Apple Passes. https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns/

This seems like the old documentation. https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/PassKit_PG/Updating.html

I created my p8 file (Key) using the method found here. https://docs.microsoft.com/en-us/azure/notification-hubs/notification-hubs-push-notification-http2-token-authentication

Here are my headers.

request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("bearer", GetJwtToken());
request.Headers.TryAddWithoutValidation(":method", "POST");
request.Headers.TryAddWithoutValidation(":path", path);
request.Headers.Add("apns-id", Guid.NewGuid().ToString("D"));
request.Headers.Add("apns-topic", settings.AppBundleIdentifier);
request.Headers.Add("apns-expiration", apnsExpiration.ToString());
request.Headers.Add("apns-priority", apnsPriority.ToString());
request.Headers.Add("apns-push-type", isBackground ? "background" : "alert"); // for iOS 13 required

I'm creating the Passes using the Pass Type Id Certificate. It's a PFX file. The old Pass update method used the PFX file.

解决方案

I worked on this for a couple of days. I finally found the answer. Instead of using the App Indentifier (com.yourdomain.appname), you have to use the Pass Type ID (pass.com.yourdomain.coupon) as the "apns-topic". Do not include your Team Id in the "apns-topic". The answer is no where in the documentation. I was able to figure things out by reading this post. https://github.com/node-apn/node-apn/issues/469

这篇关于如何使用新的 APNS HTTP2 进程让 Apple Pass 更新工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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