首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏滕先生的博客

    iOS 本地推送概念步骤:属性:点击通知跳到指定控制器界面快捷回复功能(iOS 8以后可用), category 属性的使用方法

    创建一个view,仿造系统消息通知的样式向下出现,点击后回到根控制器再进行跳转(注意压栈) 点击通知会打开该通知的app 不管程序打开还是关闭,推送都能如期发出 ---- 步骤: 1.创建本地通知对象 UILocalNotification *localNotifi = [UILocalNotification new]; 2、设置属性,参照下面 3、调度本地通知 (将本地通知加入本地通知调度池,iOS 7 到这一步完毕,不需要授权) [ 没必要去处理通知(如跳转到指定页面) if (launchOptions[UIApplicationLaunchOptionsLocalNotificationKey]) { UILocalNotification *)notification{ [self changeLocalNotifi:notification]; } - (void)changeLocalNotifi:(UILocalNotification UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forLocalNotification:(UILocalNotification

    3.4K60发布于 2018-05-18
  • 来自专栏全栈程序员必看

    iOS8新特性之基于地理位置的消息通知UILocalNotification

    iOS8中更新和公开了非常多接口,当中有一项本地消息通知UILocalNotification,大家肯定都不陌生。 可是在iOS8中对其进行了优化和改进。 self startShowingLocationNotifications]; } } 回调方法里注冊通知 - (void)startShowingNotifications { UILocalNotification *locNotification = [[UILocalNotification alloc] init]; %s",__func__); } - (void)application:(UIApplication *)application didReceiveLocalNotification: (UILocalNotification if (region) { [self tellFriendsUserArrivedAtRegion:region]; } } 注: 查看官方文档,了解很多其它UILocalNotification

    67240编辑于 2022-07-10
  • 来自专栏哈雷彗星撞地球

    iOS 推送(本地推送)推送介绍总结使用步骤其他常用API

    didFinishLaunchingWithOptions:],而是调用: - (void)application:(UIApplication *)application didReceiveLocalNotification:(nonnull UILocalNotification 但是依然会调用下面这个方法: - (void)application:(UIApplication *)application didReceiveLocalNotification:(nonnull UILocalNotification } 然后,在控制器中创建一个本地通知,并调用: UILocalNotification *localNotice = [UILocalNotification new]; localNotice.fireDate } 另一个方法中的处理: - (void)application:(UIApplication *)application didReceiveLocalNotification:(nonnull UILocalNotification

    2.2K40发布于 2018-08-22
  • 来自专栏一“技”之长

    iOS中使用本地通知为你的APP添加提示用户功能

    iOS中使用本地通知为你的APP添加提示用户功能 首先,我们先要明白一个概念,这里的本地通知是UILocalNotification类,和系统的NSNotificationCenter通知中心是完全不同的概念 二、了解UILocalNotification类 顾名思义,这个类就是我们需要使用的本地通知类,先来看它的几个属性: 设置系统发送通知的时间(如果是过去的时间或者0,则会立刻发起通知) @property         [self addLocalNotification];     } } 添加本地通知的方法: -(void)addLocalNotification{     //定义本地通知对象     UILocalNotification  *notification=[[UILocalNotification alloc]init];     //设置调用时间     notification.fireDate=[NSDate dateWithTimeIntervalSinceNow 1、如果我们的APP在前台或者后台进入前台时 -(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification

    1.3K10发布于 2018-08-15
  • 来自专栏代码小技巧分享分析

    iOS 设置每天下午4点推送本地通知

    UILocalNotification *notification=[[UILocalNotification alloc] init]; if (notification!

    1.2K20发布于 2021-10-29
  • 来自专栏码客

    Swift中的if let guard

    三种不同的实现方式 只用if-else func application(application: UIApplication, didReceiveLocalNotification notification: UILocalNotification } } if-let组合 func application(application: UIApplication, didReceiveLocalNotification notification: UILocalNotification guard-let-else func application(application: UIApplication, didReceiveLocalNotification notification: UILocalNotification

    2.3K30发布于 2019-10-22
  • 来自专栏好派笔记

    iOS 闹钟功能实现+本地通知+音频播放

            NSArray * array=[app scheduledLocalNotifications];         NSLog(@"%ld",array.count);         for (UILocalNotification (int)(self.lt)%60];     _label.text=str; } #pragma mark - 增加本地通知 - (void) addLocalNotification{     UILocalNotification * notification=[[UILocalNotification alloc] init];     notification.fireDate=[NSDate dateWithTimeIntervalSinceNow addLocalNotification]; } -(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification

    2K40发布于 2021-10-29
  • 来自专栏雨尘分享

    iOS 点击推送消息跳转指定界面 —总结篇app 在后台app被杀死

    notification */ -(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification NSError * _Nullable error) { }]; }else{ NSDictionary * userInfo = payData; UILocalNotification *notification=[[UILocalNotification alloc] init]; if (notification! =nil) { UILocalNotification *notification = [[UILocalNotification alloc] 点击本地推送触发的方法 iOS 10之前 -(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification

    9.1K71发布于 2018-06-07
  • 来自专栏王大锤

    iOS 本地通知

    进入后台响应的方法 - (void)applicationDidEnterBackground:(UIApplication *)application { // 初始化本地通知对象 UILocalNotification *notification = [[UILocalNotification alloc] init]; if (notification) { // 设置通知的提醒时间 didReceiveRemoteNotification:(NSDictionary *)userInfo{ application.applicationIconBadgeNumber=0; //取消通知 for (UILocalNotification

    1.5K50发布于 2018-05-17
  • 来自专栏iOS开发攻城狮的集散地

    iOS 前台重启应用和清除角标的问题已知条件:问题描述:调试分析解决问题

    . // UILocalNotification *clearEpisodeNotification = [[UILocalNotification alloc] init]; // clearEpisodeNotification.applicationIconBadgeNumber 这个清除角标的操作只在进入后台时执行才会造成:应用在前台时被强制关闭后,立马重启应用后会调用方法applicationWillEnterForeground:,正常情况下重新启动应用时并不执行它; UILocalNotification *clearEpisodeNotification = [[UILocalNotification alloc] init]; clearEpisodeNotification.applicationIconBadgeNumber

    2.2K30发布于 2019-01-03
  • 来自专栏一“技”之长

    AppleWatch开发入门七——watchOS中通知的应用

    NotificationController中重写下面两个方法 //这个用于本地推送 override func didReceiveLocalNotification(localNotification: UILocalNotification , forLocalNotification localNotification: UILocalNotification) {              } 专注技术,热爱生活,交流技术,也做朋友。

    2K20发布于 2018-08-15
  • 来自专栏宜达数字

    iOS开发--本地通知与远程通知

    applicationIconBadgeNumber; // 设置通知一些额外数据 @property(nonatomic,copy) NSDictionary *userInfo; 如何发出本地通知: // 1.创建本地通知 UILocalNotification *localNote = [[UILocalNotification alloc] init]; // 2.设置本地通知的内容 // 2.1.设置通知发出的时间 localNote.fireDate 杀死状态下的,界面跳转并不会执行下面的方法- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification 应用程序在进入前台,或者在前台的时候都会执行该方法 */ - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification

    4K20发布于 2020-06-02
  • 来自专栏月亮与二进制

    iOS 10前后两种本地通知

    iOS 10以上系统的实现 iOS 10以前使用UILocalNotification,iOS开始支持一个新的类库UNUserNotificationCenter,都给了他特定的前缀UN了,可见重视程度 添加通知我们也放到一个方法中: /** iOS 10以前版本添加本地通知 */ - (void)addLocalNotificationForOldVersion { //定义本地通知对象 UILocalNotification *notification = [[UILocalNotification alloc] init]; //设置调用时间 notification.timeZone = [NSTimeZone notification 通知 */ - (void)application:(UIApplication *)application didReceiveLocalNotification:(nonnull UILocalNotification

    1.7K20发布于 2021-11-23
  • 来自专栏杨飞@益术

    iPhone开发小技巧

    UIGraphicsEndImageContext(); UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil); 5、本地通知(类似于push通知)按home键到后台 十秒后触发: UILocalNotification *notification=[[UILocalNotification alloc] init];  if (notification!

    1.2K30发布于 2019-02-21
  • 来自专栏码客

    iOS 点击通知打开对应页面

    bundle ID (NSString); 3) 若由本地通知启动,则UIApplicationLaunchOptionsLocalNotificationKey对应的是为启动应用程序的的本地通知对象(UILocalNotification objectForKey:UIApplicationLaunchOptionsSourceApplicationKey]; if(bundleId){ } //由本地通知启动 UILocalNotification

    3.4K20发布于 2019-10-22
  • 来自专栏码客

    iOS 闹钟的实现

    attendanceType:签到或签退 */ func addNotifation(date:NSDate,attendanceType:String){ let notification = UILocalNotification 点击消息后进入app后调用 代码 func application(application: UIApplication, didReceiveLocalNotification notification: UILocalNotification

    4K31发布于 2019-10-22
  • 来自专栏向治洪

    ios入门之消息推送

    NSDictionary *userInfo; // 设置通知的额外的数据 */ - (IBAction)addLocalNote:(id)sender { // 创建一个本地通知 UILocalNotification *localNote = [[UILocalNotification alloc] init]; // 设置本地通知的一些属性(通知发出的时间/通知的内容) // 设置通知发出的时间 代码实现 - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification

    2.6K60发布于 2018-02-06
  • 来自专栏進无尽的文章

    推送-iOS本地通知

    ]; return YES; } -(void)registerLocalNotificationInOldWay:(NSInteger)alertTime { UILocalNotification *notification = [[UILocalNotification alloc] init]; // 设置触发通知的时间 NSDate *fireDate = [NSDate 在前台收到本地通知都会触发这个方法 - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification

    8.8K30发布于 2018-09-12
  • 来自专栏腾讯技术工程官方号的专栏

    iOS 推送手机消息背后的技术

    ,UIApplication提供了presentLocalNotificationNow和scheduleLocalNotification两个本地消息推送的方法,分别表示立即推送和按照固定日期推送,UILocalNotification 相关代码如下: UILocalNotification *notification = [[UILocalNotification alloc] init]; notification.fireDate 本地消息推送回调方法,ios(4.0, 10.0) -(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification

    4.9K103发布于 2020-10-27
  • 来自专栏hrscy

    iOS集成极光推送iOS集成极光推送

    application.applicationIconBadgeNumber = 0; } - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification

    3.7K21发布于 2018-08-30
领券