简体   繁体   中英

iOS - network connection when app is in background when notification arrives

I have a requirement where I need to make a network connection when a new push notification arrives while app is in background.

Is it possible to do so? Some hook?

Right now, I make the connection when notification is swiped to open the app. However, it delays when the user sees the new data.

Any other way of getting data faster from server triggered by a new push notification?

Implement didReceiveRemoteNotification... method if you are using apns or didReceiveIncomingPushWithPayload if you are using pushkit.

You need to enabled the remote notifications background mode or voip for pushkit.

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