IOS端APP分享到企业微信后,点击返回APP没有反应,还是留在企业微信?
RCT_EXPORT_METHOD(shareLinkAttachment:(NSString *)title :(NSString *)summary :(NSString *)url) {
WWKSendMessageReq *req = [[WWKSendMessageReq alloc] init];
WWKMessageLinkAttachment *attachment = [[WWKMessageLinkAttachment alloc] init];
// 示例用链接,请填写你想分享的实际链接的标题、介绍、图标和URL
attachment.title = title;
if (summary) {
attachment.summary = summary;
}
attachment.url = url;
attachment.icon = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"icon" ofType:@"jpg"]];
req.attachment = attachment;
[WWKApi sendReq:req];
}
#pragma mark - wx callback
-(void) onReq:(WWKBaseReq *)req {
NSLog(@"onReq");
}
- (void)onResp:(WWKBaseResp *)resp {
/* SSO 的回调 */
if ([resp isKindOfClass:[WWKSSOResp class]]) {
WWKSSOResp *r = (WWKSSOResp *)resp;
NSMutableDictionary *body = [NSMutableDictionary new];
body[@"errCode"] = @(r.errCode);
body[@"errStr"] = r.errStr;
body[@"state"] = r.state;
body[@"code"] = r.code;
body[@"type"] = @"SSOAuth.Resp";
NSLog(@"body = %@", [body description]);
[self sendEventWithName:WeChatWorkEventName body:body];
} else
/// 分享回调
if ([resp isKindOfClass:[WWKSendMessageResp class]]) {
WWKSendMessageResp *r = (WWKSendMessageResp *)resp;
NSMutableDictionary *body = [NSMutableDictionary new];
body[@"errCode"] = @(r.errCode);
body[@"errStr"] = r.errStr;
body[@"type"] = @"Share.Resp";
NSLog(@"body = %@", [body description]);
[self sendEventWithName:WeChatWorkEventName body:body];
}
}
[图片]