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

Uncaught ReferenceError: getNetworkIPAddress is not defined #2

Open
jackejiang opened this issue Feb 3, 2015 · 6 comments
Open

Uncaught ReferenceError: getNetworkIPAddress is not defined #2

jackejiang opened this issue Feb 3, 2015 · 6 comments

Comments

@jackejiang
Copy link

I ran in android, and get following message:

I/chromium(10190): [INFO:CONSOLE(100)] "Uncaught ReferenceError: getNetworkIPAddress is not defined", source: file:///android_asset/www/plugins/net.willemmulder.diont.cordova/www/diont.js (101)

getNetworkIPAddress is a method of nodejs os module. Anythong wrong?

@jackejiang
Copy link
Author

getNetworkIPAddress is a method which depends on the nodejs os module in the non-cordova version diont.js

@willemmulder
Copy link
Owner

Right, you're correct. I guess I never published services on mobile, but only consumed them ;-)

What should happen is that a call is made to the Java part and a function there returns the proper IP address.

Would anybody be able to take a stab at this?

Samardon added a commit to Samardon/Diont-for-Cordova that referenced this issue Feb 6, 2015
@willemmulder
Copy link
Owner

Hi Samardon,

WebRTC should work. It will hold its external IP address somewhere, because it will need to expose that to its other connections. Did it work in your app?

Regardless, WebRTC support is only supported on android browser 37 and Chrome. So a Java solution that works on older phones as well, might be worth a shot as well.

Samardon added a commit to Samardon/Diont-for-Cordova that referenced this issue Feb 27, 2015
Fixes issue willemmulder#2 
uses chrome.system.network plugin to retrieve host address
@Samardon
Copy link
Contributor

It worked as expected, but not as intended.

I also couldn't agree more about the need to be able to support older phones.

I submitted a much more sensible pull request where I've added MobileChromeApp's chrome.system.network Plugin (https://github.com/MobileChromeApps/cordova-plugin-chrome-apps-system-network) as a dependency and simply leveraged their API to grab the host address.

I've tested it on a real device and thus far it's gone off without a hitch.

willemmulder added a commit that referenced this issue Feb 28, 2015
@willemmulder
Copy link
Owner

Hi Samardon, excellent!
I've merged your pull request, many thanks.

@jackejiang can you confirm this solves your problem as well? Then I'll close the issue.

@Samardon
Copy link
Contributor

Glad to help!

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

3 participants