|
|
|
@ -85,7 +85,7 @@
|
|
|
|
|
} |
|
|
|
|
result(@""); |
|
|
|
|
} |
|
|
|
|
if (condition[method isEqual:@"toAppStore"]) { |
|
|
|
|
if ([method isEqual:@"toAppStore"]) { |
|
|
|
|
NSString *appURL = @"https://itunes.apple.com/cn/app/1575124838?action=write-review"; |
|
|
|
|
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:appURL]]; |
|
|
|
|
result(@""); |
|
|
|
@ -97,22 +97,33 @@
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler { |
|
|
|
|
NSLog(@"%@", userActivity.webpageURL); |
|
|
|
|
NSLog(@"%@", [userActivity.webpageURL.query componentsSeparatedByString:@"="][0]); |
|
|
|
|
NSLog(@"%@", [userActivity.webpageURL.query componentsSeparatedByString:@"="][1]); |
|
|
|
|
__block NSString *custom = [userActivity.webpageURL.query componentsSeparatedByString:@"="][1]; |
|
|
|
|
NSLog(@"userActivity%@", userActivity.webpageURL); |
|
|
|
|
|
|
|
|
|
NSArray *params = [userActivity.webpageURL.query componentsSeparatedByString:@"&"]; |
|
|
|
|
|
|
|
|
|
__block NSString *customParam = @""; |
|
|
|
|
|
|
|
|
|
for (NSString *string in params) { |
|
|
|
|
NSLog(@"userActivity%@", string); |
|
|
|
|
NSArray *array =[string componentsSeparatedByString:@"="]; |
|
|
|
|
if ([array[0] isEqual:@"id"]) { |
|
|
|
|
customParam = [NSString stringWithFormat:@"{\"typed\":1,\"info\":\"%@\"}", array[1]]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
NSLog(@"userActivity%@", customParam); |
|
|
|
|
FlutterViewController* controller = (FlutterViewController*)self.window.rootViewController; |
|
|
|
|
FlutterMethodChannel* bridgeAppChannel = [FlutterMethodChannel methodChannelWithName:@"bridge" binaryMessenger:(NSObject<FlutterBinaryMessenger> *)controller]; |
|
|
|
|
[bridgeAppChannel setMethodCallHandler:^(FlutterMethodCall * _Nonnull call, FlutterResult _Nonnull result) { |
|
|
|
|
NSString * method = call.method; |
|
|
|
|
if ([method isEqual:@"action"]) { |
|
|
|
|
if (custom != NULL) { |
|
|
|
|
result(custom); |
|
|
|
|
custom = @""; |
|
|
|
|
if (customParam != NULL) { |
|
|
|
|
result(customParam); |
|
|
|
|
customParam = @""; |
|
|
|
|
} |
|
|
|
|
result(@""); |
|
|
|
|
} |
|
|
|
|
if (condition[method isEqual:@"toAppStore"]) { |
|
|
|
|
if ([method isEqual:@"toAppStore"]) { |
|
|
|
|
NSString *appURL = @"https://itunes.apple.com/cn/app/1575124838?action=write-review"; |
|
|
|
|
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:appURL]]; |
|
|
|
|
result(@""); |
|
|
|
|