usernotifications

Check whether user notifications are enabled after UILocalNotification deprecation

旧巷老猫 提交于 2019-12-05 01:29:21
In my app, I want to be able to check if the user has notifications enabled or not. In iOS 10, I did this using a check in the delegate. This check is now deprecated and I want to update it, but I can't figure out what to use in iOS 11. The deprecation warning is as follows: currentUserNotificationSettings' was deprecated in iOS 10.0: Use UserNotifications Framework's -[UNUserNotificationCenter getNotificationSettingsWithCompletionHandler:] and -[UNUserNotificationCenter getNotificationCategoriesWithCompletionHandler:] I've tried to update the code with the help of this warning but I can't

Does UNTimeIntervalNotificationTrigger nextTriggerDate() give the wrong date?

落花浮王杯 提交于 2019-12-04 05:49:41
I’m updating my localnotifications to work with iOS 10 and I’ve run into an issue where I think the nextTrigger function returns NOT “The next date at which the trigger conditions will be met.” but instead returns whatever the current date time is PLUS what you had initially set the UNTimeInvervalNotificationTrigger to. So if you set the trigger to go off in 60 seconds, from the documentation I expect that when I call the nextTriggerDate() that I’d get it to return whatever the date time is when I set the trigger + 60 seconds. So if I set it at 12:00:00, I’d expect that the nextTriggerDate()

Is there still a ~64 local notification limit for the new UserNotifications in iOS 10?

吃可爱长大的小学妹 提交于 2019-12-03 17:33:21
In everything before iOS 9 there was a limit of 64 notifications that could be scheduled at any one time. Is this still true with the new notification system or can I schedule as many in advance as I'd like with the new UNUserNotifications? Yes. I just updated an app of mine that schedules a lot of local notifications and the 64 limit is still in place. 来源: https://stackoverflow.com/questions/40685128/is-there-still-a-64-local-notification-limit-for-the-new-usernotifications-in-i

Is the iOS Local Notification Limit Per Day?

不羁岁月 提交于 2019-12-03 07:36:25
I'm working on an app where I need to send a good amount of notifications to the user daily. Around 5-40 depending on the user. I'm using local notifications to send it, but I know there is a 64 notification limit. Does this mean 64 notifications per day, or in total? It means simultaneously scheduled for future delivery. You can send as many as you want per day, provided they don't overlap. If you add more than 64 requests (under UserNotifications ) or scheduled (under UIApplication / UILocalNotification ), the older ones will be dropped and not delivered. Unfortunately iOS limits the local

How to show local notification when app is foreground

≯℡__Kan透↙ 提交于 2019-12-01 08:50:38
How to show local notification always, even in foreground, using new (from iOS 10) notification framework UserNotifications https://developer.apple.com/reference/usernotifications?language=objc ? #import <UserNotifications/UserNotifications.h> #define SYSTEM_VERSION_GRATERTHAN_OR_EQUALTO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) //interface @interface AppDelegate : UIResponder <UIApplicationDelegate,UNUserNotificationCenterDelegate> @end //implementation -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:

Display image in notification bar with remote notification(Rich media push notification) in iOS 10

自古美人都是妖i 提交于 2019-12-01 06:01:15
I have integrated APNS and want to display image in remote notification like below; I have used below code with reference link ; AppDelegate.h #import <UserNotifications/UserNotifications.h> @interface AppDelegate : UIResponder <UIApplicationDelegate,UNUserNotificationCenterDelegate> AppDelegate.m - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [self registerForRemoteNotification]; UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; UIViewController *vc1 = [storyboard

How to show local notification when app is foreground

空扰寡人 提交于 2019-12-01 04:20:45
问题 How to show local notification always, even in foreground, using new (from iOS 10) notification framework UserNotifications https://developer.apple.com/reference/usernotifications?language=objc ? 回答1: #import <UserNotifications/UserNotifications.h> #define SYSTEM_VERSION_GRATERTHAN_OR_EQUALTO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) //interface @interface AppDelegate : UIResponder <UIApplicationDelegate

Local notifications are not firing in ios10

只愿长相守 提交于 2019-12-01 02:28:34
问题 I'm using UNUserNotificationCenter for ios 10. For testing, I'm setting a local notification for 10 seconds from current time. This is what I tried, - (void)viewDidLoad { [super viewDidLoad]; UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; [center requestAuthorizationWithOptions:(UNAuthorizationOptionBadge | UNAuthorizationOptionSound | UNAuthorizationOptionAlert) completionHandler:^(BOOL granted, NSError * _Nullable error) { if (!error) { NSLog(@

didReceiveLocalNotification not getting called after using UNUserNotificationCenter

可紊 提交于 2019-11-29 06:56:58
I am scheduling local notifications. It works in iOS 9.x but since iOS 10 -(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification doesn't get called when app is running on iOS 10. I know that iOS has introduced new UserNotifications framework but that shouldn't stop working iOS 9 APIs. How can I resolve this issue? As you know, iOS 10 introduced the UNUserNotifications framework to handle both local and remote notifications. Using this framework, you can set a delegate to detect when a notification is presented or tapped.

How can I skip the first occurrence of a repeating UNCalendarNotificationTrigger?

£可爱£侵袭症+ 提交于 2019-11-29 06:11:20
Say today is a Monday and it's 1 PM. I want to schedule a weekly local notification from my iOS app starting today at 2 PM. I'd do this: NSDateComponents *components = [[[NSDateComponents alloc]init]autorelease]; components.weekday = 2; components.hour = 14; components.minute = 0; UNCalendarNotificationTrigger *trigger = [UNCalendarNotificationTrigger triggerWithDateMatchingComponents:components repeats:YES]; //then make a UNMutableNotificationContent and UNNotificationRequest and schedule it But if I want to start it next Monday at 2 PM, how do I skip the first occurrence? To ask the question