收到推送通知之前的iOS执行检查 [英] iOS execute check before push notification is received

查看:180
本文介绍了收到推送通知之前的iOS执行检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写信,利用苹果的推送通知服务的应用程序。一些推送通知的基于用户的位置,并且如果用户是从物体一定距离应该仅被递送。我不想站在用户的立场不断地更新到我的服务器,并做检查的方式,第一,因为安全的原因;第二,以减少网络使用。有一个方法,当推通知由设备接收的,做检查通知用户之前,如果不符合标准,则丢弃通知?感谢您的帮助!

I am writing an application that utilizes Apple's Push Notification Service. Some of the push notifications are based on the users location and should only be delivered if the user is a certain distance from an object. I don't want to continually update the user's position to my server and do the check that way, first, because of security reasons and second, to cut down on the network usage. Is there a way, when the push notification is received by the device, to do a check before the user is notified, and if it doesn't meet the criteria, discard the notification? Thanks for the help!

推荐答案

不,可悲的是你不能没有的,当应用程序没有启动该通知的用户点击执行对客户端的任何code。你必须做你检查服务器端据此决定是否或不发送推。

Nope, sadly you can't execute any code on the client side without the user clicking on the notification when the app is not launched. You'll have to do your check server-side to decide wether or not sending a push.

这篇关于收到推送通知之前的iOS执行检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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