简体   繁体   中英

Need help about Apple Push Notification

May I get the exact date and time when the push was received by the device (inside the "didReceiveRemoteNotification" function) after I tap on it. Actually I need to run a timer of 30 secs from the time when Push is received by the device. Please help me out of this problem.

Thanks in advance.

You can receive a callback in the background when the push notification is received. (source)

application:didReceiveRemoteNotification:fetchCompletionHandler: is called when the notification arrives and could be a good place to start your timer.

It seems that there is only 1 catch, if the user force closes your app by swiping it up in the task switcher you won't receive this callback again until they launch your app again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM