极光推送android点击跳转页面,app关闭时点击推送消息实现页面跳转
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
//推送注冊
var str:NSString = UIDevice.currentDevice().systemVersion
var version:Float = str.floatValue
if version >= 8.0 {
APService.registerForRemoteNotificationTypes(UIUserNotificationType.Badge.rawValue | UIUserNotificationType.Sound.rawValue | UIUserNotificationType.Alert.rawValue, categories: nil)
} else {
APService.registerForRemoteNotificationTypes(UIRemoteNotificationType.Badge.rawValue | UIRemoteNotificationType.Sound.rawValue | UIRemoteNotificationType.Alert.rawValue, categories: nil)
}
APService.setupWithOption(launchOptions)
if launchOptions != nil {
isLauncheByNotification = true
}
return true
}
func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject], fetchCompletionHandler completionHandler: (UIBackgroundFetchResult) -> Void) {
var user = userInfo as NSDictionary
var aps = user.valueForKey("aps") as! NSDictionary
var str = aps.valueForKey("alert") as! String
if isLauncheByNotification == true {
//post消息沒有啟動
NSNotificationCenter.defaultCenter().postNotificationName("push", object: nil, userInfo: userInfo)
}
APService.handleRemoteNotification(userInfo)
completionHandler(UIBackgroundFetchResult.NewData)
}
求大神給個提示
總結
以上是生活随笔為你收集整理的极光推送android点击跳转页面,app关闭时点击推送消息实现页面跳转的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C字头股票第二天有高开吗?
- 下一篇: ios html正则表达式,ios 正则