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

发布于 2024-08-22 03:37:28 字数 46 浏览 6 评论 0原文

您将如何在沙箱中测试 APNS 反馈服务?或者换句话说,如何强制设备参与反馈?

How would you test the APNS feedback service in the sandbox? Or in other words, how do you force a device to be in the feedback?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

兮子 2024-08-29 03:37:28

我认为,从第一轮问题“是的,但是你如何让一些东西出现在那里?”实际上来自这样一个事实:他的测试没有返回任何设备,即,即使他可能已将通知成功发送到在 iPhone/iPad 上,每当他查询 FB 服务器时,都没有返回任何结果,正是因为该应用程序从未从设备中删除,因此服务器很乐意继续回答“找到 0 台设备”(例如),因为没有设备发生故障接收通知。

因此,只有当应用程序从设备中删除时,通知服务器才会提供反馈,即,它最终会回复删除该应用程序的设备列表。

本地服务器的想法也很好。

-Alex

==============

这是苹果建议保留至少一个支持推送的应用程序的一个令人讨厌的副作用。这是我对帖子上发布的文档的建议:

在“反馈服务器的问题”上,值得注意两个场景:
1) 应用程序以生产模式部署到真实设备上;
2)应用程序部署到开发设备、沙箱;

在 1) 中,留下最后一个应用程序的提示(我希望它是正确的)并且应该按描述工作;这里没有问题。

对于 2),必须确保最后一个应用程序也是开发应用程序。或者换句话说,为了让事情变得更简单,有第二个“沙盒应用程序”,它只能按“最后一个人的开关”。

我遇到的问题是,一旦删除我的开发应用程序,沙箱反馈服务器上就不会发生任何事情,即使设备上还有其他支持推送的应用程序,但它们都是生产应用程序,因此,它们会“报告” (如果可以的话)发送给生产反馈服务器。

您的应用程序的第二个副本(沙箱应用程序)是我们想要的,因此它可以保持与沙箱服务器的持久连接......然后,当您删除“测试中的应用程序”时,您的沙箱应用程序将有望报告到沙箱,你可以做你的实际测试。

希望这是正确的......今晚将进行测试。

I think that from the initial round of question "Yes bu how do you get something to show up there? " actually came from the fact that, his tests were not returning any device, i.e., even though he may have had notifications successfully sent to the iPhone/iPad, whenever he queries the FB server, nothing came back, precisely because the app was never removed from the device, therefore the server is just as happy to keep answering "0 devices found" (for example) because no device failed to receive notifications.

So, when the app is removed from the device, only then, the notification server will provide a feedback, i.e., it will finally answer with the list of devices that removed the app.

The idea of the local server is pretty good too.

-Alex

==============

Here is a nasty side effect on Apple's suggestion to keep at least one push enable app. Here's my suggestion to the document posted on the thread:

On the "Issues with the feedback server", it's interesting to note two scenarios:
1) the app is deployed to a real device, on a production mode;
2) the app is deployed to a development device, to the sandbox;

In the 1) the hint to leave one last app (I expect it to be) correct and should work as described; no issues here.

On the 2), one has to make sure the last app is also a development app. Or in other words, to make things simpler, have a second "sandbox app" that is only there to do press the "last man switch".

The issue I'm having is that once I remove my development app, nothing happens on the sandbox feedback server, even though there are other push-enabled apps on the device, however they are all production apps, therefore, they would "report" (if you can say so) to the production feedback server.

The second copy of your app, (a sandbox app) is what we want to have, so it can keep that persistent connection to the sandbox server... then when you remove your "app under test" your sandbox app will hopefully, report to the sandbox and you can do your actual test.

Hoping this is correct ... will test tonite.

梨涡 2024-08-29 03:37:28

如果您从设备中删除应用程序,您所要做的就是尝试向该设备发送一条通知,下次连接到反馈服务器时,它将返回该设备。然后,它不会再次返回该设备,直到您尝试向该设备发送另一个通知。

此外,如果您在与反馈服务器的连接之间向设备发送多个通知,则每个被拒绝的通知都会返回该设备。

If you delete your app from a device, all you have to do is attempt send a single notification to that device and the next time you connect to the feedback server it will return that device. It will then not return the device again until you try to send another notification to that device.

Also, if you send multiple notifications to a device between connections to the feedback server, the device will be returned for every notification that was dennied.

野却迷人 2024-08-29 03:37:28

我意识到对此的答案已被接受,但为了进行第一轮测试而不必不断安装和安装从我的手机/iPod 中删除我的应用程序 我创建了一个非常简单的 ruby​​ 脚本来充当反馈服务器。我将 ruby​​ APNS 类配置为连接到此服务器 (localhost:2196) 并从中读取。我没有初始化 SSL 连接,所以我只是使用基本套接字。下面是我用来“托管”服务器的脚本。

#!/usr/bin/env ruby

require 'socket'

puts 'Opening server'
server = TCPServer.open(2196)

loop {
    puts 'Waiting for connection'
    client = server.accept

    puts 'Connected preparing data'
    data = [1, 2, 3, 4, 0, 32, ['d41c3767074f541814c2207b78f72e538569cb39eae60a8c4a8677549819e174']]
    puts 'Data for delivery: ' + data.inspect

    begin
        data[6] = data[6].pack('H*')
        data = data.pack('c6a*')

        loop {
            puts 'Writing Data'
            client.write data

            puts 'Sleeping for 5 seconds'
            sleep 5
        }
    rescue
    end
    puts 'Done writing, closing'
    client.close
}

该脚本将进行侦听,并在每 5 秒收到连接时向套接字写入一个数据包。如果连接套接字关闭(例如您终止反馈进程),则此脚本将重置并等待新连接。

请记住,不要使用仅标准 ruby​​ 套接字的 SSL 连接。祝你好运!

I realize an answer has been accepted for this but in order to do first round of testing without having to constantly install & remove my application from my phone/ipod I created a VERY simple ruby script to act as the feedback server. I configured my ruby APNS class to connect to this server instead (localhost:2196) and read from it. I did NOT init an SSL connection so I just used the base socket instead. Below is the script I used to 'host' the server.

#!/usr/bin/env ruby

require 'socket'

puts 'Opening server'
server = TCPServer.open(2196)

loop {
    puts 'Waiting for connection'
    client = server.accept

    puts 'Connected preparing data'
    data = [1, 2, 3, 4, 0, 32, ['d41c3767074f541814c2207b78f72e538569cb39eae60a8c4a8677549819e174']]
    puts 'Data for delivery: ' + data.inspect

    begin
        data[6] = data[6].pack('H*')
        data = data.pack('c6a*')

        loop {
            puts 'Writing Data'
            client.write data

            puts 'Sleeping for 5 seconds'
            sleep 5
        }
    rescue
    end
    puts 'Done writing, closing'
    client.close
}

This script will listen and when it receives a connection every 5 seconds write a packet to the socket. If the connecting socket closes (for example you kill your feedback process) then this script resets and waits for a new connection.

Remember, do not use the SSL connection stuff just a standard ruby socket. Good luck!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文