Skip to content

Plugin fails on iOS if androidTranslucentStatusBar="true" #23

@shripalsoni04

Description

@shripalsoni04

First of all 👍 for this nice plugin.

When I set androidTranslucentStatusBar="true" on Slides:SlideContainer tag, on android it is working fine but on iOS its giving me below error:

file:///app/tns_modules/nativescript-slides/nativescript-slides.js:215:47: JS ERROR TypeError: undefined is not an object (evaluating 'app.android.startActivity'

After digging into code, If found the issue in constructView funciton at below line:
if (this.androidTranslucentStatusBar === true || this._androidTranslucentNavBar === true && app.android && Platform.device.sdkVersion >= '19') {

As || precedence is lower than &&, if androidTranslucentStatusBar is true, the condition will be true and it will try to execute android specific code on iOS and is giving error.

Changing that condition to below, it is working fine.
if(app.android && Platform.device.sdkVersion >= '19' && (this.androidTranslucentStatusBar === true || this._androidTranslucentNavBar === true ))

If it is ok, please correct it in the source code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions