let token = deviceToken.map { String(format: "%.2hhx", $0) }.joined() The English version is here: How to convert an APNs token to String from Data? 以下、以前微妙な書き方をしていてSwift 3移行時にうまく変換できなくなってしまった反省や、他の書き方などの紹介となっています。 UIApplicationDelegateのapplication(_:didRegisterForRemoteNotificationsWithDeviceToken:)で渡ってくるdeviceToken(デバイストークン)はData型(Swift 2.2まではNSData型)ですが、それを16進数文字列に変換するやり方について紹介します。 僕はSwift 2.2ま