任何知道苹果应用程序是否收到推送通知的选项? [英] any option to know if apple app get the push notification?

查看:31
本文介绍了任何知道苹果应用程序是否收到推送通知的选项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我构建了接收推送通知的 xcode 应用程序,主要问题是推送通知对我来说非常重要.所以我想检查推送通知是否已发送到安装了应用程序的设备,我知道如果 iphone 没有互联网连接/3G,推送通知不会到达设备.

I build xcode app that get push notification, the main problem is that the push notification is very critical for me. so I want to check if the push notification is delivered to the device with the app installed, I understand that if the iphone dosn't have internet connecction / 3G the push notification is not getting to the device.

如何检查设备是否收到通知?如何检查 APNS 是否成功发送推送通知?

how can I check if the device get the notification or not? how can I check if the APNS successful to deliver the push notification?

如果推送通知没有发送到设备,我想发送短信,所以我考虑了在推送通知打开时获取通知事件的想法,并将请求发送到我的服务器,这样我就可以知道推送通知是否成功发送.主要问题是用户每次收到通知时都需要打开应用程序,而在晚上这是一个问题.所以这个选项不适合我.

I want to send sms if the push notification is not deliver to the device so I think about the idea to get the notification event when it's open by the push notification, and to send request to my server so i can know if the push notification is successful deliver or not. the main problem is that the user need to open the app every time he get the notification and in the night it's a problem. so this option is not good for me.

我检查了反馈服务器推送通知,但我没有找到任何可以获取推送通知是否已发送的信息

I check the feedback server push notification but i don't find any info that I can get if the push notification is delivered or not

有什么想法吗??

推荐答案

在 iOS7 中你有一个名为应用程序:didReceiveRemoteNotification:fetchCompletionHandler:您可能可以将其用于您的任务.来自 Apple 的文档:

With iOS7 you have a new method called application:didReceiveRemoteNotification:fetchCompletionHandler: which you probably could use for your task. From Apple's Docs:

如果您的应用支持远程通知后台模式,请实现此方法....当推送通知到达时,系统向用户显示通知并在后台启动应用程序(如果需要),以便它可以调用此方法.用这个下载与推送通知相关的任何数据的方法.当你的方法完成后,调用处理程序参数中的块.

Implement this method if your app supports the remote-notification background mode. ... When a push notification arrives, the system displays the notification to the user and launches the app in the background (if needed) so that it can call this method. Use this method to download any data related to the push notification. When your method is done, call the block in the handler parameter.

与 application:didReceiveRemoteNotification: 方法不同,该方法仅在您的应用程序正在运行,无论您的应用程序处于何种状态,系统都会调用此方法.

Unlike the application:didReceiveRemoteNotification: method, which is called only when your app is running, the system calls this method regardless of the state of your app.

这篇关于任何知道苹果应用程序是否收到推送通知的选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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