unusernotificationcenter

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

NotificationCenter obersever not called in swift 4

此生再无相见时 提交于 2019-12-24 08:55:10
问题 i am trying to post notification NotificationCenter from appdelegate and receive notification in another view but notification not received. Post notification :- func xmppStream(_ sender: XMPPStream, didReceive message: XMPPMessage) { print("did receive message isss-->\(message)") NotificationCenter.default.post(name: Notification.Name("MessageReceived"), object: message) } Received Notification in viewdidload :- NotificationCenter.default.addObserver(self, selector: #selector(self

iOS 11 new notification center removes all delivered notifications after user make any action with one of them

偶尔善良 提交于 2019-12-24 02:26:45
问题 I have an issue on iOS 11. All delivered notification automatically removing from notification tray after I select any action for one of them. This happens before my code start handling action. In iOS 10 everything is ok, all delivered notifications stay in delivered and disappear only notification where I proceed some action. My app schedule reminders with custom action, 2 buttons Activate and Stop. User can receive many of them in one day, but its very important to keep already delivered

Action Button Not Appearing in Notification iOS 10

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 07:04:11
问题 I am using local push notifications in my app. when added action button for the notification in iOS 10, it doesn't appear below the notification. the notification is appearing, but the action button is missing at the bottom of the notification. The appdelegate code is given below. import UIKit import CoreData import UserNotifications @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication,

User Notification request always come with default action identifier

一个人想着一个人 提交于 2019-12-21 11:54:15
问题 I am using the UNUserNotificationCenterDelegate (> ios 10) and one of the delegate methods where I can check the response from the notification has always actionIdentifier equal "com.apple.UNNotificationDefaultActionIdentifier" no matter what I do. The "response.notification.request.content.categoryIdentifier" comes right, with the expected value, but the request.actionIdentifier never comes correctly ("mycustomactionidentifier" in the example below). Does anyone know if I'm missing something

iOS 11 crashing with bundleProxy != nil error on using UNUserNotificationCenter

£可爱£侵袭症+ 提交于 2019-12-21 04:03:04
问题 The following line of code is where our app has suddenly started to crash on iOS 11 / 11.0.1 / 11.0.2 / 11.1.1 / 11.2.2 for some users: UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; We've got this in didFinishLaunchingWithOptions . The crash report says: Fatal Exception: NSInternalInconsistencyException Invalid parameter not satisfying: bundleProxy != nil Fatal Exception: NSInternalInconsistencyException 0 CoreFoundation 0x1869b3d38 _

Multiple UNUserNotifications not firing

老子叫甜甜 提交于 2019-12-17 16:51:00
问题 I'm setting multiple UNUsernotifications as below, - (void)viewDidLoad { [super viewDidLoad]; notifCount = 0; UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; [center requestAuthorizationWithOptions:(UNAuthorizationOptionBadge | UNAuthorizationOptionSound | UNAuthorizationOptionAlert) completionHandler:^(BOOL granted, NSError * _Nullable error) { if (!error) { NSLog(@"request succeeded!"); [self set10Notif]; } }]; } In the set10Notif method, I'm setting

Multiple UNUserNotifications not firing

好久不见. 提交于 2019-12-17 16:50:03
问题 I'm setting multiple UNUsernotifications as below, - (void)viewDidLoad { [super viewDidLoad]; notifCount = 0; UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; [center requestAuthorizationWithOptions:(UNAuthorizationOptionBadge | UNAuthorizationOptionSound | UNAuthorizationOptionAlert) completionHandler:^(BOOL granted, NSError * _Nullable error) { if (!error) { NSLog(@"request succeeded!"); [self set10Notif]; } }]; } In the set10Notif method, I'm setting

UNUserNotificationCenter Swift - Local Notification Not Firing in specific cases

假如想象 提交于 2019-12-12 10:02:52
问题 I'm facing issue while using Local Notifications in application. I'm scheduling local notification with custom content & custom action category. It's scheduling & firing in iOS 11, but not in iOS 10. As per documentation, it should be worked in iOS 10 as well. Please review my code, and let me why it's not working in such specific cases. Code is below. AppDelegate.swift func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey:

iOS open page from local notification

狂风中的少年 提交于 2019-12-12 05:39:14
问题 I currently have a local notification firing from a specified time in OS10 using the UNUserNotificationCenter . I'm trying to figure out how to open a specific page in my app when the user taps on the local notification. Anyone how to do this I'm really new to programming for iOS in C# and I'm sure its not that uncommon of a thing to do. 回答1: UNDelegate _delegate; public override UIWindow Window { get; set; } public override bool FinishedLaunching(UIApplication application, NSDictionary