Instantly share code, notes, and snippets.

Embed
What would you like to do?
#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