How to open an application from background ios

拟墨画扇 提交于 2020-03-06 04:23:46

问题


Is it possible to open the background app into foreground in iOS ?.

I have a scenario like, If suppose my application in background then after sometime I need to up the application into foreground programmatically. Is it possible ?

I don't need to upload the application in Appstore.


回答1:


Yes, it is possible.

You can wake your app up by different kinds of criteria using Push Notifications or Local Notifications. Remotely by using Push Notifications. Locally by calendar alerts, location-based triggers or task alerts.

The users can configure and complete turn of Notifications for your app, in which case it is not possible.

See introduction from Apple here. https://developer.apple.com/notifications/




回答2:


As far as i know iOS does not provide a way to open your app. You can continue long running tasks while in the background opportunistically fetch content remind users to re-open your app if need be and prompt the first two with silent push notifications if need be.




回答3:


you can not launch your app without user action in your ios device because it is restricted by Apple, Now you can use backgroundfetch to open your app in background to do some network call or stuff you want but it is limited to less than a minute mabe upto 30Sec lasts, during that time your network request shoould be completed and all long duration task is scheduled, even during background fect you can update your UI by posting notification on MAIN thread.



来源:https://stackoverflow.com/questions/42020010/how-to-open-an-application-from-background-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!