dpa99c / phonegap-launch-navigator

Phonegap/Cordova plugin which launches native route navigation apps for Android, iOS and Windows
369 stars 131 forks source link

Error linking Reachability #144

Closed patrickbussmann closed 7 years ago

patrickbussmann commented 7 years ago

With this commit you, @dpa99c uploaded the demo files from Apple. (https://github.com/dpa99c/phonegap-launch-navigator/commit/7c1bfdd0f83108ee2cd2bd699b06503367706393) Do we need this files? Because I'm getting a problem with linking 4 times the Reachability file.

dpa99c commented 7 years ago

The plugin uses the Apple Reachibility implementation to determine if there's currently an internet connection (see the source code here and here). This method is loosely based on Method #2 in this SO answer.

So yes, the files are needed: if you remove them, the plugin won't work.

However, as that answer also points out:

Important Note: The Reachability class is one of the most used classes in projects so you might run into naming conflicts with other projects like ShareKit. If this happens, you'll have to rename one of the pairs of Reachability.h and Reachability.m files to something else to resolve the issue.

In a native iOS app this is easily resolved. However, in a Cordova app it's not so trivial if your linking issues are be due to multiple instances of the Reachability files being included by separate Cordova plugins. That's not something that can easily be resolved by this plugin though, and is something you'll probably have to resolve either by editing the native project generated by Cordova in XCode, or modifying the conflicting plugins to rename the Reachability files so they don't conflict.