How do silent notification behave once phone got Power off & On

主宰稳场 提交于 2019-12-13 16:30:30

问题


I have a application which tries to grab location of user using silent notification at certain situations. I am able to send silent notification to the phones and able to run the background fetch and get the location back to web-service.

Comparing the user payload of silent notification I am doing some operation(Initiating the location manager & grabbing location from delegate method) while app is in background/suspended mode. This works in all other cases expect one case which is iPhone Power off & turn back ON case.

Problem: According to my observations, Once after phone got power off & turned back ON, The silent notification is being received by iPhones(I confirm this because I hear the sound because I gave sound in payload) but the operation is not happening.

  1. Do any one have better understanding how iPhone behaves once after turned-on. will it do the operation after receiving the silent notification ?
  2. Does code run anything after phone receiving the silent notification ?
  3. I also tried to save the value in UserDefaults before phone getting power off and the value becomes nil after we turned on the power.

Your help, greatly appreciated..!

来源:https://stackoverflow.com/questions/45376819/how-do-silent-notification-behave-once-phone-got-power-off-on

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