You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.5 KiB

4 years ago
#import "AppDelegate.h"
#import "GeneratedPluginRegistrant.h"
3 years ago
4 years ago
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[GeneratedPluginRegistrant registerWithRegistry:self];
// Override point for customization after application launch.
3 years ago
3 years ago
FlutterViewController* controller = (FlutterViewController*)self.window.rootViewController;
__block NSDictionary *remoteNotification = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
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 (remoteNotification != NULL) {
result(remoteNotification[@"custom"]);
remoteNotification = nil;
}
result(@"");
}
if ([method isEqual:@"toAppStore"]) {
NSString *appURL = @"https://itunes.apple.com/cn/app/1575124838?action=write-review";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:appURL]];
result(@"");
}
//result(FlutterMethodNotImplemented);
}];
3 years ago
3 years ago
return [super application:application didFinishLaunchingWithOptions:launchOptions];
4 years ago
}
3 years ago
@end