Closed qpwr closed 3 years ago
Just added this change, thank you for this issue and solution!
Hello ! Your latest version generates build errors on iOS
cordova-plugin-networkinterface/CDVNetworkInterface.m expected identifier or '(' and cordova-plugin-networkinterface/CDVNetworkInterface.m extraneous closing brace ('}')
Ah darn must have been a bad merge, let me take a look at this today.
Thank you for the heads up! Samer
On Wed, Oct 6, 2021 at 8:03 AM Bastien3093 @.***> wrote:
Hello ! Your latest version generates build errors on iOS
cordova-plugin-networkinterface/CDVNetworkInterface.m expected identifier or '(' and cordova-plugin-networkinterface/CDVNetworkInterface.m extraneous closing brace ('}')
— You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub https://github.com/salbahra/cordova-plugin-networkinterface/issues/46#issuecomment-936453789, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7W6FXZ2KS73VUW55HP3OTUFRQMRANCNFSM4SQKU3CA .
Should be fixed in 2.2.0! Thank you very much!
Amazing ! Thanks to you :)
This plugin doesn't seem to be maintained anymore, but in case anyone is using it and experiencing the issue mentioned in the title: This is because the plugin just goes through all en0 interfaces (which is wifi) and uses always the last one. It seems that there is sometimes more than one en0, but some of them with IP 0.0.0.0 (probably non-active ones). If one of the 0.0.0.0 happen to be looped through after the actual active en0 interface, the returned IP will be 0.0.0.0.
To patch this, you have to make some changes to
CDVNetworkInterface.m
, line 22 (within thegetInterfaceiIP
function):Search for
if([name isEqualToString:interfaceName]
and change it to
if([name isEqualToString:interfaceName] && ![addr isEqualToString:@"0.0.0.0"])
Hope someone finds this helpful.