feat: 新增iOS token截取,并回调到flutter业务层

This commit is contained in:
Liuyf 2025-02-22 16:35:52 +08:00
parent 9ca61b40d8
commit 807ddb8e39

View File

@ -620,13 +620,16 @@ static NSMutableArray<FlutterResult>* getRidResults;
}
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
NSDictionary *tokenInfo = @{
NSString *tokenString = [self hexStringFromData:deviceToken];
NSLog(@"jpush didRegisterForRemoteNotificationsWithDeviceToken token: %@", tokenString);
NSDictionary *params = @{
@"code" : @0,
@"cmd" : @100,
@"token" : [self hexStringFromData:deviceToken],
@"token" : tokenString,
@"platform" : @7,
};
[_channel invokeMethod:@"onCommandResult" arguments:tokenInfo];
NSLog(@"jpush onCommandResult params: %@", params);
[_channel invokeMethod:@"onCommandResult" arguments:params];
[JPUSHService registerDeviceToken:deviceToken];
}