AppDelegate.m 1.1 KB

123456789101112131415161718192021222324252627
  1. #import "AppDelegate.h"
  2. #import "GeneratedPluginRegistrant.h"
  3. @implementation AppDelegate
  4. - (BOOL)application:(UIApplication *)application
  5. didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  6. [GeneratedPluginRegistrant registerWithRegistry:self];
  7. FlutterViewController *controller = (FlutterViewController*)self.window.rootViewController;
  8. FlutterMethodChannel *versionChannel = [FlutterMethodChannel methodChannelWithName:@"version" binaryMessenger:controller];
  9. [versionChannel setMethodCallHandler:^(FlutterMethodCall * _Nonnull call, FlutterResult _Nonnull result) {
  10. if ([call.method isEqualToString:@"jumpAppStore"]) {
  11. NSURL *appUrl = [NSURL URLWithString:@"http://itunes.apple.com/us/app/id1112069772"];
  12. [UIApplication.sharedApplication openURL:appUrl];
  13. }else{
  14. result(FlutterMethodNotImplemented);
  15. }
  16. }];
  17. // Override point for customization after application launch.
  18. return [super application:application didFinishLaunchingWithOptions:launchOptions];
  19. }
  20. @end