herenowts
herenowts
  • 发布:2022-04-24 11:30
  • 更新:2022-04-27 11:37
  • 阅读:1104

【报Bug】3.3.13 后 离线打包 iOS 无法推送, 获取不到设备 ID

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: 12

HBuilderX类型: 正式

HBuilderX版本号: 3.3.13

手机系统: iOS

手机系统版本号: iOS 15

手机厂商: 苹果

手机机型: SE2

页面类型: vue

vue版本: vue2

打包方式: 离线

项目创建方式: HBuilderX

App下载地址或H5⽹址: itunes.apple.com/cn/app/%E7%A6%8F%E5%AE%B6%E4%BA%AB%E5%8F%97/id1531669972?mt=8

示例代码:
  • (void)mystartSdkWithAppId:(NSString )appid appKey:(NSString )appKey appSecret:(NSString *)appSecret delegate:(id<GeTuiSdkDelegate>)delegate{

    NSLog(@"%@", [NSString stringWithFormat:@"GeTuiSdk (GPush): mystartSdkWithAppId: %@ appKey:%@ appSecret:%@ delegate:%@",appid, appKey, appSecret, delegate]);

    [GeTuiSdk mystartSdkWithAppId:appid appKey:appKey appSecret:appSecret delegate:delegate];
    }

3.3.13 SDK执行
2022-04-24 12:20:41.687248+0800 HBuilder[74037:2975985] GeTuiSdk (GPush): +load
2022-04-24 12:20:41.727377+0800 HBuilder[74037:2975985] NSDictionary (GPush): +load
2022-04-24 12:20:46.332257+0800 HBuilder[74037:2975985] -canOpenURL: failed for URL: "taobao://" - error: "This app is not allowed to query for scheme taobao"
2022-04-24 12:20:46.332650+0800 HBuilder[74037:2975985] -canOpenURL: failed for URL: "kwai://" - error: "This app is not allowed to query for scheme kwai"
2022-04-24 12:20:46.332989+0800 HBuilder[74037:2975985] -canOpenURL: failed for URL: "awemesso://" - error: "This app is not allowed to query for scheme awemesso"
2022-04-24 12:20:46.333325+0800 HBuilder[74037:2975985] -canOpenURL: failed for URL: "pinduoduo://" - error: "This app is not allowed to query for scheme pinduoduo"
2022-04-24 12:20:46.333725+0800 HBuilder[74037:2975985] -canOpenURL: failed for URL: "openApp.jdMobile://" - error: "This app is not allowed to query for scheme openapp.jdmobile"
2022-04-24 12:20:46.337609+0800 HBuilder[74037:2975985] ######===>>>>New Device Model:[iPhone12,8]
2022-04-24 12:20:46.447830+0800 HBuilder[74037:2975985] [Runtime][DEBUG:] ##CoreApp##...app start load..
2022-04-24 12:20:46.448311+0800 HBuilder[74037:2975985] [Runtime][DEBUG:] ##CoreApp##...createAppRuntime..
2022-04-24 12:20:46.452333+0800 HBuilder[74037:2975985] UniPluginProtocol Func: <HXUniNativePluginProxy: 0x283e59aa0>,-[HXUniNativePluginProxy onCreateUniPlugin]
2022-04-24 12:20:46.453318+0800 HBuilder[74037:2975985] UniPluginProtocol Func: <HXUniNativePluginProxy: 0x283e59aa0>,-[HXUniNativePluginProxy application:didFinishLaunchingWithOptions:]
2022-04-24 12:20:46.465784+0800 HBuilder[74037:2975985] ###### huisu addObserver ######
2022-04-24 12:20:46.565884+0800 HBuilder[74037:2975985] [Runtime][DEBUG:] splash screen 需要自动关闭
2022-04-24 12:20:46.580909+0800 HBuilder[74037:2975985] [Runtime][DEBUG:] core started
2022-04-24 12:20:46.581484+0800 HBuilder[74037:2975985] application--didRegisterForRemoteNotificationsWithDeviceToken[{length = 32, bytes = 0xe7465355 7dba2d13 2bbdb0c7 9ec6f995 ... 573a7405 21906961 }]
2022-04-24 12:20:46.581574+0800 HBuilder[74037:2975985] deviceToken1:e74653557dba2d132bbdb0c79ec6f995195870b2a0729065573a740521906961
2022-04-24 12:20:46.583100+0800 HBuilder[74037:2975985] UniPluginProtocol Func: <HXUniNativePluginProxy: 0x283e59aa0>,-[HXUniNativePluginProxy applicationDidBecomeActive:]

