@@ -51,20 +51,35 @@ - (void) show:(CDVInvokedUrlCommand*)command {
5151 }
5252
5353 NSString *tintColor = options[@" tintColor" ];
54+ NSString *controlTintColor = options[@" controlTintColor" ];
55+ NSString *barColor = options[@" barColor" ];
56+
57+ // if only tintColor is set, use that as the controlTintColor for iOS 10
58+ if (barColor == nil && controlTintColor == nil ) {
59+ controlTintColor = tintColor;
60+ } else if (tintColor == nil ) {
61+ tintColor = controlTintColor;
62+ }
63+
5464 if (tintColor != nil ) {
55- #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 100000 // iOS 10.0 supported
56- vc.preferredControlTintColor = [self colorFromHexString: options[@" tintColor" ]];
57- #else
58- vc.view .tintColor = [self colorFromHexString: options[@" tintColor" ]];
59- #endif
65+ #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 // iOS 10.0 supported (compile time)
66+ if (IsAtLeastiOSVersion (@" 10" )) { // iOS 10.0 supported (runtime)
67+ vc.preferredControlTintColor = [self colorFromHexString: controlTintColor];
68+ } else {
69+ vc.view .tintColor = [self colorFromHexString: tintColor];
70+ }
71+ #else
72+ vc.view .tintColor = [self colorFromHexString: tintColor];
73+ #endif
6074 }
6175
62- NSString *barColor = options[ @" barColor " ];
63- if (barColor != nil ) {
64- # if __IPHONE_OS_VERSION_MAX_ALLOWED >= 100000 // iOS 10.0 supported
65- vc.preferredBarTintColor = [self colorFromHexString: options[ @" barColor" ] ];
66- # endif
76+ # if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 // iOS 10.0 supported
77+ if (IsAtLeastiOSVersion ( @" 10 " )) { // iOS 10.0 supported (runtime)
78+ if (barColor != nil ) {
79+ vc.preferredBarTintColor = [self colorFromHexString: barColor];
80+ }
6781 }
82+ #endif
6883
6984 CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsDictionary: @{@" event" :@" opened" }];
7085 [pluginResult setKeepCallback: [NSNumber numberWithBool: YES ]];
0 commit comments