之前微信支付成功或者失败 都会走- (void)onResp:(BaseResp*)resp;这个回调方法。
新版的SDK需要配置深度链接UniversalLink,走下面的回调方法
- (BOOL)application:(UIApplication*)applicationcontinueUserActivity:(NSUserActivity*)userActivityrestorationHandler:(void(^)(NSArray<id> *__nullablerestorableObjects))restorationHandler {
// NSLog(@"continueUserActiity enter");
// NSLog(@"\tAction Type : %@", userActivity.activityType);
// NSLog(@"\tURL : %@", userActivity.webpageURL);
// NSLog(@"\tuserinfo :%@",userActivity.userInfo);
//
// NSLog(@"continueUserActiity exit");
// restorationHandler(nil);
//
// NSHTTPCookieStorage *sharedHTTPCookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
// NSArray *cookies = [sharedHTTPCookieStorage cookiesForURL:userActivity.webpageURL];
//
// NSLog(@"COOKIE{name: %@", cookies);
NSArray *array = [[NSString stringWithFormat:@"%@",userActivity.webpageURL] componentsSeparatedByString:@"ret="]; //从字符d中分隔成2个元素的数组
NSString*code = [NSString stringWithFormat:@"%@",[array lastObject]];
[PAYMANAGER fl_handlePay: [codeintegerValue]];
return [WXApi handleOpenUniversalLink:userActivity delegate:self];
}
网友评论