) to a string in Kotlin
This is what I have done previously
Copy code
let tokenChars = UnsafePointer<CChar>(deviceToken.bytes)
var tokenString = ""
for i in 0..<deviceToken.length {
tokenString += String(format: "%02.2hhx", arguments: [tokenChars[i]])
}
print("tokenString: \(tokenString)")
When trying to do in KMM I run into issues
KMM
Copy code
actual typealias PushToken = NSData
fun PushToken.toString(): String {
// Unsure of what to do here
}
Has anyone done anything similar?
✅ 1
a
Anonymike
04/26/2023, 6:09 PM
We are doing this in Swift successfully from the application didRegisterForRemoteNotificationsWithDeviceToken delegate: