问题
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.
- Do any one have better understanding how iPhone behaves once after turned-on. will it do the operation after receiving the silent notification ?
- Does code run anything after phone receiving the silent notification ?
- 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