IOS 本地推送
2024-10-14 01:21:04
// 1、打开本地推送并设置属性
NSString *str = @"本地推送的信息";
UIApplication *app = [UIApplication sharedApplication];
UILocalNotification *notification = [[UILocalNotification alloc]init];//初始化本地推送
notification.soundName = UILocalNotificationDefaultSoundName;//设置声音
notification.alertBody = str;//设置推送的消息
[app scheduleLocalNotification:notification];//实现本地推送的关键步骤,
[notification release];
[str release];
// 通过上面的方法可以实现推送的效果
2、本地推送的接受方法
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
最新文章
- ORACLE编译失效对象小结
- JavaScript为select添加option,select选项变化时的处理,获取slelect被选中的值
- Oracle RAC inventory.xml损坏后如何修复
- C#窗体->;>;随机四则运算
- tyvj1012 P1012 - 火柴棒等式 ——暴力枚举
- Intellij IDEA 使用Spring-boot-devTools无效解决办法
- 通过Driver获取数据库连接
- zhuan:点滴记录——Ubuntu 14.04中gedit打开文件出现中文乱码问题
- linux进程间通讯-System V IPC 信号量
- c#语言基础编程—string
- perl 对象 通过bless实现
- 基于VMware的eCos环境编译redboot(脚本配置redboot)
- Gradle+Jetty实现静态资源的热部署
- php方法综述除去换行符(PHP_EOL使用变量)
- 虚拟键盘冲击移动端fixed布局的解决方案
- JavaScript中for循环的使用详解
- Python Web框架篇:Django Model基础
- 简单的接口测试类和测试生成报告工具HTMLTestRunner.py
- final关键字总结
- 爬虫(四)requests模块1