Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
269 views
in Technique[技术] by (71.8m points)

ios - Find list of Local Notification the app has already set

My app allows users to set a number of reminders in the future. When the app lauches I want to know what reminders (notifications) have already been set.

Can I read back the notifications I have set or do I need to store in my app (e.g. Core Data or Plist)?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

UIApplication has a property called scheduledLocalNotifications which returns an optional array containing elements of type UILocalNotification.

UIApplication.shared.scheduledLocalNotifications

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...