flutter/examples/hello_services/ios/HelloServices/AppDelegate.m
Adam Barth 0b6df634af Polish HostMessages (#4515)
Cleans up a few style nits in hello_services and adds support for automatic
JSON encoding and decoding to the HostMessages interface.
2016-06-10 15:04:01 -07:00

29 lines
1.1 KiB
Objective-C

// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "AppDelegate.h"
#import <Flutter/Flutter.h>
#import "LocationProvider.h"
@implementation AppDelegate {
LocationProvider* _locationProvider;
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
FlutterDartProject* project = [[FlutterDartProject alloc] initFromDefaultSourceForConfiguration];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
FlutterViewController* flutterController = [[FlutterViewController alloc] initWithProject:project
nibName:nil
bundle:nil];
_locationProvider = [[LocationProvider alloc] init];
[flutterController addMessageListener:_locationProvider];
self.window.rootViewController = flutterController;
[self.window makeKeyAndVisible];
return YES;
}
@end