#include "AppDelegate.h" #include "GeneratedPluginRegistrant.h" #import "Autobonus-Swift.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; NSString *bundleIdentifier = [[NSBundle mainBundle] bundleIdentifier]; NSDictionary *settings = @{ @"com.dinect.checker.dinect.app" : @{ @"locale" : @"ru", @"flavor" : @"dinect", @"currency" : @643, @"supportPhone" : @"support@dinect.com", @"supportUrl" : @"http://www.dinect.com", @"endPoint" : @"https://pos-api.dinect.com/20130701/", @"appToken" : @"bdea0f3ba9034b688019a7cac753d1209e2b227f", @"appTitle" : @"Чекер", @"showBonus" : @YES, }, @"com.dinect.develop-iOS" : @{ @"locale" : @"ru", @"flavor" : @"dinect", @"currency" : @643, @"supportPhone" : @"support@dinect.com", @"supportUrl" : @"http://yandex.ru", @"endPoint" : @"https://pos-api-int.dinect.com/20130701/", @"appToken" : @"9fec83cdca38c357e6b65dbb17514cdd36bf2a08", @"appTitle" : @"Dinect (INT)", @"showBonus" : @YES, }, @"com.dinect.checker.dinect.app.ote" : @{ @"locale" : @"ru", @"flavor" : @"dinect", @"currency" : @643, @"supportPhone" : @"support@dinect.com", @"supportUrl" : @"http://www.dinect.com", @"endPoint" : @"https://pos-api-ote.dinect.com/20130701/", @"appToken" : @"9fec83cdca38c357e6b65dbb17514cdd36bf2a08", @"appTitle" : @"Чекер OTE", @"showBonus" : @YES, }, @"com.dinect.checker.autoclub.app" : @{ @"locale" : @"ru", @"flavor" : @"autobonus", @"currency" : @643, @"supportPhone" : @"Обратитесь к вашему региональному менеджеру", @"supportUrl" : @"https://www.auto-club.biz/coupons_new/contacts", @"endPoint" : @"https://pos-api-autoclub.dinect.com/20130701/", @"appToken" : @"bdea0f3ba9034b688019a7cac753d1209e2b227f", @"appTitle" : @"Autobonus", @"showBonus" : @NO, }, @"digital.joys.checker.app2" : @{ @"locale" : @"ru", @"flavor" : @"crypto", @"currency" : @643, @"supportPhone" : @"support@joys.digital", @"supportUrl" : @"https://joys.digital/", @"endPoint" : @"https://pos.api.joys.digital/20130701/", @"appToken" : @"bdea0f3ba9034b688019a7cac753d1209e2b227f", @"appTitle" : @"POSapp Joys", @"showBonus" : @YES, }, @"digital.joys.checker.int" : @{ @"locale" : @"ru", @"flavor" : @"crypto", @"currency" : @643, @"supportPhone" : @"support@joys.digital", @"supportUrl" : @"https://joys.digital/", @"endPoint" : @"https://pos-api-crypto-int.dinect.com/20130701/", @"appToken" : @"bdea0f3ba9034b688019a7cac753d1209e2b227f", @"appTitle" : @"POSapp Joys INT", @"showBonus" : @YES, }, @"digital.joys.checker.racib" : @{ @"locale" : @"ru", @"flavor" : @"racib", @"currency" : @643, @"supportPhone" : @"support@dinect.com", @"supportUrl" : @"http://www.dinect.com", @"endPoint" : @"https://pos-api.dinect.com/20130701/", @"appToken" : @"bdea0f3ba9034b688019a7cac753d1209e2b227f", @"appTitle" : @"Racib", @"showBonus" : @YES, }, }; NSDictionary *buildSettings = settings[bundleIdentifier]; if (!buildSettings) { NSLog(@"Settings for this bunndle id not defined (%@)", bundleIdentifier); abort(); } [platformChannel setMethodCallHandler:^(FlutterMethodCall* call, FlutterResult result) { NSLog(@"%@", call.method); if ([@"getLocale" isEqualToString:call.method]) { result(buildSettings[@"locale"]); } else if ([@"getFlavor" isEqualToString:call.method]) { result(buildSettings[@"flavor"]); } else if ([@"getCurrency" isEqualToString:call.method]) { result(buildSettings[@"currency"]); } else if ([@"startScanner" isEqualToString:call.method]) { ScannerViewController *modalViewController = [[ScannerViewController alloc] initWithStrings:call.arguments]; modalViewController.platformChannel = weekPlatformChannel; [controller presentViewController:modalViewController animated:YES completion:nil]; } else if ([@"isOnline" isEqualToString:call.method]) { result(@YES); } else if ([@"getSupportPhone" isEqualToString:call.method]) { result(buildSettings[@"supportPhone"]); } else if ([@"getSupportUrl" isEqualToString:call.method]) { result(buildSettings[@"supportUrl"]); } else if ([@"getEndpoint" isEqualToString:call.method]) { result(buildSettings[@"endPoint"]); } else if ([@"getAppToken" isEqualToString:call.method]) { result(buildSettings[@"appToken"]); } else if ([@"getAppTitle" isEqualToString:call.method]) { result(buildSettings[@"appTitle"]); } else if ([@"showBonus" isEqualToString:call.method]) { result(buildSettings[@"showBonus"]); } else if ([@"getVersionName" isEqualToString:call.method]) { result([[NSBundle mainBundle] objectForInfoDictionaryKey: @"CFBundleShortVersionString"]); } else { result(FlutterMethodNotImplemented); } }]; return [super application:application didFinishLaunchingWithOptions:launchOptions]; } @end