开源 企业版 高校版 私有云 模力方舟 AI 队友
代码拉取完成,页面将自动刷新
捐赠
捐赠前请先登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
1 Star 0 Fork 4K

tianze/O2OA

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
已有帐号? 立即登录
文件
develop
分支 (6)
标签 (42)
develop
wrdp
master
release
dependabot/maven/o2server/org.quartz-scheduler-quartz-2.3.2
dependabot/npm_and_yarn/o2server/mixin-deep-1.3.2
6.0.2
6.0.1
6.0.0
5.4.1
wrdp-5.4.0
5.4.0
5.3.5
5.3.4
5.3.3
5.3.2
5.3.1
5.3.0
wrdp-5.3.0
wrdp-5.2.6
wrdp-5.2.5
wrdp-5.2.4
wrdp-5.2.3
5.2.5
wrdp-5.2
5.2.4
develop
分支 (6)
标签 (42)
develop
wrdp
master
release
dependabot/maven/o2server/org.quartz-scheduler-quartz-2.3.2
dependabot/npm_and_yarn/o2server/mixin-deep-1.3.2
6.0.2
6.0.1
6.0.0
5.4.1
wrdp-5.4.0
5.4.0
5.3.5
5.3.4
5.3.3
5.3.2
5.3.1
5.3.0
wrdp-5.3.0
wrdp-5.2.6
wrdp-5.2.5
wrdp-5.2.4
wrdp-5.2.3
5.2.5
wrdp-5.2
5.2.4
克隆/下载
克隆/下载
提示
下载代码请复制以下命令到终端执行
为确保你提交的代码身份被 Gitee 正确识别,请执行以下命令完成配置
初次使用 SSH 协议进行代码克隆、推送等操作时,需按下述提示完成 SSH 配置
1 生成 RSA 密钥
2 获取 RSA 公钥内容,并配置到 SSH公钥
在 Gitee 上使用 SVN,请访问 使用指南
使用 HTTPS 协议时,命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议 配置并使用私人令牌 替代登录密码进行克隆、推送等操作
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # 私人令牌
develop
分支 (6)
标签 (42)
develop
wrdp
master
release
dependabot/maven/o2server/org.quartz-scheduler-quartz-2.3.2
dependabot/npm_and_yarn/o2server/mixin-deep-1.3.2
6.0.2
6.0.1
6.0.0
5.4.1
wrdp-5.4.0
5.4.0
5.3.5
5.3.4
5.3.3
5.3.2
5.3.1
5.3.0
wrdp-5.3.0
wrdp-5.2.6
wrdp-5.2.5
wrdp-5.2.4
wrdp-5.2.3
5.2.5
wrdp-5.2
5.2.4
O2OA
/
o2ios
/
O2Platform
/
AppDelegate.swift
O2OA
/
o2ios
/
O2Platform
/
AppDelegate.swift
AppDelegate.swift 10.72 KB
一键复制 编辑 原始数据 按行查看 历史
fancylou 提交于 2020年08月27日 17:27 +08:00 . 更新语音助手
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264
//
// AppDelegate.swift
// O2Platform
//
// Created by 刘振兴 on 16/6/14.
// Copyright © 2016年 zoneland. All rights reserved.
//
import UIKit
import CocoaLumberjack
import AlamofireNetworkActivityIndicator
import UserNotifications
import O2OA_Auth_SDK
import Flutter
import IQKeyboardManagerSwift
let isProduction = true
@UIApplicationMain
class AppDelegate: FlutterAppDelegate, JPUSHRegisterDelegate, UNUserNotificationCenterDelegate {
var _mapManager: BMKMapManager?
//中心服务器节点类
public static let o2Collect = O2Collect()
//网络监听
public let o2ReachabilityManager = O2ReachabilityManager.sharedInstance
// flutter engine
var flutterEngine : FlutterEngine?
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
if #available(iOS 13.0, *) {
window.overrideUserInterfaceStyle = .light
}
let themeName = AppConfigSettings.shared.themeName
if themeName != "" {
//主题
print("主题色:\(themeName)")
O2ThemeManager.setTheme(plistName: themeName, path: .mainBundle)
}else {
O2ThemeManager.setTheme(plistName: "red", path: .mainBundle)
}
//搜索框
UISearchBar.appearance().theme_barTintColor = ThemeColorPicker(keyPath: "Base.base_color")
UISearchBar.appearance().tintColor = UIColor.white
UITextField.appearance(whenContainedInInstancesOf: [UISearchBar.self]).theme_tintColor = ThemeColorPicker(keyPath: "Base.base_color")
//启动日志管理器
O2Logger.startLogManager()
//日志文件
_ = O2Logger.getLogFiles()
O2Logger.debug("设置运行版本==========,\(PROJECTMODE)")
//网络检查
o2ReachabilityManager.startListening()
//Alamofire
NetworkActivityIndicatorManager.shared.isEnabled = true
//db
let _ = DBManager.shared
//设置一个是否第一授权的标志
if #available(iOS 10.0, *){
let center = UNUserNotificationCenter.current()
center.delegate = self
let options:UNAuthorizationOptions = [.badge,.alert,.sound]
center.requestAuthorization(options: options, completionHandler: { (granted, err) in
if granted == true {
//记录已经打开授权
//print("aaaaaaaaaaaa")
AppConfigSettings.shared.notificationGranted = true
AppConfigSettings.shared.firstGranted = true
NotificationCenter.default.post(name: NSNotification.Name.init("SETTING_NOTI"), object: nil)
}else{
//记录禁用授权
AppConfigSettings.shared.notificationGranted = false
AppConfigSettings.shared.firstGranted = true
NotificationCenter.default.post(name: NSNotification.Name.init("SETTING_NOTI"), object: nil)
}
})
}else{
let types:UIUserNotificationType = [.badge,.alert,.sound]
let setting = UIUserNotificationSettings(types: types, categories: nil)
UIApplication.shared.registerUserNotificationSettings(setting)
}
//Buglyy异常上报
Bugly.start(withAppId: BUGLY_ID)
//JPush
_setupJPUSH()
JPUSHService.setup(withOption: launchOptions, appKey: JPUSH_APP_KEY, channel: JPUSH_channel, apsForProduction: isProduction)
_mapManager = BMKMapManager()
BMKMapManager.setCoordinateTypeUsedInBaiduMapSDK(.COORDTYPE_BD09LL)
_mapManager?.start(BAIDU_MAP_KEY, generalDelegate: nil)
JPUSHService.registrationIDCompletionHandler { (resCode, registrationID) in
if resCode == 0 {
O2Logger.debug("registrationID获取成功\(registrationID ?? "")")
O2AuthSDK.shared.setDeviceToken(token: registrationID ?? "registrationIDerror0x0x")
}else{
O2Logger.debug("registrationID获取失败,code:\(resCode)")
O2AuthSDK.shared.setDeviceToken(token: registrationID ?? "registrationIDerror0x0x")
}
}
// OOPlusButtonSubclass.register()
OOTabBarHelper.initTabBarStyle()
//
IQKeyboardManager.shared.enable = true
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
// MARK:- private func Jpush
private func _setupJPUSH() {
let entity = JPUSHRegisterEntity()
entity.types = NSInteger(UNAuthorizationOptions.alert.rawValue) |
NSInteger(UNAuthorizationOptions.sound.rawValue) |
NSInteger(UNAuthorizationOptions.badge.rawValue)
JPUSHService.register(forRemoteNotificationConfig: entity, delegate: self)
}
//注册 APNs 获得device token
override func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
super.application(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken)
DDLogDebug("get the deviceToken \(deviceToken)")
NotificationCenter.default.post(name: Notification.Name(rawValue: "DidRegisterRemoteNotification"), object: deviceToken)
JPUSHService.registerDeviceToken(deviceToken)
}
override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
DDLogDebug("open url :\(url.absoluteString)")
return true
}
override func application(_ application: UIApplication, didRegister notificationSettings: UIUserNotificationSettings) {
if notificationSettings.types.rawValue == 0 {
AppConfigSettings.shared.notificationGranted = false
AppConfigSettings.shared.firstGranted = true
NotificationCenter.default.post(name: NSNotification.Name.init("SETTING_NOTI"), object: nil)
}else{
AppConfigSettings.shared.notificationGranted = true
AppConfigSettings.shared.firstGranted = true
NotificationCenter.default.post(name: NSNotification.Name.init("SETTING_NOTI"), object: nil)
}
}
//实现注册 APNs 失败接口
override func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
DDLogError("didFailToRegisterForRemoteNotificationsWithError: \(error.localizedDescription)")
}
override func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any]) {
JPUSHService.handleRemoteNotification(userInfo)
DDLogDebug("收到通知,\(userInfo)")
NotificationCenter.default.post(name: Notification.Name(rawValue: "AddNotificationCount"), object: nil)
}
override func applicationWillEnterForeground(_ application: UIApplication) {
application.applicationIconBadgeNumber = 0
application.cancelAllLocalNotifications()
}
override func applicationDidBecomeActive(_ application: UIApplication) {
}
override func applicationDidEnterBackground(_ application: UIApplication) {
application.applicationIconBadgeNumber = 0
application.cancelAllLocalNotifications()
}
deinit {
o2ReachabilityManager.stopListening()
}
// iOS 12 Support
@available(iOS 12.0, *)
func jpushNotificationCenter(_ center: UNUserNotificationCenter!, openSettingsFor notification: UNNotification!) {
// open
if (notification != nil && (notification?.request.trigger?.isKind(of: UNPushNotificationTrigger.self) == true) ) {
//从通知界面直接进入应用
DDLogInfo("从通知界面直接进入应用............")
}else{
//从通知设置界面进入应用
DDLogInfo("从通知设置界面进入应用............")
}
}
@available(iOS 10.0, *)
func jpushNotificationCenter(_ center: UNUserNotificationCenter!, willPresent notification: UNNotification!,
withCompletionHandler completionHandler: ((Int) -> Void)!) {
let userInfo = notification.request.content.userInfo
let request = notification.request // 收到推送的请求
let content = request.content // 收到推送的消息内容
let badge = content.badge // 推送消息的角标
let body = content.body // 推送消息体
let sound = content.sound // 推送消息的声音
let subtitle = content.subtitle // 推送消息的副标题
let title = content.title // 推送消息的标题
if (notification.request.trigger?.isKind(of: UNPushNotificationTrigger.self))! {
JPUSHService.handleRemoteNotification(userInfo)
}else{
//判断为本地通知
O2Logger.debug("iOS10 前台收到本地通知:{\nbody:\(body),\ntitle:\(title),\nsubtitle:\(subtitle),\nbadge:\(badge ?? 0),\nsound:\(sound.debugDescription)")
}
UIApplication.shared.applicationIconBadgeNumber = 0
JPUSHService.setBadge(0)
completionHandler(Int(UNNotificationPresentationOptions.alert.rawValue|UNNotificationPresentationOptions.badge.rawValue|UNNotificationPresentationOptions.sound.rawValue))
}
@available(iOS 10.0, *)
func jpushNotificationCenter(_ center: UNUserNotificationCenter!, didReceive response: UNNotificationResponse!, withCompletionHandler completionHandler: (() -> Void)!) {
let userInfo = response.notification.request.content.userInfo
let request = response.notification.request // 收到推送的请求
let content = request.content // 收到推送的消息内容
let badge = content.badge // 推送消息的角标
let body = content.body // 推送消息体
let sound = content.sound // 推送消息的声音
let subtitle = content.subtitle // 推送消息的副标题
let title = content.title // 推送消息的标题
if (response.notification.request.trigger?.isKind(of: UNPushNotificationTrigger.self))! {
JPUSHService.handleRemoteNotification(userInfo)
}else{
//判断为本地通知
O2Logger.debug("iOS10 前台收到本地通知:{\nbody:\(body),\ntitle:\(title),\nsubtitle:\(subtitle),\nbadge:\(badge ?? 0),\nsound:\(sound.debugDescription)")
}
UIApplication.shared.applicationIconBadgeNumber = 0
JPUSHService.setBadge(0)
completionHandler()
}
}
Loading...
举报
举报成功
我们将于2个工作日内通过站内信反馈结果给你!
请认真填写举报原因,尽可能描述详细。
请选择举报类型
取消
发送
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

简介

开源OA系统 - 码云GVP|Java开源oa|企业OA办公平台|企业OA|协同办公OA|流程平台OA|O2OA|OA,支持国产麒麟操作系统和国产数据库(达梦、人大金仓),政务OA,军工信息化OA
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
编辑仓库简介
简介内容
主页
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/boshi_admin/O2OA.git
git@gitee.com:boshi_admin/O2OA.git
boshi_admin
O2OA
O2OA
develop
点此查找更多帮助

搜索帮助

评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册

AltStyle によって変換されたページ (->オリジナル) /