HeadsetDetection-PhoneGap-Plugin
HeadsetDetection-PhoneGap-Plugin copied to clipboard
NativeScript port
Hi Eddy, I was wondering how hard is it to port this cordova plugin to a nativescript module ? Do I have to know the Android and IOS developer API reference ? Thanks,
It would be one of the easiest plugins. Just translate the Java and ObjC code to TypeScript (or plain JavaScript if that's your thing). Are you pondering doing it yourself?
Hi Eddy, I would like to but it's not clear for me in the NativeScript docs how each Java/ObjC statement translates to its javascript equivalent ... Could you help to get me started ? Thanks!
Perhaps it's best to look at how any other plugin does that. I can recommend one, but it depends on if you'd like to use JavaScript or TypeScript to create the plugin.
I have a preference for plain old JavaScript.
Then this repo may be a good one to clone. It's loosely based on native code available in this plugin so you should be able to see how to translate between native and JS.
There's also some good pointers here.
Thanks Eddy, I'll check that asap.
Hi Eddy, would it be possible to send a typescript example??? thanks, mate.