nivritgupta
nivritgupta

Reputation: 1966

Scheduler UILocalNotification is not working when app is on the foreground using ios 8

UILocalNotification is not firing When the app is on the foreground mode , but the same code is Working fine when the app is on the background , getting this info from Logs the user info is always Null when the app is on the foreground mode .

fire date = Friday, September 4, 2015 at 6:28:37 PM India Standard Time, time zone = Asia/Kolkata (GMT+5:30) offset 19800, repeat interval = 0, repeat count = UILocalNotificationInfiniteRepeatCount, next fire date = (null), user info = (null)

Please check this Sample code i am use this code in my application example code

Upvotes: 1

Views: 238

Answers (1)

ChintaN -Maddy- Ramani
ChintaN -Maddy- Ramani

Reputation: 5164

Have you set UserInfo while fire notification? In Sample code it is nil .Check i have set userinfo = andInfo:@{@"a":@"ab"}

[[MKLocalNotificationsScheduler sharedInstance] scheduleNotificationOn:[NSDate dateWithTimeIntervalSinceNow:10]
                                                                  text:@"Hey there" 
                                                                action:@"View" 
                                                                 sound:nil 
                                                           launchImage:nil 
                                                               andInfo:@{@"a":@"ab"}];

and in Log i get

Received: {fire date = Friday, September 4, 2015 at 12:25:44 PM India Standard Time, time zone = Asia/Kolkata (GMT+5:30) offset 19800, repeat interval = 0, repeat count = UILocalNotificationInfiniteRepeatCount, next fire date = (null), user info = { a = ab; }}

Upvotes: 1

Related Questions