unnotificationrequest

iOS 10 How to set UNotificationContent threadIdentifier for remote notification

泪湿孤枕 提交于 2019-11-30 22:55:32
TL;DR: What key needs to be set in the APNs notification payload JSON to correspond to the threadIdentifier property of the UNNotificationContent object? e.g. the "category" key corresponds to the categoryIdentifier property. iOS 10 introduces the Notification Content Extension allowing us to present a view controller when a notification is expanded. The view controller that we provide conforms to the UNNotificationContentExtension protocol, that requires us to implement the didReceive(_:) method. The documentation for this method includes the following paragraph: This method may be called

xcode 8 push notification capabilities and entitlements file setting

六眼飞鱼酱① 提交于 2019-11-28 15:57:08
when using xcode 8 doing the push notification setting, unlike xcode 7 , xcode 8 need developer turn on push notifications capabilities switch ( located at TARGETS -> AppName -> Capabilities as following pic ), then it will generate AppName.entitlements file as following //AppName.entitlements <key>aps-environment</key> <string>development</string> but for production version App, if we change the string to //AppName.entitlements <key>aps-environment</key> <string>production</string> then the Capabilities show a warning and it seems no matter which string value specified in aps-environment, we

UNUserNotificationCenter removeAllDeliveredNotifications not working in ios 11.2

我只是一个虾纸丫 提交于 2019-11-28 03:01:39
问题 I have an app with multiple local notifications. When I try to clear all the delivered notifications, I call this removeAllDeliveredNotifications method. It's working fine till ios 11.1 . In ios 11.2 and above, it doesn't work as expected. The notification still remains in the notification center. Could someone please help me out on this. Thanks in advance. 回答1: It is still working for us. I just checked it on iOS 11.2.2. I am using removeDeliveredNotificationsWithIdentifiers: inside

xcode 8 push notification capabilities and entitlements file setting

喜你入骨 提交于 2019-11-27 19:50:58
问题 when using xcode 8 doing the push notification setting, unlike xcode 7 , xcode 8 need developer turn on push notifications capabilities switch ( located at TARGETS -> AppName -> Capabilities as following pic ), then it will generate AppName.entitlements file as following //AppName.entitlements <key>aps-environment</key> <string>development</string> but for production version App, if we change the string to //AppName.entitlements <key>aps-environment</key> <string>production</string> then the

How do I set an NSCalendarUnitMinute repeatInterval on iOS 10 UserNotifications?

此生再无相见时 提交于 2019-11-27 14:47:41
In UILocalNotification we use NSCalendarUnitMinute like repetition ..... but I can't find in iOS 10 UserNotification doc ... How can I use NSCalendarUnitMinute like repetition in iOS 10 UserNotification ? here is the code which will schedule local notification at 8:30 pm and will repeat after every one minute. UILocalNotification* localNotification = [[UILocalNotification alloc] init]; localNotification.fireDate = pickerDate; localNotification.alertBody = self.textField.text; localNotification.timeZone = [NSTimeZone defaultTimeZone]; localNotification.repeatInterval = NSCalendarUnitMinute;

Firebase listener when app is in the background

Deadly 提交于 2019-11-26 23:11:03
问题 I have a Firebase childAdded event listener for the notifications table in my app that I would like to trigger push notifications when the app is in the background. Here is the listener: @objc func observeNotificationsChildAddedBackground() { self.notificationsBackgroundHandler = FIREBASE_REF!.child("notifications/\(Defaults.userUID!)") self.notificationsBackgroundHandler!.queryOrdered(byChild: "date").queryLimited(toLast: 99).observe(.childAdded, with: { snapshot in let newNotificationJSON =