简体   繁体   English

如何测试Apple推送通知反馈服务?

[英]How to test Apple Push Notifications Feedback Service?

What I did as a test is following: 我作为测试做的是:

1 - 1.5 hours after deletion, I am still getting 200 as an answer. 删除后1 - 1.5小时,我仍然得到200作为答案。

Do you maybe know how often does Apple refresh push tokens list and when I can expect to eventually start getting 410 ? 您是否知道Apple刷新推送令牌列表的频率以及何时可以最终开始获得410 And also - is 410 status (and Instant Feedback in general) testable at all while testing the app outside of production environment? 而且 - 在生产环境之外测试应用程序时, 410状态(以及一般的Instant Feedback )是否可测试?

Thanks in advance for any kind of answer. 提前感谢任何答案。

Cheers 干杯

Okay, so from what I have discovered, seems that Instant Feedback service from Apple is working just fine and is able to detect uninstall pretty fast. 好的,从我发现的情况来看,Apple的Instant Feedback服务似乎运行得很好,能够快速检测卸载。 There was a small trick in how to test these things properly with sandbox service. 如何使用沙盒服务正确测试这些东西有一个小技巧。

If you make an app which you are testing locally on your device and your app is the only one installed on your phone from that provisioning profile (vendor) , stuff which I faced as an issue in my question will be encountered. 如果您制作的应用程序在您的设备上进行本地测试,并且您的应用程序是手机中安装的唯一一个应用程序配置文件(供应商) ,则会遇到我在问题中遇到的问题。 For some reason, even if you uninstall the app (which was the only one on the phone installed from your provisioning profile), Apple is always responding with 200. 出于某种原因,即使您卸载了应用程序(这是从配置文件中安装的手机上唯一的应用程序),Apple总是以200响应。

What needs to be done is following: After you install your app which you are testing, create a new dummy app with another bundle ID, but which also coming from your provisioning profile, enable push notifications in it as well and install it on your device. 需要做的是:安装您正在测试的应用程序后,使用另一个软件包ID创建一个新的虚拟应用程序,但也来自您的配置文件,在其中启用推送通知并将其安装在您的设备上。 So now, you have two apps that you made - one which you are developing and testing the Instant Feedback service with and another one which kinda "zombie" app which just sits in there and does nothing. 所以现在,你有两个应用程序 - 一个是你正在开发和测试Instant Feedback服务,另一个是有点“僵尸”应用程序,它只是坐在那里,什么都不做。

After this, uninstall your test app, try to send silent push notification and Apple will respond with status code 410 as expected. 在此之后,卸载您的测试应用程序,尝试发送静默推送通知,Apple将按预期响应status code 410

Dummy way, but for some reason that's how it should be while testing. 虚拟的方式,但由于某种原因,这是测试时应该如何。 Behaviour in production should be as expected and w/o any need to have a dummy (or any other) app from same vendor installed on iOS device. 生产中的行为应该符合预期,并且不需要在iOS设备上安装来自同一供应商的虚拟(或任何其他)应用程序。

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

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