ios demo version
This commit is contained in:
@@ -6,24 +6,55 @@
|
||||
@implementation AppDelegate
|
||||
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||
|
||||
|
||||
[GeneratedPluginRegistrant registerWithRegistry:self];
|
||||
|
||||
|
||||
FlutterViewController* controller = (FlutterViewController*)self.window.rootViewController;
|
||||
|
||||
FlutterMethodChannel* scannerChannel = [FlutterMethodChannel
|
||||
methodChannelWithName:@"com.yourcompany.checker/scanner"
|
||||
FlutterMethodChannel* platformChannel = [FlutterMethodChannel
|
||||
methodChannelWithName:@"com.dinect.checker/instance_id"
|
||||
binaryMessenger:controller];
|
||||
|
||||
[scannerChannel setMethodCallHandler:^(FlutterMethodCall* call, FlutterResult result) {
|
||||
ScannerViewController *modalViewController = [ScannerViewController new];
|
||||
[controller presentViewController:modalViewController animated:YES completion:nil]; }];
|
||||
|
||||
|
||||
__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];
|
||||
}
|
||||
|
||||
- (void) showScanner {
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user