After doing some digging around how to extract the device_token, there was a lot of commentary around using the token.description vs using the bytes.
Description method like:
newToken = NSString.stringWithFormat("%@",token).stringByTrimmingCharactersInSet(NSCharacterSet.characterSetWithCharactersInString("<>")).stringByReplacingOccurrencesOfString(" ", withString:"")
With the bytes method; after you get hold of the token e.g.
def application(application, didRegisterForRemoteNotificationsWithDeviceToken: token)
NSLog("My token is: %@", token)
or with ProMotion-push on_push_registration(token, error)
I opted to use the bytes and used the following:
device_token = ''
for i in 0...(token.length)
I'll be interested to know if anyone thinks this method could cause issues??