3.3.11 SDK执行

2022-04-24 12:22:01.585256+0800 HBuilder[74054:2977061] GeTuiSdk (GPush): +load
2022-04-24 12:22:01.626538+0800 HBuilder[74054:2977061] NSDictionary (GPush): +load
2022-04-24 12:22:01.855935+0800 HBuilder[74054:2977061] -canOpenURL: failed for URL: "taobao://" - error: "This app is not allowed to query for scheme taobao"
2022-04-24 12:22:01.856398+0800 HBuilder[74054:2977061] -canOpenURL: failed for URL: "kwai://" - error: "This app is not allowed to query for scheme kwai"
2022-04-24 12:22:01.856719+0800 HBuilder[74054:2977061] -canOpenURL: failed for URL: "awemesso://" - error: "This app is not allowed to query for scheme awemesso"
2022-04-24 12:22:01.857422+0800 HBuilder[74054:2977061] -canOpenURL: failed for URL: "pinduoduo://" - error: "This app is not allowed to query for scheme pinduoduo"
2022-04-24 12:22:01.857751+0800 HBuilder[74054:2977061] -canOpenURL: failed for URL: "openApp.jdMobile://" - error: "This app is not allowed to query for scheme openapp.jdmobile"
2022-04-24 12:22:01.861488+0800 HBuilder[74054:2977061] ######===>>>>New Device Model:[iPhone12,8]
2022-04-24 12:22:02.010201+0800 HBuilder[74054:2977061] GeTuiSdk--PGPushServerAct
2022-04-24 12:22:02.011150+0800 HBuilder[74054:2977061] GeTuiSdk (GPush): mystartSdkWithAppId: ** appKey:** appSecret:** delegate:<PGPushServerAct: 0x282587c80>
2022-04-24 12:22:02.026428+0800 HBuilder[74054:2977061] GeTuiSdk (GPush): myclientId: 195f0f5011477927b6e2eb7ba286c719
2022-04-24 12:22:02.027018+0800 HBuilder[74054:2977061] [Runtime][DEBUG:] ##CoreApp##...app start load..
2022-04-24 12:22:02.027387+0800 HBuilder[74054:2977061] [Runtime][DEBUG:] ##CoreApp##...createAppRuntime..
2022-04-24 12:22:02.031317+0800 HBuilder[74054:2977061] UniPluginProtocol Func: <HXUniNativePluginProxy: 0x283286ef0>,-[HXUniNativePluginProxy onCreateUniPlugin]
2022-04-24 12:22:02.031938+0800 HBuilder[74054:2977061] UniPluginProtocol Func: <HXUniNativePluginProxy: 0x283286ef0>,-[HXUniNativePluginProxy application:didFinishLaunchingWithOptions:]
2022-04-24 12:22:02.043136+0800 HBuilder[74054:2977061] ###### huisu addObserver ######
2022-04-24 12:22:02.101488+0800 HBuilder[74054:2977061] [Runtime][DEBUG:] splash screen 需要自动关闭
2022-04-24 12:22:02.108856+0800 HBuilder[74054:2977061] [Runtime][DEBUG:] core started
2022-04-24 12:22:02.109291+0800 HBuilder[74054:2977061]

