简体   繁体   中英

iOS Push Notification, automatically response to server when received message

My request is to send push notification from Server to iPhone. Everything is working well. Unless I need my iPhone side to be able to feedback to server side when receive notification immediately. If my app is foreground, I can send HTTP request via didReceiveRemoteNotification method. But if my app is in background (click home button to exit), didReceiveRemoteNotification is not called at all! Why??? I'm pulling my hair!

Technically i believe it's realizable. I check the "Whats App", phoneA sends message to phoneB: if phoneB is offline, phoneA only gets a single tick. Later if phoneB get on line, phoneA will get a double ticks. And if phoneB is in background, phoneA also can get a double tick. Which means although phoneB is in background, but it did something.

I'm wondering how Whats App can do when the app is in background.

Thanks a lot! Regards,

Benroo

Please see the screen shot and figure it out you did the same in ur app to get call the didReceiveRemoteNotification while your app in background 在此处输入图片说明

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