knowledgecode / WebSocket-for-Android

Cordova/PhoneGap plugin that makes WebSocket available on Android
Apache License 2.0
143 stars 53 forks source link

What happens to IOS when adding this plugin #15

Closed peli44 closed 10 years ago

peli44 commented 10 years ago

I use CLI and add the plugin. When I add it I get two log lines telling it is added both to android and ios. For IOS there is a built in function for web socket already. Will this plugin be used instead of the build in web socket?

When I have built both IOS and Android it is working on the both plattforms.

knowledgecode commented 10 years ago

Thank you for sharing that with me. The js file had been copied to iOS platform. I fixed the plugin.xml to make it be copied only to Android platform. But, because cordova plugin commands always attempt to install to all platforms, it is not perfect. We have to use Plugman instead. It is similar tool that is provided by Apache, but it can select the target platform. Installing and usage are below.

$ sudo npm install -g plugman
$ plugman install --platform android --project platforms/android --plugin https://github.com/knowledgecode/WebSocket-for-Android.git --plugins_dir plugins

If you want, you can try this.

peli44 commented 10 years ago

I don´t quit understand this.

You mention that the plugin.xml is made so that the plugin is only copied to the Android platform. But at the same time you say it is not perfect. So if I have added the plugin using the CLI what has then happened. Is it installed to IOS.

When I have built the app for both IOS and Android it works but I dont know if IOS is using the plugin or the built in functionality. Is it possible to notice what IOS is doing.

If I use plugman will the result be the same and can I use CLI to build as before?

/Per

Per Liljeqvist per.liljeqvist@gmail.com +46 076697558 www.dogood.se

24 jul 2014 kl. 18:22 skrev KNOWLEDGECODE notifications@github.com:

Thank you for sharing that with me. The js file had been copied to iOS platform. I fixed the plugin.xml to make it be copied only to Android platform. But, because cordova plugin commands always attempt to install to all platforms, it is not perfect. We have to use Plugman instead. It is similar tool that is provided by Apache, but it can select the target platform. Installing and usage are below.

$ sudo npm install -g plugman $ plugman install --platform android --project platforms/android --plugin https://github.com/knowledgecode/WebSocket-for-Android.git --plugins_dir plugins If you want, you can try this.

— Reply to this email directly or view it on GitHub.

knowledgecode commented 10 years ago

It has NOT been sure copied files to iOS platform since I have fixed the plugin.xml. So in iOS it's used native (built in) WebSockets. But, there is no way preventing the cordova plugin command from installing to ALL platforms. The command really attempts to install iOS platform yet. And then, it leaves a mark (something like a management history) on some files in there. :( There are NO tangible ill effects but it's yucky. So I prefer to use Plugman that can specify the target platform. As far as installing/uninstalling plugins, it is almost identical to the cordova plugin command. Please choose whichever you like.

knowledgecode commented 10 years ago

I described the usage of Cordova Plugman to README.md.

Now, I would like to close this Issue. If you have any other questions, please post them again. Thank you.