[GexinSdk error]:Missing UNUserNotificationCenter Delegate, Please Use [GeTuiSdk registerRemoteNotification:]
2022-04-24 12:22:02.109385+0800 HBuilder[74054:2977061] application--didRegisterForRemoteNotificationsWithDeviceToken[{length = 32, bytes = 0xe7465355 7dba2d13 2bbdb0c7 9ec6f995 ... 573a7405 21906961 }]
2022-04-24 12:22:02.109432+0800 HBuilder[74054:2977061] GeTuiSdk--registerDeviceTokenData[{length = 32, bytes = 0xe7465355 7dba2d13 2bbdb0c7 9ec6f995 ... 573a7405 21906961 }]
2022-04-24 12:22:02.109531+0800 HBuilder[74054:2977061] deviceToken1:e74653557dba2d132bbdb0c79ec6f995195870b2a0729065573a740521906961
2022-04-24 12:22:02.110927+0800 HBuilder[74054:2977061] UniPluginProtocol Func: <HXUniNativePluginProxy: 0x283286ef0>,-[HXUniNativePluginProxy applicationDidBecomeActive:]

其余日志

2022-04-23 14:10:57.184481+0800 HBuilder[464:12466] [Runtime][DEBUG:] core started
2022-04-23 14:10:57.185349+0800 HBuilder[464:12466] UniPluginProtocol Func: <HXUniNativePluginProxy: 0x2818a6df0>,-[HXUniNativePluginProxy applicationDidBecomeActive:]
2022-04-23 14:10:57.185491+0800 HBuilder[464:12466] application--didRegisterForRemoteNotificationsWithDeviceToken[{length = 32, bytes = 0x31dce6fa e0a20a96 6de6b884 6db0d699 ... 05feac05 184ccd93 }]
2022-04-23 14:10:57.185539+0800 HBuilder[464:12466] deviceToken1:31dce6fae0a20a966de6b8846db0d699c7625535cac45fb705feac05184ccd93

2022-04-23 14:11:07.860218 0800 HBuilder[464:12696] <Weex>[log]WXBridgeContext.m:1310, jsLog: #ifdef APP-PLUS tryToUploadCid at pages/index/index.vue:2329 LOG
2022-04-23 14:11:07.863084 0800 HBuilder[464:12696] <Weex>[log]WXBridgeContext.m:1310, jsLog: Push:用户已经登录: UR000002856682,getClientInfo:cid: undefined at pages/index/index.vue:2334
LOG
2022-04-23 14:11:07.863569 0800 HBuilder[464:12696] <Weex>[log]WXBridgeContext.m:1310, jsLog: Push:用户已经登录: UR000002856682, getClientInfo cid: null at pages/index/index.vue:2340 LOG
2022-04-23 14:11:07.867472 0800 HBuilder[464:12696] <Weex>[log]WXBridgeContext.m:1310, jsLog: RemoteNotificationsUpdateBadge: var GeTuiSdk = plus.ios.importClass('GeTuiSdk'); at pages/index/index.vue:2350
LOG
2022-04-23 14:11:07.867739 0800 HBuilder[464:12696] <Weex>[log]WXBridgeContext.m:1310, jsLog: RemoteNotificationsUpdateBadge: GeTuiSdk != null at pages/index/index.vue:2352 LOG
2022-04-23 14:11:07.868300 0800 HBuilder[464:12696] <Weex>[log]WXBridgeContext.m:1310, jsLog: Push:用户已经登录: UR000002856682, GeTuiSdk.clientId()---COMMA------UNDEFINED--- at pages/index/index.vue:2355
LOG
2022-04-23 14:11:10.866213 0800 HBuilder[464:12696] <Weex>[log]WXBridgeContext.m:1310, jsLog: #ifdef APP-PLUS tryToUploadCid at pages/index/index.vue:2329 LOG
2022-04-23 14:11:10.868547 0800 HBuilder[464:12696] <Weex>[log]WXBridgeContext.m:1310, jsLog: Push:用户已经登录: UR000002856682,getClientInfo:cid: undefined at pages/index/index.vue:2334
LOG
2022-04-23 14:11:10.868991 0800 HBuilder[464:12696] <Weex>[log]WXBridgeContext.m:1310, jsLog: Push:用户已经登录: UR000002856682, getClientInfo cid: null at pages/index/index.vue:2340 LOG
2022-04-23 14:11:10.872874 0800 HBuilder[464:12696] <Weex>[log]WXBridgeContext.m:1310, jsLog: RemoteNotificationsUpdateBadge: var GeTuiSdk = plus.ios.importClass('GeTuiSdk'); at pages/index/index.vue:2350
LOG
2022-04-23 14:11:10.873155 0800 HBuilder[464:12696] <Weex>[log]WXBridgeContext.m:1310, jsLog: RemoteNotificationsUpdateBadge: GeTuiSdk != null at pages/index/index.vue:2352 LOG
2022-04-23 14:11:10.873697 0800 HBuilder[464:12696] <Weex>[log]WXBridgeContext.m:1310, jsLog: Push:用户已经登录: UR000002856682, GeTuiSdk.clientId()---COMMA------UNDEFINED--- at pages/index/index.vue:2355
LOG

