ConnectSDK / Connect-SDK-Cordova-Plugin

Cordova/PhoneGap plugin for Connect SDK
Apache License 2.0
68 stars 46 forks source link

How to import connectsdk in my ionic 3 app #66

Open ghost opened 6 years ago

ghost commented 6 years ago

I added the cordova plugin using the following command in my ionic app ionic cordova plugin add cordova-plugin-connectsdk

But I cannot use the method ConnectSDK.discoveryManager.startDiscovery(); in any page since I haven't imported the plugin to my page. I'm not sure how to import this particular plugin. any help?

phablulo commented 6 years ago

I'm a bit late but I hope to help someone else with the same issue. The plugin is attached to Window object, so you don't need to import it. After adding the plugin, just use declare var ConnectSDK; on the top of the page you want to use it.

devroldan commented 5 years ago

phabullo, does your solution work? The console sends the following error:

> Could not resolve all dependencies for configuration ':_debugApk'.
   > Project : declares a dependency from configuration 'debugCompile' to configuration 'debug' which is not declared in the descriptor for project :cordova-plugin-connectsdk:Connect-SDK-Android.

Can you mention in which version of ionic did it work?

phablulo commented 5 years ago

Not anymore, @devroldan. Two months ago I spent a couple days trying to make it work with no success. You could look up the forks to see if someone is still maintaining the project