Tag: 通知

强制语言更改通知iOS

我的应用程序正在本地化,我们关注方言。 (即在西class牙语和西class牙语在peurto rico之间的区别)我注意到,只是改变区域不会推动通知到应用程序,将触发本地化..只有改变语言触发这个通知。 在我的应用程序委托,我想检查,如果该区域已经改变了我的applicationDidBecomeActive方法,如果它有,我想推iOS通知,如果语言已经改变了..这是可能的吗?

震动和声音LocalNotifications

如何为LocalNotifaction添加振动和声音 码: UILocalNotification *notification = [[UILocalNotification alloc]init]; NSDate *firedate = settime.date; [notification setFireDate:firedate]; [notification setAlertBody:@"הלכה יומית"]; [notification setAlertAction:@"הלכה"]; [[UIApplication sharedApplication]scheduleLocalNotification:notification];

如何响应UNUserNotification的点击?

我在iOS 10中使用了新的UNUserNotification框架。我可以看到如何添加动作button,但是当用户点击通知本身时该如何响应呢? 就我而言,这将是一个带有一些文字的图像。 默认行为是应用程序打开。 我可以使用自定义代码来检测我的应用程序是否由于UNUserNotification而被打开,理想情况下是使用关于通知的标识符信息? 这些工作,如果我的应用程序在后台运行或closures? UNUserNotification文档build议设置UNUserNotification的代表,但我认为这只适用于应用程序正在运行。

如何禁用iOS远程通知的默认通知警报视图?

在我的应用中,我启用了远程通知, if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"10.0")){ UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; center.delegate = self; [center requestAuthorizationWithOptions:(UNAuthorizationOptionSound | UNAuthorizationOptionBadge) completionHandler:^(BOOL granted, NSError * _Nullable error){ if( !error ){ [[UIApplication sharedApplication] registerForRemoteNotifications]; } }]; }else{ UIUserNotificationType userNotificationTypes = (UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound); UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:userNotificationTypes categories:nil]; [application registerUserNotificationSettings:settings]; [application registerForRemoteNotifications]; } 我实现了如下的委托方法, – (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error{ NSLog(@"Failed!!"); […]

预定的本地通知在切换为closures时切换为开启时间段

我每天早上八点半在下午一点钟通知你。 当“通知”在“设置”应用中closures一周时,通知不会显示,这是完美的。 问题是,在那个星期之后, 通知在“设置”应用程序中重新开启 ,前一周的所有通知都会显示出来 。 我想知道如何让通知不“build立”这么说。 是否有一行代码我错过了在这里“清除”? ViewController.m : – (void)viewDidLoad { [super viewDidLoad]; UILocalNotification* localNotification = [[UILocalNotification alloc] init]; NSCalendar *cal = [NSCalendar currentCalendar]; NSDateComponents *comp = [cal components:(NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay | NSCalendarUnitHour | NSCalendarUnitMinute) fromDate:[NSDate date]]; comp.hour = 20; // 19 = 7PM 20=8pm comp.minute = 30; // 7:45 PM […]

后台提取执行时间与iOS 10 UserNotifications没有用户交互

在iOS 10之前的推送通知API中,我可以轻松地运行由收到推送通知触发的后台作业。 刚刚收到 – 用户根本不需要进行交互。 现在看来,为了使用这个新框架来执行相同的后台工作,用户必须以某种方式与通知进行交互。 当这个新的框架只是在客户端设备接收到某个推送而不是用户交互的情况下运行后台作业的时候,有没有办法呢? 我可以在推送的用户信息字典中传递一个方法吗?

我们如何检测iOS 7上的控制中心?

当控制中心出现在iOS 7上时,我遇到了问题。基本上,控制中心出现时会激发applicationDidEnterBackground。 但是在我的方法中,我想检测是否只是控制中心打开或通知中心,因为我会在该状态下对待applicationDidEnterBackground不同。 任何帮助,将不胜感激。

iOS:使用VOiP通知而不是“正常”notif

我们只是添加VOiPfunction到我们的应用程序(消息应用程序),现在我们将使用VOiP( PushKit框架 )。 谁能告诉我,如果我们只能使用通知(VOIP通知)? 甚至对于文本消息的意义,例如(不是为了打电话)? 我谈论苹果Appstore指南,他们可以拒绝应用程序或阻止通知,如果他们发现我们使用该通知通知用户关于其他事情,然后VOIP电话?

iOS 10 UserNotifications不适用于已迁移的应用程序

我有一个使用Swift 2.3构build的应用程序,并在iOS 9.3上进行了testing,使用本地通知,并且工作正常。 当我更新我的应用程序到Swift 3和新的UserNotifications框架应用程序停止显示通知。 我testing了一个新的项目,我的代码工作得很好。 相同的代码。 经过大量的testing发现问题,似乎导致问题的一件事是我的包标识符。 新项目有一个不同的,当我改变到原来的标识符停止工作。 改回任何其他的标识符,它又开始工作。 我无法更改包标识符,因为该应用程序已经发布在应用程序商店。 有没有人看过类似的东西? 任何人都可以帮我吗? 谢谢你们!

如何更新IOS推送通知中的徽章号码?

我最近使用亚马逊SNS推送我的IOS应用程序的通知。 它运作良好,我遇到的唯一问题是当我收到通知,徽章号码将不会更新,这里是我如何实现: 首先我按照这里的例子https://aws.amazon.com/articles/9156883257507082这里是教程中的示例代码。 – (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { application.applicationIconBadgeNumber = 0; NSString *msg = [NSString stringWithFormat:@"%@", userInfo]; NSLog(@"%@",msg); [[Constants universalAlertsWithTitle:@"Push Notification Received" andMessage:msg] show]; } -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { //Register for push notification application.applicationIconBadgeNumber = 0; [[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)]; if(launchOptions!=nil){ NSString *msg = [NSString stringWithFormat:@"%@", launchOptions]; NSLog(@"%@",msg); [[Constants […]