Objective-Cのアプリをデバッグしていて気づいたのですが、Xcode10まではPush通知用のdevice tokenをこう書いていました。が、これだとうまく動かなくて、
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
NSString *tokenString = [[[[deviceToken description]
stringByReplacingOccurrencesOfString:@"<"withString:@""]
stringByReplacingOccurrencesOfString:@">" withString:@""]
stringByReplacingOccurrencesOfString: @" " withString: @""];
・・・
developer forum覗いたところ、descriptionではもうダメで
const unsigned *tokenBytes = [deviceToken bytes];
NSString *tokenString = [NSString stringWithFormat:@"%08x%08x%08x%08x%08x%08x%08x%08x",
ntohl(tokenBytes[0]), ntohl(tokenBytes[1]), ntohl(tokenBytes[2]),
ntohl(tokenBytes[3]), ntohl(tokenBytes[4]), ntohl(tokenBytes[5]),
ntohl(tokenBytes[6]), ntohl(tokenBytes[7])];
・・・
こうするそうです。
もしもっといけてる方法があれば教えてください。