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

Cordova not available #57

Open
ghost opened this issue Sep 15, 2017 · 7 comments
Open

Cordova not available #57

ghost opened this issue Sep 15, 2017 · 7 comments

Comments

@ghost
Copy link

ghost commented Sep 15, 2017

the example code from the site leaves my browser saying "Run time Error" and in the browser console its telling me cordova is not available. How can i fix?

@floatinghotpot
Copy link
Owner

You cannot load the page in browser directly.

Instead, you need build it into a cordova hybrid app.

See what a cordova hybrid app is:
https://en.wikipedia.org/wiki/Apache_Cordova

You can learn more on cordova homepage:
http://cordova.apache.org/

@ghost
Copy link
Author

ghost commented Sep 15, 2017

should i be able to access the server from same phone when run on ionic view

@floatinghotpot
Copy link
Owner

No, I guess.

This plugin contains native code and javascript code. To use the full features, you will need to build the native code into your app, so the javascript code can call the native code via js-bridge.

But ionic view may not build cordova-http into it.

@ghost
Copy link
Author

ghost commented Sep 16, 2017

i tried these commands:

$ ionic cordova plugin add cordova-plugin-httpd
$ npm install --save @ionic-native/httpd

and all the other plugins seemed to work from the site, this must be a different story

@floatinghotpot
Copy link
Owner

Ok, this is right step to make the plugin working. You have to build it into an app (either android apk, or ios ipa package), then install into simulator or device.

@floatinghotpot
Copy link
Owner

The ionic view is only used to verify your HTML5 page layout and platform independent features. If some feature depends on native code, it cannot be verified in ionic view.

@ghost
Copy link
Author

ghost commented Sep 16, 2017

ok, i will try to build to android

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

1 participant