phonegap / build

This is the public repository for PhoneGap Build source and bug tracking
92 stars 33 forks source link

Settings in config.xml seem to have no effect for cordova-plugin-statusbar #621

Open andersborgabiro opened 6 years ago

andersborgabiro commented 6 years ago

This was previously posted to Apache Jira (https://issues.apache.org/jira/browse/CB-13792), but I got this response from jcesarmobile regarding the issue, so you get the background:


I've been able to reproduce your issue in Phonegap Build with this sample project https://github.com/jcesarmobile/cordova-plugin-statusbar-sample.

But this issue tracker is about Cordova, not Phonegap Build, and I've verified that preferences are working fine in Cordova CLI 8.0.0, so you'll have to report the issue on the Phonegap Build issue tracker or tell them in their forums.

BTW, the problem is not that the plugin ignores the preferences, the problem is the preferences get duplicated because the plugin writes the default preferences in the config.xml below your preferences, and the last value is taken into account instead of yours.

it works fine in PGB with cli 6.5.0


My issue with cordova-plugin-statusbar, that might (?) apply to other settings as well:

These settings seem to do nothing at all on iOS:

(the status bar still overlays the app window and colors are not changed)

I need to do this to get the intended effect:

StatusBar.overlaysWebView(false); StatusBar.backgroundColorByHexString("#ffffff"); StatusBar.styleDefault();

This behavior is not obvious to me from reading the documentation.

As there's a workaround with dynamic settings, it's not a showstopper, but the drawback is that the dynamic setting is not done until Cordova is ready, so there's some "jerkiness" to the UX.

Cheers,

Anders

jcesarmobile commented 6 years ago

There was a bug like this affecting Cordova, but was fixed in Cordova Lib 6.1.0. Not sure how it can affect Phonegap Build when using the 7.1.0 CLI https://issues.apache.org/jira/browse/CB-9264

andersborgabiro commented 6 years ago

Maybe some parts are forks from older versions.

MulderWH commented 6 years ago

I have this issue too, see https://forums.adobe.com/thread/2443968 Please note that if I build the same package with xcode, the app is working as expected.

sullivanets1 commented 6 years ago

I have this same problem with Phonegap Build when using the 7.1.0 CLI - I am using the javascript workaround mentioned in first post but the "jerkiness" to the UX is bad.

andersborgabiro commented 6 years ago

True. The code doesn't run until deviceready is fired, so it gets a bit jumpy. Hopefully they'll fix it soon.

thomeijken commented 6 years ago

Having this issue as well. Hope it will be fixed soon as we are unable to update to PGB 7 or 8 because of this. Setting the statusbar dynamically leads to other issues unfortunately.

bfabbri commented 6 years ago

Hi guys, do we have any news about that problem?

I'm also having it and unfortunately I can't downgrade to PGB 6.5.0 because I'm using cordova-plugin-geolocation plugin and Apple forces me to tell my users why I want to have their location (I need that to show them near places to use my app, it doesn't work without the location..)

As long as I know, only PGB > 6.5.0 is capable of dealing with the edit-config used to inform the user:

<edit-config target="NSLocationWhenInUseUsageDescription" file="*-Info.plist" mode="merge".>

YOUR MESSAGE HERE Right? Do anyone see a workaround? Or, has anyone solved the statusbar problem? Thanks
michelvh commented 6 years ago

I've created a fork in which I've changed the default value to false, and changed my apps config.xml to reference the fork:

<plugin spec="https://github.com/timetocodeNL/cordova-plugin-statusbar.git#8b4acd2e56a01cd22a240668d3c269e129764b6b" />

After building, the config.xml in the built IPA does not contain the override :)

jcesarmobile commented 6 years ago

@bfabbri it should work with CLI 6.5.0 too.

Or you can also downgrade geolocation plugin to 2.4.3 and use the plugin params

matejicekme commented 6 years ago

Same issue here, working ok on cordova but not with phonegap build (cli v 7.0.1)

andersborgabiro commented 6 years ago

No one's picked this up yet? Bummer! Is it possible to escalate?

ibrent commented 6 years ago

Urugghh. So many work-arounds using PhoneGap Build. It's still not working as documented.

gregtzar commented 5 years ago

Confirmed that we are effected by this bug and have had to stop using phonegap and go back to the cordova CLI because of it (our process uses a shared javascript codebase across multiple apps and depends on being able to use the config.xml file to, well... configure each app). PhoneGap Build overwrites the properties for cordova-plugin-statusbar when they are specified in config.xml, and the workaround of setting them via the deviceready event does work. Cordova CLI respects the config.xml, problem is phonegap build. Eight months later and I sure am glad I'm not paying adobe any money for a broken service.

ibrent commented 5 years ago

You may want to check out www.nativescript.org

jcesarmobile commented 5 years ago

@ibrent, please, don’t spam on issues. I don’t see how that comment fits into this conversation.

sultan-arshi commented 5 years ago

also having same problem any one fixed it ?

EdgarKooren commented 4 years ago

I ran into this problem asswell, can anybody conform that this issue is fixed ?

ibrent commented 4 years ago

It was a year ago etc, but playing with the config tags worked for me.

CONFIG `

<plugin name="cordova-plugin-whitelist" source="npm" spec="~1.2.1" />`

Then I could change the statusbar color using CSS. Good luck!

gregtzar commented 4 years ago

Yes for those asking this issue still exists. Adobe is not known for fixing bugs, especially old ones, so I would not count on this ever being fixed (at least not on purpose). I implemented a permanent workaround by setting the statusbar properties dynamically at runtime via javascript to what I need.

ibrent commented 4 years ago

It was 'little' things like this which added up to a heaping pile of work-arounds and leading me to seek other technical solutions to using web tech for native apps.

alphakordesign commented 4 years ago

Looks like this issue is not fixed yet.

dibydrams commented 4 years ago

😔

tamvcspk commented 4 years ago

When I change the config in config.xml. I have to re-add the platform for my app to take effect.

andersborgabiro commented 4 years ago

@tamvcspk What do you mean by re-add?

You need to upload the application again to PhoneGap Build, whatever changes you make, but are you building locally (via Cordova or PhoneGap CLI)?

tamvcspk commented 4 years ago

Re-add means remove then add again ios platform (sorry for my English). Now I understand that there's some config that is not dynamic (e.g: "name").