uilocalnotification

Local notification not firing in iphone

天大地大妈咪最大 提交于 2019-12-08 10:25:14
问题 In my i'm using a action sheet picker view. It is working fine. But I want to fire a local notification when a particular time is set in time picker , it is not firing the local notification . I used this code: enter code here - (void)actionPickerDone { if (nil != self.data) { //send data picker message[self.target performSelector:self.action withObject:[NSNumbernumberWithInt:self.selectedIndex]]; } else { //send date picker message NSCalendar *calendar = [NSCalendar

iPhone UILocalNotification load specific view

笑着哭i 提交于 2019-12-08 07:39:31
问题 I have my local notification working, but when I click View to come back to the app, in the app delegate I am trying to load a specific view, but it wont take. Is this possible or not? It always just comes back to the last view viewed. 回答1: When you tap "View" on the notification, it takes you back to your application, and your application shows whatever it was showing before (if it was backgrounded) or is launched. If you need to show a particular UI in response to the notification, consider

Actions buttons not showing up in local notifications ios 9.2 swift 2

旧时模样 提交于 2019-12-08 06:38:10
问题 I am creating notifications in a loop, relevant code is: func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { appDelegate = self serNotificationType = UIUserNotificationType.Alert.union(UIUserNotificationType.Sound).union(UIUserNotificationType.Badge) let completeAction = UIMutableUserNotificationAction() completeAction.identifier = "COMPLETE" // the unique identifier for this action completeAction.title = "Clear" // title

Local Notifications at a specific time

ⅰ亾dé卋堺 提交于 2019-12-08 06:19:09
问题 I have an app and I need to have the notifications at a specific date and time. I am using the following code to set the date and time. let app = UIApplication.sharedApplication() let notificationSettings = UIUserNotificationSettings(forTypes: [.Alert, .Sound], categories: nil) app.registerUserNotificationSettings(notificationSettings) let calendar = NSCalendar.currentCalendar() let date = NSDateComponents() date.hour = 5 date.minute = 0 date.month = 5 date.day = 21 date.year = 2016 date

UILocalNotification with repeatInterval set NSWeekdayCalendarUnit doesn't trigger weekly

徘徊边缘 提交于 2019-12-08 05:17:23
问题 I'm trying to setup local notification to repeat weekly. Here's my setup: UILocalNotification* localNotification = [[UILocalNotification alloc] init]; ... localNotification.repeatInterval = NSWeekdayCalendarUnit; In console log: localNotif: {fire date = Friday, April 24, 2015 at 12:27:33 PM Singapore Standard Time, time zone = Asia/Singapore (GMT+8) offset 28800, repeat interval = NSWeekdayCalendarUnit, repeat count = UILocalNotificationInfiniteRepeatCount, next fire date = Saturday, April 25

Local Notifications only received once (iBeacons)

 ̄綄美尐妖づ 提交于 2019-12-08 04:50:23
问题 I would like to use the iBeacon Feature in an iPad App to act as a beacon transmitter and an iphone App to receive the beacons. I was able to build both apps accordingly but now I ran into some strange problems: iBeacon Transmitter the iPad app acts as the transmitter of the beacon signal. I implemented an action sheet for selecting a beacon ID I would like to transmit. This is the code for that: #import "BeaconAdvertisingService.h" @import CoreBluetooth; NSString *const kBeaconIdentifier = @

How to properly use the completionHandler when performing a background fetch?

假如想象 提交于 2019-12-08 04:32:02
问题 I'm having a hard time wrapping my head around using completionHandler inside performFetchWithCompletionHandler in the AppDelegate . My App does some background fetching, and during the fetch I would like to invoke a function that is located in one of my viewControllers What is the correct way to use the completionHandler , I'm aware that it is an asynchronous task. I managed to make it work when I wanted to send data to my database, but I'm unable to make it work when I want to invoke a

Local Notification is not displayed in iOS 10

我只是一个虾纸丫 提交于 2019-12-08 03:30:30
问题 i have tried this Code in Appdelegates. @import UserNotifications; UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; [center requestAuthorizationWithOptions:(UNAuthorizationOptionBadge | UNAuthorizationOptionSound | UNAuthorizationOptionAlert) completionHandler:^(BOOL granted, NSError * _Nullable error) { if (!error) { NSLog(@"request authorization succeeded!"); center.delegate = self; } }]; And the local notification is fired by this code -(void

Trigger UILocalNotification for every 14 days (fortnightly) Swift

雨燕双飞 提交于 2019-12-08 03:17:15
问题 The question has been already answered on SO. Here is the reference: iOS Notification Trigger: fortnightly and/or quarterly But what I have tried is so far: var fortnightPart1 = DateComponents() fortnightPart1.weekday = Calendar.current.component(.day, from: Sdate) //(Day..here Sunday) fortnightPart1.weekdayOrdinal = 2 //= n == (nth Day in the month...here 2nd Sunday in every month month) fortnightPart1.hour = Calendar.current.component(.hour, from: Sdate) fortnightPart1.minute = Calendar

Swift - Local Notification doesn't get triggered

ぐ巨炮叔叔 提交于 2019-12-08 02:45:09
问题 I am coding in Swift 3 and I am simply trying to send a notification now without any delays or intervals. However the notification never gets triggered. Here's my code.. The ViewController code import UserNotifications class HomeViewController: UIViewController{ var isGrantedNotificationAccess:Bool = false override func viewDidLoad() { super.viewDidLoad() UNUserNotificationCenter.current().requestAuthorization( options: [.alert,.sound,.badge], completionHandler: { (granted,error) in self