defined configuration for build variants
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include "AppDelegate.h"
|
||||
#include "GeneratedPluginRegistrant.h"
|
||||
#import "Runner-Swift.h"
|
||||
#import "Autobonus-Swift.h"
|
||||
#import "ZBarSDK.h"
|
||||
|
||||
@implementation AppDelegate
|
||||
@@ -16,38 +16,94 @@
|
||||
binaryMessenger:controller];
|
||||
|
||||
__weak FlutterMethodChannel* weekPlatformChannel = platformChannel;
|
||||
|
||||
NSString *bundleIdentifier = [[NSBundle mainBundle] bundleIdentifier];
|
||||
|
||||
NSDictionary *settings = @{
|
||||
@"com.dinect.checker.dinect" : @{
|
||||
@"locale" : @"ru",
|
||||
@"flavor" : @"dinect",
|
||||
@"currency" : @643,
|
||||
@"supportPhone" : @"8-800-77-55-032",
|
||||
@"supportUrl" : @"http://www.dinect.com",
|
||||
@"endPoint" : @"https://pos-api.dinect.com/20130701/",
|
||||
@"appToken" : @"bdea0f3ba9034b688019a7cac753d1209e2b227f",
|
||||
@"appTitle" : @"Dinect",
|
||||
@"showBonus" : @YES,
|
||||
},
|
||||
@"com.dinect.develop" : @{
|
||||
@"locale" : @"ru",
|
||||
@"flavor" : @"develop",
|
||||
@"currency" : @643,
|
||||
@"supportPhone" : @"8 800 555 35 35",
|
||||
@"supportUrl" : @"http://yandex.ru",
|
||||
@"endPoint" : @"https://pos-api-int.dinect.com/20130701/",
|
||||
@"appToken" : @"9fec83cdca38c357e6b65dbb17514cdd36bf2a08",
|
||||
@"appTitle" : @"Autobonus (develop)",
|
||||
@"showBonus" : @YES,
|
||||
},
|
||||
@"com.dinect.checker.autoclub" : @{
|
||||
@"locale" : @"ru",
|
||||
@"flavor" : @"autobonus",
|
||||
@"currency" : @643,
|
||||
@"supportPhone" : @"8-800-234-6064",
|
||||
@"supportUrl" : @"https://www.auto-club.biz",
|
||||
@"endPoint" : @"https://pos-api-autoclub.dinect.com/20130701/",
|
||||
@"appToken" : @"bdea0f3ba9034b688019a7cac753d1209e2b227f",
|
||||
@"appTitle" : @"Autobonus",
|
||||
@"showBonus" : @NO,
|
||||
},
|
||||
@"com.dinect.checker.pip" : @{
|
||||
@"locale" : @"ua",
|
||||
@"flavor" : @"pip",
|
||||
@"currency" : @980,
|
||||
@"supportPhone" : @"+38 080 030 9997\n+38 044 390 1697",
|
||||
@"supportUrl" : @"http://discount.kiev.ua/",
|
||||
@"endPoint" : @"https://pos-api.discount.kiev.ua/20130701/",
|
||||
@"appToken" : @"bdea0f3ba9034b688019a7cac753d1209e2b227f",
|
||||
@"appTitle" : @"PIP",
|
||||
@"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);
|
||||
|
||||
// NSDictionary *dict = [[NSProcessInfo processInfo] environment];
|
||||
// NSLog(@"%@", dict);
|
||||
NSLog(@"%@", buildSettings[@"supportPhone"]);
|
||||
|
||||
if ([@"getLocale" isEqualToString:call.method]) {
|
||||
result(@"ru");
|
||||
result(buildSettings[@"locale"]);
|
||||
} else if ([@"getFlavor" isEqualToString:call.method]) {
|
||||
result(@"autobonus");
|
||||
result(buildSettings[@"flavor"]);
|
||||
} else if ([@"getCurrency" isEqualToString:call.method]) {
|
||||
result(@643);
|
||||
result(buildSettings[@"currency"]);
|
||||
} 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");
|
||||
result(buildSettings[@"supportPhone"]);
|
||||
} else if ([@"getSupportUrl" isEqualToString:call.method]) {
|
||||
result(@"http://yandex.ru/");
|
||||
result(buildSettings[@"supportUrl"]);
|
||||
} else if ([@"getEndpoint" isEqualToString:call.method]) {
|
||||
result(@"https://pos-api-int.dinect.com/20130701/");
|
||||
result(buildSettings[@"endPoint"]);
|
||||
} else if ([@"getAppToken" isEqualToString:call.method]) {
|
||||
result(@"9fec83cdca38c357e6b65dbb17514cdd36bf2a08");
|
||||
result(buildSettings[@"appToken"]);
|
||||
} else if ([@"getAppTitle" isEqualToString:call.method]) {
|
||||
result(@"Autobonus");
|
||||
result(buildSettings[@"appTitle"]);
|
||||
} else if ([@"showBonus" isEqualToString:call.method]) {
|
||||
result(@YES);
|
||||
result(buildSettings[@"showBonus"]);
|
||||
} else {
|
||||
result(FlutterMethodNotImplemented);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13173"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
@@ -14,9 +18,9 @@
|
||||
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
|
||||
Reference in New Issue
Block a user