uilocalnotification

How can I show a modal view in response to a notification as a new window? (no parent vc)

爷,独闯天下 提交于 2019-12-25 04:17:09
问题 I am having a lot of issues handling my incoming local notifications. My app is using storyboards and has a tabbarcontroller as the rootviewcontroller. Currently I launch the modalviews from 'didReceiveLocalNotification' in the following manner: MedicationReminderViewController *vc = [[MedicationReminderViewController alloc] initWithNibName:@"MedicationReminderViewController" bundle:nil]; vc.notificationInfo = [[NSDictionary alloc] initWithDictionary:notification.userInfo];

How to get accurate location update when application is killed?

别来无恙 提交于 2019-12-25 03:42:24
问题 I'm developing a location based application where user can stored number of locations and when user passed near by that stored location, application will notify user by local notification. I've used following code to achieve this feature: -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { if([[UIApplication sharedApplication] backgroundRefreshStatus] == UIBackgroundRefreshStatusDenied){ [self showAlertWithTitle:@"" andMessage:@"The

Daily UILocalNotification firing more than once

落爺英雄遲暮 提交于 2019-12-25 02:42:50
问题 Hello i am facing a weird kind problem. Actually i want to schedule a daily notification (only once a day) at 8:00 AM. Below is my code for scheduling daily notification. NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:@"HH:mm"]; NSDate *date = [[NSDate alloc] init]; date = [formatter dateFromString:@"08:00"]; UILocalNotification *localNotification = [[UILocalNotification alloc] init]; localNotification.fireDate = date; localNotification.timeZone=

Local notification views to appear in foreground

送分小仙女□ 提交于 2019-12-25 01:41:45
问题 I need local notifications to display in foreground. I read that this is possible in the introduced in iOS10 UserNotifications framework. I try to implement it and get the notifications only in background. In foreground -(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification gets called but the view of the notification is not shown. I would like it to show on both foreground and background, to be tappable and to trigger a method

Can i use NSTimer in background?

隐身守侯 提交于 2019-12-25 01:39:33
问题 I use NSString *urlStr=[NSString stringWithFormat: @"http://xxx.xxx.xxx.xxx:8080/fft/getautodisplaydelay"]; NSURL *url = [NSURL URLWithString:urlStr]; NSURLRequest *request = [[[NSURLRequest alloc] initWithURL:url cachePolicy : NSURLRequestReloadIgnoringCacheData timeoutInterval : 60.0 ] autorelease ]; NSHTTPURLResponse* urlResponse = nil; NSError *error = [[NSError alloc] init]; NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&urlResponse error:&error

How to create ios LocalNotification from array of dates?

蹲街弑〆低调 提交于 2019-12-24 15:31:56
问题 I have an array of dates NSArray *datesArray=[NSArray arrayWithObjects: @"2014-09-14 00:00:00",@"2014-08-21 07:12:36",@"2014-08-14 00:00:00",@"2014-07-14 00:00:00",@"2014-06-14 00:00:00",@"2015-01-01 10:00:00",@"2014-06-14 00:00:00",@"2014-05-14 11:24:15", nil]; now i want to fire one day before the date available in array How to implement it? I was trying this NSDateFormatter *Formatter1 = [[NSDateFormatter alloc] init]; [Formatter1 setLocale:[[NSLocale alloc] initWithLocaleIdentifier

How to navigate to a particular page when user taps on a Local Notification in Xamarin Forms app?

孤街浪徒 提交于 2019-12-24 14:39:31
问题 Hi am developing a Xamarin Forms app. i have implemented local notifications in the app. When the notification has fired, upon clicking the notification it has to navigate to a particular page. In iOS project in Appdelegate.cs i wrote this method public async override void ReceivedLocalNotification(UIApplication application, UILocalNotification notification) which will fire when the user taps on the notification. here i need to navigate to a page. Here i wrote the below line of code App

How to check for Expired UILocalNotifications?

无人久伴 提交于 2019-12-24 11:03:45
问题 Hi can anyone please Explain How to check for Expired UILocalNotifications and cancel the notifications? 回答1: "You can not cancel an expired notification, because it is already expired/fired". When you schedule the notification, if the fireDate is nil or a past date then the notification will be fired immediately. So, schedule the notification for the future dates alone. By the time applicationDidEnterBackground delegate is called all the notifications(which you refer as "Expired

Local banner notification for terminating App

混江龙づ霸主 提交于 2019-12-24 10:53:49
问题 I want to show banner notification when user quits the Application. And on tapping that banner I want my Application to open. func showBanner() { UIApplication.shared.cancelAllLocalNotifications() let notif = UILocalNotification.init() notif.alertBody = "Your Message Here..." localNotif.soundName = UILocalNotificationDefaultSoundName UIApplication.shared.presentLocalNotificationNow(notif) } If I put this code in applicationDidEnterBackground it works fine; But, when I put it in

Keep UNNotificationContent some seconds

╄→гoц情女王★ 提交于 2019-12-24 08:58:51
问题 I'm doing an app in Swift 3 for iOS 10. I have done an UNNotificationContent to simulate a call in my app but it disappears approximately five seconds after being launched. I need to keep it more seconds, while the "calling" is in process. I want to keep the local notification until I call the removeAllPendingNotificationRequests method. Can I do it? This is my code now: let content = UNMutableNotificationContent() content.body = "\(userName) is calling..." content.sound = UNNotificationSound