简体   繁体   中英

(Swift 3) I need to send a notification to the user to open the app at a specific time. Better to use a local or push notification?

I have 2 options here that I've found, the LocalNotification, or the UNMutableNotification (through the UserNotifications). Which of the 2 would suit my need of sending a notification every day at some set time? Any help is greatly appreciated.

Assuming you are working with iOS 10+, you should schedule your notifications using a UNNotificationRequest , using a UNTimeIntervalNotificationTrigger to set the fire dates

Per the Apple documentation , UILocalNotification was deprecated in iOS 10

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