#include "AppDelegate.h" #include "GeneratedPluginRegistrant.h" #import "Runner-Swift.h" #import "ZBarSDK.h" @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [GeneratedPluginRegistrant registerWithRegistry:self]; FlutterViewController* controller = (FlutterViewController*)self.window.rootViewController; FlutterMethodChannel* platformChannel = [FlutterMethodChannel methodChannelWithName:@"com.dinect.checker/instance_id" binaryMessenger:controller]; __weak FlutterMethodChannel* weekPlatformChannel = platformChannel; [platformChannel setMethodCallHandler:^(FlutterMethodCall* call, FlutterResult result) { NSLog(@"%@", call.method); // NSDictionary *dict = [[NSProcessInfo processInfo] environment]; // NSLog(@"%@", dict); if ([@"getLocale" isEqualToString:call.method]) { result(@"ru"); } else if ([@"getFlavor" isEqualToString:call.method]) { result(@"autobonus"); } else if ([@"getCurrency" isEqualToString:call.method]) { result(@643); } else if ([@"startScanner" isEqualToString:call.method]) { ScannerViewController *modalViewController = [ScannerViewController new]; modalViewController.platformChannel = weekPlatformChannel; [controller presentViewController:modalViewController animated:YES completion:nil]; // [weekPlatformChannel invokeMethod:@"purchase" arguments:@[@"semyon", @"49492872388755"]]; } else if ([@"isOnline" isEqualToString:call.method]) { result(@YES); } else if ([@"getSupportPhone" isEqualToString:call.method]) { result(@"8 800 555 35 35"); } else if ([@"getSupportUrl" isEqualToString:call.method]) { result(@"http://yandex.ru/"); } else if ([@"getEndpoint" isEqualToString:call.method]) { result(@"https://pos-api-int.dinect.com/20130701/"); } else if ([@"getAppToken" isEqualToString:call.method]) { result(@"9fec83cdca38c357e6b65dbb17514cdd36bf2a08"); } else if ([@"getAppTitle" isEqualToString:call.method]) { result(@"Autobonus"); } else if ([@"showBonus" isEqualToString:call.method]) { result(@YES); } else { result(FlutterMethodNotImplemented); } }]; return [super application:application didFinishLaunchingWithOptions:launchOptions]; } @end