AppDelegate.m 1012 Bytes
Newer Older
Ian Hickson's avatar
Ian Hickson committed
1 2 3 4
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5 6
#import "AppDelegate.h"
#import "GeneratedPluginRegistrant.h"
7 8 9 10 11 12 13 14

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  [GeneratedPluginRegistrant registerWithRegistry:self];
  // Override point for customization after application launch.
  FlutterViewController* controller = (FlutterViewController*)self.window.rootViewController;
  FlutterMethodChannel* flavorChannel = [FlutterMethodChannel methodChannelWithName:@"flavor" binaryMessenger:controller];
15

16 17 18 19 20 21 22 23
  [flavorChannel setMethodCallHandler:^(FlutterMethodCall *call, FlutterResult result) {
    NSString* flavor = (NSString*)[[NSBundle mainBundle].infoDictionary valueForKey:@"Flavor"];
    result(flavor);
  }];
  return [super application:application didFinishLaunchingWithOptions:launchOptions];
}

@end