Search code examples
cordovaibm-mobilefirstsocialshare

Social share with Worklight


I'm developing an app using Worklight and AngularJS, there is a necessity in this app with main objective to share certain text. My idea is to invoke the native method of sharing each operating system without restricting any application and use what is available in the operating system (start to Android and iOS). I would like to know if there are specific methods to invoke this routine using the Worklight or, if don't have, what the best practices to implement?


Solution

  • Worklight does not provide API to do so, but you can writing a Cordova plug-in that will invoke native code for each required platform, and will display the appropriate sharing sheet (for iOS) or share action (for Android).

    To develop Cordova plug-ins for Worklight, follow the training modules:

    To invoke the native code, find the native code to do so. For example: