From d826f6f205db781a25af7b3bd42acbc2863b4610 Mon Sep 17 00:00:00 2001 From: Liuyf Date: Sat, 22 Feb 2025 17:12:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=BB=9F=E4=B8=80android=E5=92=8Cios?= =?UTF-8?q?=20=E6=8E=A8=E9=80=81token=E6=A1=A5=E6=8E=A5=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Runner/AppDelegate.m | 19 ++++++++++++++++--- pubspec.lock | 4 ++-- pubspec.yaml | 2 +- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ios/Runner/AppDelegate.m b/ios/Runner/AppDelegate.m index 76d97654..b648e544 100755 --- a/ios/Runner/AppDelegate.m +++ b/ios/Runner/AppDelegate.m @@ -76,12 +76,25 @@ /* * 苹果推送注册成功回调,将苹果返回的deviceToken上传到CloudPush服务器 */ -- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { +//- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { +// NSString *tokenString = [self hexStringFromData:deviceToken]; +// NSLog(@"starlock didRegisterForRemoteNotificationsWithDeviceToken token: %@", tokenString); +// /// Required - 注册 DeviceToken +// [JPUSHService registerDeviceToken:deviceToken]; +// +//} - /// Required - 注册 DeviceToken - [JPUSHService registerDeviceToken:deviceToken]; +- (NSString *)hexStringFromData:(NSData *)data { + const unsigned char *dataBuffer = (const unsigned char *)[data bytes]; + NSMutableString *hexString = [NSMutableString stringWithCapacity:data.length * 2]; + for (NSInteger i = 0; i < data.length; i++) { + [hexString appendFormat:@"%02x", dataBuffer[i]]; + } + + return [hexString copy]; } + /* * 苹果推送注册失败回调 */ diff --git a/pubspec.lock b/pubspec.lock index f09c8feb..40584305 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -992,8 +992,8 @@ packages: dependency: "direct main" description: path: "." - ref: main - resolved-ref: aa93729f48762421658675800be68aee27b6d8fb + ref: "807ddb8e396c2dce16919df84efe795072404dde" + resolved-ref: "807ddb8e396c2dce16919df84efe795072404dde" url: "git@code-internal.star-lock.cn:StarlockTeam/jpush_flutter.git" source: git version: "2.5.8" diff --git a/pubspec.yaml b/pubspec.yaml index 2305f135..885185dc 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -214,7 +214,7 @@ dependencies: jpush_flutter: git: url: git@code-internal.star-lock.cn:StarlockTeam/jpush_flutter.git - ref: main + ref: 807ddb8e396c2dce16919df84efe795072404dde #视频播放器 video_player: ^2.9.2