#pragma mark ----ios9.0之前的
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
{
return [UMSocialSnsService handleOpenURL:url];
}
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
NSString *urlStr = [NSString stringWithFormat:@"%@",url];
/**如果是返回的是微信 并且是支付 停留在微信支付页*/
if ([sourceApplication isEqualToString:@"com.tencent.xin"] && [urlStr containsString:@"pay"]) {
return [WXApi handleOpenURL:url delegate:self];
}
return [UMSocialSnsService handleOpenURL:url];
}
#pragma mark ----ios 9.0之后的回调方法
-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options
{
//可以通过option字典对象取出相应数据
NSString *callBack=[options objectForKey:UIApplicationOpenURLOptionsSourceApplicationKey] ;
if ([callBack isEqualToString:@"weixin"]&&[callBack containsString:@"pay"]) {
return [WXApi handleOpenURL:url delegate:self];
}
return [UMSocialSnsService handleOpenURL:url];
}