简体   繁体   中英

Push Notification With Background Task (ios)

I implemented Remote Push notifications for my app. I can receive Push notifications just fine.

However my goal is to execute some code automatically when Remote Notification Arrives on my iphone.

For example i have a Google Nest mini Speaker. I would like to send Push notifications to my iPhone, which should trigger a "Audio Playback" on my Google mini speaker.

I got it to work, only if user TAPS the Notification Banner, however I would like to automate it, whether user taps the notification banner or not.

I have the same exact logic working on Android, however for ios i am having issues when it comes to handle push notification.

So Question is, it it even possible to receive a remove notification and trigger something automatically?

You can try to follow this guide: https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/pushing_background_updates_to_your_app

It is called Background Push Notification or Slient Push Notification.

But System will limit the number of times that your app can run in background to execute some codes.

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