brightyang
brightyang
  • 发布:2019-10-25 15:27
  • 更新:2019-10-29 20:01
  • 阅读:277

IOS 5 +SDK 微信授权登录后跳回app无任何回调事件

分类:5+ SDK

版本:HBuilder 2.3.7.20191024
IOS 13.1.2

IOS 5 +SDK 微信授权登录后跳回app无任何回调事件,微信分享也不好使,提示 {"errMsg":"share:fail:[Share微信:-99]appid无效或配置错误,http://ask.dcloud.net.cn/article/287"}**,但是appid都配置了,之前也是没问题的,更新SDK后出现的问题

AppDelegate部分代码  

#pragma mark URL  

- (BOOL)application:(UIApplication *)application  
            openURL:(NSURL *)url  
  sourceApplication:(NSString *)sourceApplication  
         annotation:(id)annotation {  
    [PDRCore handleSysEvent:PDRCoreSysEventOpenURL withObject:url];  
    //判断是否是通过LinkedME的UrlScheme唤起App  
    if ([[url description] rangeOfString:@"click_id"].location != NSNotFound) {  
        return [[LinkedME getInstance] handleDeepLink:url];  
    }  
    [WXApi handleOpenURL:url delegate:self];  
    return YES;  
}  

- (BOOL)application:(UIApplication*)application continueUserActivity:(NSUserActivity*)userActivity restorationHandler:(void (^)(NSArray*))restorationHandler{  
    //判断是否是通过LinkedME的Universal Links唤起App  
    if ([[userActivity.webpageURL description] rangeOfString:@"lkme.cc"].location != NSNotFound) {  
        return  [[LinkedME getInstance] continueUserActivity:userActivity];  
    }  
    [WXApi handleOpenUniversalLink:userActivity delegate:self];  
    return YES;  
}  

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options  
{  
    [PDRCore handleSysEvent:PDRCoreSysEventOpenURLWithOptions withObject:@[url,options]];  
    //判断是否是通过LinkedME的UrlScheme唤起App  
    if ([[url description] rangeOfString:@"click_id"].location != NSNotFound) {  
        return [[LinkedME getInstance] handleDeepLink:url];  
    }  
    return YES;  
}  

/*  
 * @Summary:程序被第三方调用,传入参数启动  
 *  
 */  
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url  
{  
       [PDRCore handleSysEvent:PDRCoreSysEventOpenURL withObject:url];  
        return YES;  
}
2019-10-25 15:27 分享
已邀请:

最佳回复

brightyang

brightyang (作者) - Stand Out Or Get Out

已解决

第一步:在info文件中添加UniversalLinks字段,值为你的universalLink(和微信后台填写的一致)
参考文档: https://ask.dcloud.net.cn/docs/#//ask.dcloud.net.cn/article/170

第二步:在 AppDelegate.m 中添加

- (BOOL)application:(UIApplication*)application continueUserActivity:(NSUserActivity*)userActivity restorationHandler:(void (^)(NSArray*))restorationHandler{  
    [PDRCore handleSysEvent:PDRCoreSysEventContinueUserActivity withObject:userActivity];  
    restorationHandler(nil);  
    return YES;  
}
MicroLong

MicroLong

我也遇到了同样的问题

1227971437@qq.com

1227971437@qq.com

老哥解决了吗,我本地打包出现-99,没有解决,正在让后台看universalLink是否正确

要回复问题请先登录注册