Created
January 11, 2019 07:49
-
-
Save happyharis/b540629dd28c9153f8679e5be2fdab9f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Flutter/Flutter.h> | |
#import "GeneratedPluginRegistrant.h" | |
#import <UXCam/UXCam.h> // Don't forget to import | |
@implementation AppDelegate | |
- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { | |
FlutterViewController* controller = (FlutterViewController*)self.window.rootViewController; | |
FlutterMethodChannel* uxcamChannel = [FlutterMethodChannel | |
methodChannelWithName:@"com.ur.app/uxcam" // Your methodChannel name | |
binaryMessenger:controller]; | |
[uxcamChannel setMethodCallHandler:^(FlutterMethodCall* call, FlutterResult result) { | |
if ([@"init" isEqualToString:call.method]) { | |
NSString *userAPIKey = call.arguments[@"apiKey"]; | |
[UXCam startWithKey:userAPIKey]; | |
} | |
}]; | |
[GeneratedPluginRegistrant registerWithRegistry:self]; | |
return [super application:application didFinishLaunchingWithOptions:launchOptions]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment