-
Notifications
You must be signed in to change notification settings - Fork 2
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
Comments
getNetworkIPAddress is a method which depends on the nodejs os module in the non-cordova version diont.js |
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? |
Local network address is obtained using WebRTC References: http://net.ipcalf.com/ http://stackoverflow.com/questions/2138538/non-server-side-method-of-getting-local-ip-address-in-browser
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. |
Fixes issue willemmulder#2 uses chrome.system.network plugin to retrieve host address
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. |
Hi Samardon, excellent! @jackejiang can you confirm this solves your problem as well? Then I'll close the issue. |
Glad to help! |
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?
The text was updated successfully, but these errors were encountered: