Commit 610b4f7e2b78174eefb736ef19ee11495849b7cd
1 parent
9fb0187b
跳转修改提交
Showing
4 changed files
with
11 additions
and
27 deletions
CNLiveBBASMModule.podspec
CNLiveBBASMModule/Classes/CNLiveBBASMImpl/CNShare/CNBBASMShareImpl.m
| ... | ... | @@ -30,9 +30,9 @@ RegisterBBASMAdapter() |
| 30 | 30 | // 小程序页面链接 |
| 31 | 31 | NSString *path = content[@"linkUrl"]; |
| 32 | 32 | NSDictionary *appInfo = content[@"appInfo"]; |
| 33 | + NSString *contentPath = [content[@"path"] stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]; | |
| 33 | 34 | |
| 34 | - path = [NSString stringWithFormat:@"%@/smartappLandingpage.html?title=%@&content=%@&imageUrl=%@&swanId=%@&type=smartapp",WjjH5_Host,title,sharecontent,iconUrl,[CNLiveEscpTools esp:[NSString stringWithFormat:@"%@/%@",appInfo[@"appID"],content[@"path"]]]]; | |
| 35 | - | |
| 35 | + path = [NSString stringWithFormat:@"%@/smartappLandingpage.html?title=%@&content=%@&imageUrl=%@&swanId=%@&type=smartapp",WjjH5_Host,[title stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]],[sharecontent stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]],[iconUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]],[CNLiveEscpTools esp:[NSString stringWithFormat:@"%@/%@",appInfo[@"appID"],contentPath]]]; | |
| 36 | 36 | |
| 37 | 37 | NSString *mediaType = content[@"mediaType"]; |
| 38 | 38 | NSDictionary *params = nil; |
| ... | ... | @@ -40,7 +40,7 @@ RegisterBBASMAdapter() |
| 40 | 40 | params = @{ |
| 41 | 41 | @"title":title, |
| 42 | 42 | @"shareDesc":sharecontent, |
| 43 | - @"shareUrl":[path stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]], | |
| 43 | + @"shareUrl":path, | |
| 44 | 44 | @"shareImage":iconUrl, |
| 45 | 45 | @"shareType":mediaType, |
| 46 | 46 | }; |
| ... | ... | @@ -48,7 +48,7 @@ RegisterBBASMAdapter() |
| 48 | 48 | params = @{ |
| 49 | 49 | @"title":title, |
| 50 | 50 | @"shareDesc":sharecontent, |
| 51 | - @"shareUrl":[path stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]], | |
| 51 | + @"shareUrl":path, | |
| 52 | 52 | @"shareImage":iconUrl, |
| 53 | 53 | }; |
| 54 | 54 | } | ... | ... |
Example/CNLiveBBASMModule/CNLIVEViewController.m
| ... | ... | @@ -54,10 +54,10 @@ |
| 54 | 54 | break; |
| 55 | 55 | case 2: |
| 56 | 56 | { |
| 57 | - NSString *urlStr = @""; | |
| 57 | + NSString *urlStr = @"http://wjjh5test.cnlive.com/smartappLandingpage.html?title=%E5%85%B3%E4%BA%8E%E5%8A%A8%E7%89%A9%E7%9A%84%E8%B6%A3%E5%91%B3%E4%BF%9A%E8%AF%AD%E8%A1%A8%E8%BE%BE%EF%BD%9E&content=%E6%B2%AA%E6%B1%9F%E8%8B%B1%E8%AF%AD%E6%8F%90%E4%BE%9B%E8%8B%B1%E8%AF%AD%E5%9B%9B%E5%85%AD%E7%BA%A7%E3%80%81%E5%90%AC%E8%AF%B4%E8%AF%BB%E5%86%99%E3%80%81%E5%BD%B1%E8%A7%86%E5%A8%B1%E4%B9%90%E3%80%81%E5%85%A5%E9%97%A8%E5%AD%A6%E4%B9%A0%E8%B5%84%E8%AE%AF&imageUrl=https://b.bdstatic.com/searchbox/mappconsole/image/20181105/1541398769-33490.png&swanId=lDvbSAZzaa8xPTQ8M0EquG1xos75HGvU%2F%2Fpages%2FaudioDetail%2FaudioDetail%3Fshare%3D1%26contentId%3D1279583%26rowId%3D1%26pubDate%3D2021%2D11%2D10%26assignTag%3D%E5%B0%8F%E8%AF%8D%E5%A4%A7%E7%94%A8&type=smartapp"; | |
| 58 | 58 | NSURL *url = [NSURL URLWithString:urlStr]; |
| 59 | 59 | NSDictionary * paramDic = [self requestURLParameters:url]; |
| 60 | - [CNLiveBBASMModuleService openBBASMModule:[NSString stringWithFormat:@"cnlive://swan/%@",[CNLiveEscpTools unesp:paramDic[@"swanId"]]]]; | |
| 60 | + [CNLiveBBASMModuleService openBBASMModule:[NSString stringWithFormat :@"cnlive://swan/%@",[CNLiveEscpTools unesp:paramDic[@"swanId"]]]]; | |
| 61 | 61 | } |
| 62 | 62 | break; |
| 63 | 63 | case 3: |
| ... | ... | @@ -94,21 +94,6 @@ |
| 94 | 94 | -(NSDictionary *)requestURLParameters:(NSURL *)urlStr |
| 95 | 95 | { |
| 96 | 96 | NSMutableDictionary *parm = [[NSMutableDictionary alloc]init]; |
| 97 | - | |
| 98 | - //回调遍历所有参数,添加入字典 | |
| 99 | - if (@available(iOS 11.0, *)) { | |
| 100 | - //传入url创建url组件类 | |
| 101 | - NSURLComponents *urlComponents = [[NSURLComponents alloc] initWithString:urlStr.absoluteString]; | |
| 102 | - [urlComponents.percentEncodedQueryItems enumerateObjectsUsingBlock:^(NSURLQueryItem * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { | |
| 103 | - if (!CNLiveStringIsEmpty(obj.name) && !CNLiveStringIsEmpty(obj.value)) { | |
| 104 | - if ([obj.name isEqualToString:@"//type"]) { | |
| 105 | - [parm setObject:obj.value forKey:@"type"]; | |
| 106 | - }else{ | |
| 107 | - [parm setObject:obj.value forKey:obj.name]; | |
| 108 | - } | |
| 109 | - } | |
| 110 | - }]; | |
| 111 | - } else { | |
| 112 | 97 | // Fallback on earlier versions |
| 113 | 98 | NSString * path = [urlStr.absoluteString componentsSeparatedByString:@"?"].lastObject; |
| 114 | 99 | NSArray * paramArray = [path componentsSeparatedByString:@"&"]; |
| ... | ... | @@ -120,7 +105,6 @@ |
| 120 | 105 | [parm setObject:tempArray.lastObject forKey:tempArray.firstObject]; |
| 121 | 106 | } |
| 122 | 107 | }]; |
| 123 | - } | |
| 124 | 108 | |
| 125 | 109 | return parm; |
| 126 | 110 | } | ... | ... |
Example/Podfile.lock
| ... | ... | @@ -32,7 +32,7 @@ PODS: |
| 32 | 32 | - YYCache |
| 33 | 33 | - CNLiveBaseKit (0.1.23): |
| 34 | 34 | - CNLiveNewTripartiteManagement/MJExtension |
| 35 | - - CNLiveBBASMModule (0.0.13): | |
| 35 | + - CNLiveBBASMModule (0.0.14): | |
| 36 | 36 | - BBAMNPLib |
| 37 | 37 | - CNLiveBeeHive |
| 38 | 38 | - CNLiveBusinessTools |
| ... | ... | @@ -44,7 +44,7 @@ PODS: |
| 44 | 44 | - SSDKLightLib |
| 45 | 45 | - WechatOpenSDK |
| 46 | 46 | - CNLiveBeeHive (0.1.9) |
| 47 | - - CNLiveBusinessTools (0.1.28): | |
| 47 | + - CNLiveBusinessTools (0.1.29): | |
| 48 | 48 | - CNLiveBaseKit |
| 49 | 49 | - CNLiveEnvironment |
| 50 | 50 | - CNLiveNewTripartiteManagement/QMUIKit |
| ... | ... | @@ -548,9 +548,9 @@ SPEC CHECKSUMS: |
| 548 | 548 | AlipaySDK-iOS: 8659cdb4403de7e5f26ad8b699864a9cbe53384c |
| 549 | 549 | BBAMNPLib: 26e7e4a046d98755ef467a9f3fd8f5ff4fa5cef9 |
| 550 | 550 | CNLiveBaseKit: 44e5fc573cbca78a86b704cf77c886ef53889807 |
| 551 | - CNLiveBBASMModule: 0c69d6a52b4524b430d21c7e607a76736d07021f | |
| 551 | + CNLiveBBASMModule: 9ab1c4a0fcd4890ec5bdc784c57b8175c7054165 | |
| 552 | 552 | CNLiveBeeHive: 1e105b15b6ccaad546258fcf91231563beb853d4 |
| 553 | - CNLiveBusinessTools: 5e65e6ca66088a2be577bf9f5f579ff7dcd74787 | |
| 553 | + CNLiveBusinessTools: fee9f935c2ef25ceeaa9605e8e0d490057906d0f | |
| 554 | 554 | CNLiveCommonCategory: 22c9842b31f2087803ae69e983b2c944fb80eae1 |
| 555 | 555 | CNLiveEnvironment: 48ba0f934399fd25fc54dc3239009754bcc1ddb3 |
| 556 | 556 | CNLiveNewTripartiteManagement: 29ddb2d23ee77bcd42ba5eaf5f1322ed37db5baa | ... | ... |