Skip to content

Instantly share code, notes, and snippets.

@happyharis
Created January 11, 2019 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save happyharis/b540629dd28c9153f8679e5be2fdab9f to your computer and use it in GitHub Desktop.
Save happyharis/b540629dd28c9153f8679e5be2fdab9f to your computer and use it in GitHub Desktop.
#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