ionic framework – iOS System Popup force custom Light or Dark Mode


Opening external system bluetooth picker for pairing, modal theme is picked from system set theme.

EAAccessoryManager *m= [EAAccessoryManager sharedAccessoryManager];
[m showBluetoothAccessoryPickerWithNameFilter : nil completion:^(NSError* error){
        CDVPluginResult* pluginResult = nil;
        if(error){
            NSLog(@"error picker: %@", error);
            pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_ERROR messageAsString: @""];
            [self.commandDelegate sendPluginResult: pluginResult callbackId: command.callbackId];
        }else{
            pluginResult = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsString: @"OK"];
        }
        
        [self.commandDelegate sendPluginResult: pluginResult callbackId: command.callbackId];
}];

Note that updating in plist with below config changes the theme, but its static.

Appearance : Light

Using ionic webview for iOS App, have tried overriding style, but still takes theme from system set value

BOOL someCondition=YES;
if (@available(iOS 13.0, *)) {
    UIUserInterfaceStyle style = someCondition ? UIUserInterfaceStyleLight : UIUserInterfaceStyleDark;
    self.viewController.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    wkWebView.overrideUserInterfaceStyle= UIUserInterfaceStyleLight;
    
}

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img