Skip to content

Platform Specific Configurations

Basic Usage

If you want to configure only a specific platform like Android or iOS, you can add the platform attribute in the root of your config.json:

{
    "name": "Client",
    "eamType": "maximo",
    "platform": {
        "android": {
            "name": "Android Client",
            "pushNotifications": true
        },
        "ios": {
            "name": "iOS Client"
        }
    }
}

This example ensures that the client name becomes Android Client when it is used on an Android device. It also enables pushNotifications only for the Android platform.

Supported Platforms

Supported Platform Usage in platform property
Android android
iOS ios
Electron electron
Browser browser

Override property values for a specific platform

You can override any root value in your config.json by defining a different value for the desired platform. The example below overrides the barcode object when the platform is browser:

Original config.json

{
    "name": "Client",
    "eamType": "maximo",
    "barcode": {
        "aspectRatio": 1
    },
    "platform": {
        "android": {
            "name": "Android Client"
        },
        "ios": {
            "name": "iOS Client"
        },
        "browser": {
            "barcode": {
                "aspectRatio": 1.777778,
                "focusMode": "continuous",
                "videoConstraints": {
                    "facingMode": "environment",
                    "width": 1920,
                    "height": 1080
                }
            }
        }
    }
}

Applied Configuration on Browser:

{
    "name": "Client",
    "eamType": "maximo",
    "barcode": {
        "aspectRatio": 1.777778,
        "focusMode": "continuous",
        "videoConstraints": {
            "facingMode": "environment",
            "width": 1920,
            "height": 1080
        }
    },
    "platform": {
        "android": {
            "name": "Android Client"
        },
        "ios": {
            "name": "iOS Client"
        },
        "browser": {
            "barcode": {
                "aspectRatio": 1.777778,
                "focusMode": "continuous",
                "videoConstraints": {
                    "facingMode": "environment",
                    "width": 1920,
                    "height": 1080
                }
            }
        }
    }
}

Remove a root property by setting it to null

You can remove any root property by using the null value in your platform. The example below removes the property pushNotifications of root, because it's value is set to null.

Original config.json

{
    "name": "Client",
    "eamType": "maximo",
    "pushNotifications": true,
    "platform": {
        "android": {
            "name": "Android Client",
            "pushNotifications": null
        }
    }
}

Applied Configuration on Android:

{
    "name": "Client",
    "eamType": "maximo",
    "platform": {
        "android": {
            "name": "Android Client",
            "pushNotifications": null
        }
    }
}