是否可以在iOS上发送SILENT LOCAL通知 [英] Is it possible to send SILENT LOCAL notification on iOS

查看:104
本文介绍了是否可以在iOS上发送SILENT LOCAL通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序在服务器发出的静默远程通知中从暂停模式唤醒,完全是我想要的.该服务器发送带有" content-available :1"的推送通知,即可完成工作.

My app wakes up from suspended mode on silent remote notification from a server, exactly as I want. This server sends a push notification with "content-available:1", which does the job.

现在,我想在没有服务器帮助的情况下执行此操作,因此,我希望将来一次从应用程序发送本地静默通知( (例如15分钟后),但找不到设置"content-available:1"的方法.因此,我最终收到了本地通知,该通知不会唤醒我的应用程序,就像远程通知一样.

Now I want to do this without the help of a server and so I want to send silent local notifications (from the app) at a time in the future (like after 15 min.), but can't find a way to set "content-available:1". So I end up getting local notification that doesn't wake up my app, as I can with remote notification.

我已经搜索了信息,所能找到的只是交互式通知的示例,以及如何设置标题,正文,警报和触发器(基于位置,日期等).但是,关于如何设置内容可用属性的事情却没有.

I've searched for information and all I can find are examples of interactive notifications and how to set title, body, alert and triggers (based on location, date and so on.). But nothing about how to set content-available property.

那么,可以设置本地通知可用的内容吗?

So, is possible to set content-available for local notifications?

推荐答案

在没有用户干预的情况下,不可能.没有Android的AlarmManager解决方案可将应用程序从iOS的挂起模式唤醒.在iOS中,除了从远程推送通知(如果外部应用程序定期发送推送通知)之外,没有办法从已暂停模式定期唤醒应用程序.

It's just not possible without user intervention. There is no Android's AlarmManager kind of solution to wake up the app from suspended mode in iOS. In iOS there's no way to periodically wake up app from suspended mode, except from remote push notification (if an extern application sends a push notification periodically).

这篇关于是否可以在iOS上发送SILENT LOCAL通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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