美文网首页
swift4.0DeviceToken

swift4.0DeviceToken

作者: 千年积木 | 来源:发表于2018-04-27 15:29 被阅读8次
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
        
        let token: NSMutableString = NSMutableString(format: "%@", deviceToken as CVarArg)
        token.replaceOccurrences(of: " ", with: "", options: NSString.CompareOptions.caseInsensitive, range: NSMakeRange(0, token.length))
        token.replaceOccurrences(of: "<", with: "", options: NSString.CompareOptions.caseInsensitive, range: NSMakeRange(0, token.length))
        token.replaceOccurrences(of: ">", with: "", options: NSString.CompareOptions.caseInsensitive, range: NSMakeRange(0, token.length))
        
        print("token",token);
        
    }

网友评论

      本文标题:swift4.0DeviceToken

      本文链接:https://www.haomeiwen.com/subject/glablftx.html