Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with Phonegap Build? #26

Closed
Papasmurfo opened this issue Mar 21, 2014 · 19 comments
Closed

Not working with Phonegap Build? #26

Papasmurfo opened this issue Mar 21, 2014 · 19 comments

Comments

@Papasmurfo
Copy link

Is this not working with Phonegap build?

Currently trying to change my status bar colour, with the following code:

    <gap:plugin name="com.phonegap.plugin.statusbar" />
    <preference name="StatusBarBackgroundColor" value="#4e9fd5" />

Is there any specific order I should be putting these in or in certain places?

Thanks for the plugin! Any help is greatly appreciated,

Jonathan

@wildabeast
Copy link
Member

The StatusBarBackgroundColor and StatusBarOverlaysWebView preference tags are not yet supported by PhoneGap Build (in the readme).

Try this instead:

function deviceReady() {
    StatusBar.backgroundColorByHexString("#4e9fd5");
}
document.addEventListener('deviceready', deviceReady, false);

@Papasmurfo
Copy link
Author

Thanks will give it a try!

On Friday, March 21, 2014, Ryan Willoughby notifications@github.com wrote:

The StatusBarBackgroundColor and StatusBarOverlaysWebView preference tags
are not yet supported by PhoneGap Build (in the readmehttps://github.com/phonegap-build/StatusBarPlugin#preferences
).

Try this instead:

function deviceReady() {
StatusBar.backgroundColorByHexString("#4e9fd5");
}
document.addEventListener('deviceready', deviceReady, false);

Reply to this email directly or view it on GitHubhttps://github.com//issues/26#issuecomment-38312316
.

@Papasmurfo
Copy link
Author

This code makes the background of the status bar 'black' with black text.

Is there any other code that could be a work around?

Thanks again for the help,

Jonathan

@igos
Copy link

igos commented Mar 28, 2014

When it will be supported by Phonegap build?

@wildabeast
Copy link
Member

@Papasmurfo What are you trying to achieve? If you want black with white text, check the docs:

StatusBar.backgroundColorByHexString("#4e9fd5");
StatusBar.styleLightContent();

@wildabeast
Copy link
Member

@igos not entirely sure -- its on the backlog but not a priority, since you can easily work around it by setting these values via javascript instead.

@Papasmurfo
Copy link
Author

Hi Ryan,

I tried the code that you supplied but the background colour doesn't work,
but it does "kind" of work as it changes the background to black? With
black text?

Any help is greatly appreciated,

Jonathan

On Friday, March 28, 2014, Ryan Willoughby notifications@github.com wrote:

@Papasmurfo https://github.com/Papasmurfo What are you trying to
achieve? If you want black with white text, check the docshttps://github.com/phonegap-build/StatusBarPlugin/blob/master/README.md
:

StatusBar.backgroundColorByHexString("#4e9fd5");
StatusBar.styleLightContent();

Reply to this email directly or view it on GitHubhttps://github.com//issues/26#issuecomment-38964619
.

@wildabeast
Copy link
Member

@Papasmurfo did you try:

StatusBar.styleLightContent();

@Papasmurfo
Copy link
Author

Yes - copy and pasted the code you supplied before. I think it was wrapped
in a function.

Thanks again,

Jonathan

On Friday, March 28, 2014, Ryan Willoughby notifications@github.com wrote:

@Papasmurfo https://github.com/Papasmurfo did you try
StatusBar.styleLightContent();

Reply to this email directly or view it on GitHubhttps://github.com//issues/26#issuecomment-38964927
.

@wildabeast
Copy link
Member

Is this on PhoneGap Build? Can you share your App ID?

@Papasmurfo
Copy link
Author

Yes, would you be able to supply your email so I can throw you the whole JS
file and then we can post the resolution here.

Jonathan

On Friday, March 28, 2014, Ryan Willoughby notifications@github.com wrote:

Is this on PhoneGap Build? Can you share your App ID?

Reply to this email directly or view it on GitHubhttps://github.com//issues/26#issuecomment-38965150
.

@wildabeast
Copy link
Member

Please send it to build at phonegap.com

@Papasmurfo
Copy link
Author

Ah - I'll just post the code here but essentially in my main.js file I have
the following.

function deviceReady() {
StatusBar.backgroundColorByHexString("#4e9fd5");
}
document.addEventListener('deviceready', deviceReady, false);

This seems to create a black bar with black text for some reason.

On Friday, March 28, 2014, Ryan Willoughby
<notifications@github.comjavascript:_e(%7B%7D,'cvml','notifications@github.com');>
wrote:

Please send it to build at phonegap.com

Reply to this email directly or view it on GitHubhttps://github.com//issues/26#issuecomment-38965413
.

@wildabeast
Copy link
Member

I can't really do much with that without seeing the context. Please send me your PhoneGap Build app ID to build at phonegap.com.

@Papasmurfo
Copy link
Author

Will do Ryan. Thanks again for helping our with this one.

Best,

Jonathan

On Friday, March 28, 2014, Ryan Willoughby notifications@github.com wrote:

I can't really do much with that without seeing the context. Please send
me your PhoneGap Build app ID to build at phonegap.com.

Reply to this email directly or view it on GitHubhttps://github.com//issues/26#issuecomment-38966147
.

@wildabeast
Copy link
Member

@Papasmurfo haven't heard from you, closing this issue. Let me know if I missed an email.

@sfentress
Copy link

@wildabeast I can replicate @Papasmurfo's bug on Phonegap build. Here's my build: https://build.phonegap.com/apps/951372/builds

I am trying to call StatusBar.backgroundColorByHexString("#FFFFFF"); but instead I get a black statusbar with black text.

As far as I can tell, StatusBar is never defined -- if I use Phonegap Build's debug view I get ReferenceError: Can't find variable: StatusBar

sfentress added a commit to sfentress/smartgraphs-phonegap that referenced this issue Jun 9, 2014
…o white

Latest StatusBar plugin seems to not work correctly with PhoneGap-build.

See e.g. phonegap-build/StatusBarPlugin#26
@sfentress
Copy link

I was able to fix this by switching to version 1.0.1 of the plugin. Using the earlier version, I can now access the StatusBar JS object, and set the background color to white.

@omnoms
Copy link

omnoms commented Jul 1, 2015

Yeah, I have the same issue. StatusBar is undefined in the global scope for javascript in the latest. Had to revert to 1.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants