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

Browser platform not working #86

Closed
Hexodus opened this issue Jan 2, 2017 · 13 comments
Closed

Browser platform not working #86

Hexodus opened this issue Jan 2, 2017 · 13 comments

Comments

@Hexodus
Copy link

Hexodus commented Jan 2, 2017

I installed the plugin correctly and got the desired result on Android but not in the browser version.

When I run the following code:

 cordova.getAppVersion.getVersionNumber(function (version) {
      alert(version);
     });

This trows the error:

Error: exec proxy not found for :: AppVersion :: getVersionNumber

Am I doing something wrong or isn't really working with the browser platform?

@jvjvjv
Copy link

jvjvjv commented May 1, 2017

Browser platform is not supported, it appears. iOS, Android, Windows are the only supported platforms.

@nikmartin
Copy link

What version would you expect this plugin to return in a browser?

@mgkimsal
Copy link

mgkimsal commented Jul 7, 2017

I'd expect the version number that would appear on any other platform. My version number is a string from config.xml, correct?

@nikmartin
Copy link

@mgkimsal @Hexodus this plugin extracts the version from the compiled executable using the native platform API, so it won't work in the browser. config.xml is not read at runtime, it's read and compiled in to the native platform binaries

@jgfet
Copy link

jgfet commented Aug 28, 2017

I'd have expected it could have come from ionic.config.json or package.json personally too. But now I know.. (re. the ionic cordova run browser)

@ThorvaldAagaard
Copy link

ThorvaldAagaard commented Oct 29, 2017

Would it be difficult to add the browser platform to this plugin?

As far as I can see config.xml is deployed together with the application, so it could read the version from that file

@Drarok
Copy link
Contributor

Drarok commented Jan 16, 2018

The browser platform is not currently supported, this is aimed at iOS, Android, and Windows apps.

@Drarok Drarok closed this as completed Jan 16, 2018
@ThorvaldAagaard
Copy link

Is it difficult to support browser?

@Drarok
Copy link
Contributor

Drarok commented Jan 16, 2018

I can't see any asset that's included in the browser build by default that includes the version number, so I don't think it's possible without some custom build steps or assets?

@ThorvaldAagaard
Copy link

You are right.

Until now I have solved it by adding a variable to my solution, so in my main.js I can find

this.version = "0.4.0";

and then I have to use that instead of the plugin.

But you are right, it will require either a custom change in the build process, or probably a better solution that the Ionic team adds the version during build to the browser-platform, somewhere you can pick it up.

But also Ionic claims that the browser platform is just experimental and not intended for production, so it seems I will have to continue to update the version in both my solution and in the config.xml.

and thanks for taking the time to take another look into this

best regards
Thorvald

@Drarok
Copy link
Contributor

Drarok commented Jan 17, 2018

Hmm, I should have looked at the Pull Requests before the issues…

There's an outstanding PR that offers browser support, though I've not tested that yet. Might be worth looking at, see if it solves your issue?

I've run out of time for today, but I'll be back soon to tidy up this plugin.

@ThorvaldAagaard
Copy link

As far as I can see he is reading config.xml (In AppVersionProxy), but that is not part of the browser distribution, but I will see if I can get it tested on the broser platform (when uploaded to firebase)

@gerhardcit
Copy link

@Drarok , can you at least try and catch an error so that it does not break when using is in a cordova browser mode?

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

8 participants