标签:
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url NS_DEPRECATED_IOS(2_0, 9_0, "Please use application:openURL:options:") __TVOS_PROHIBITED; - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(nullable NSString *)sourceApplication annotation:(id)annotation NS_DEPRECATED_IOS(4_2, 9_0, "Please use application:openURL:options:") __TVOS_PROHIBITED; - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options NS_AVAILABLE_IOS(9_0); // no equiv. notification. return NO if the application can‘t open for some reason
从上面的API能看出, iOS9之后从其他app回到自己app的时候回调的方法已经变成最后一个了..
所以需要在AppDelegate中重写该方法, 例如:
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { // 监听linePay付款完后wap界面跳转 [self handleOpenFromLinePayWithUrl:url]; return YES; } - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options { // 监听linePay付款完后wap界面跳转 [self handleOpenFromLinePayWithUrl:url]; return YES; }
注意: iOS9以下还是会回调application:application openURL: sourceApplication: annotation: 这个方法, 所以这两个方法都得重写..
iOS9 application:application openURL: sourceApplication: annotation: 方法不执行
标签:
原文地址:http://www.cnblogs.com/Rinpe/p/5560413.html