func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {}
I want deviceToken
to string
but:
let str = String.init(data: deviceToken, encoding: .utf8)
str
is nil
swift 3.0
how can I let data
to string
?
Registering for Push Notifications in Xcode 8/Swift 3.0? not working and the answer is a few months ago, I had tried it:
and print:
file -I /path/to/file.txt
. If not convert using iconv:iconv -f UTF-16LE -t UTF-8 /path/to/file.txt > /path/to/utf8/file.txt