操作步骤:

离线打包

预期结果:

获取到设备 ID

实际结果:

无法获取到设备 ID

bug描述:

3.3.13 后 离线打包 iOS 无法推送, 获取不到设备 ID

离线打包的 3.3.13 的 SDK 里 到底是不是 3.3.13
今天下载了 3.3.11 3.4.6 预览版 SDK
在仅仅替换离线打包 SDK 文件夹情况下,
3.3.11 可以获取到 CID
3.3.13 无法获取 CID
3.4.6预览 无法获取 CID

在置换方法 [GeTuiSdk method_exchangeClassMethodImplementations:@selector(mystartSdkWithAppId:appKey:appSecret:delegate:) s2:@selector(startSdkWithAppId:appKey:appSecret:delegate:)];后
发现
3.3.11 调用了 startSdkWithAppId:(NSString )appid appKey:(NSString )appKey appSecret:(NSString *)appSecret delegate:(id)delegate 方法
但是
3.3.13 后未调用

2022-04-24 11:30 负责人:DCloud_iOS_WZT 分享
已邀请:
DCloud_iOS_WZT

DCloud_iOS_WZT

注意 SDK目录下的 /SDK/Bundles/PandoraApi.bundle/feature.plist,如果之前有修改过需要开发者自行备份,升级完SDK再次覆盖此文件,避免升级造成部分功能异常

看下这个文件配的对不对

  • herenowts (作者)

    按照配置做过多次尝试, 无论是配置 LinkerFlags 还是 Library, 在 3.3.13 后版本都没有调用GeTuiSDK中注册方法, 也下了最新 SDK, 改了包名赔了库, 但是依旧未调用

    2022-04-25 12:58

  • DCloud_iOS_WZT

    回复 n***@qq.com: 我发的plist 你检查了么

    2022-04-25 14:16

  • herenowts (作者)

    回复 DCloud_iOS_WZT: 您能请您那面的 iOS 开发工程师验证一下这个问题么, 在最新的 3.4.7 SDK 包的基础上验证一下这个问题么

    2022-04-25 15:45

  • herenowts (作者)

    回复 DCloud_iOS_WZT: 或者 SDK 中能不能把 [GeTuiSdk startSdkWithAppId:appid appKey:appKey appSecret:appSecret delegate:delegate];的调用暴露出来, 如果 SDK 有 bug 也可以让其他人主动调用

    2022-04-25 15:47

DCloud_iOS_WZT

DCloud_iOS_WZT

feature.plist 文件(位于PandoraApi.bundle中),Push模块下缺少class字段导致的问题

该问题目前已经被锁定, 无法添加新回复