开发者

Handling Local Notifications when app is in background

开发者 https://www.devze.com 2023-02-28 19:18 出处:网络
My app inserts an entry in Core Data when it receives local notifications. This works fine in the following scenarios.

My app inserts an entry in Core Data when it receives local notifications.

This works fine in the following scenarios.

  1. App is running and visible.
  2. App is in back开发者_运维问答ground or not running at all, but when "View" is tapped on receiving notification.

But if I click on "Close", no entry is made. I've added the insert method in the "didReceiveLocalNotification" and "didFinishLaunchingWithOptions" of the AppDelegate.

Can anybody elaborate on what method will be called if we close a notification?


As far as I understand, tapping "Close" on a local notification will just close the notification and not call the app.

But can't you insert your data when you send the notification?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号