Ionic 2 socialsharing plugin is not working?


#1

I am running this app on android6.0. I did the following changes,

I added the plugin using ionic command

ionic plugin add cordova-plugin-x-socialsharing

My Component function look like below,

import { SocialSharing } from 'ionic-native';

private sendSMS(aData, sMsg:string):void {		
	let title = 'Send Email';
	let iSuccess = 0;
	let iFailure = 0;
	for(let mobile of aData) {
		console.info(mobile);
		SocialSharing.shareViaSMS(sMsg,mobile).then(()=>{
			iSuccess++;
		}).catch(()=>{
			iFailure++;
		});
	}

	let msg = ''+iSuccess+' emails send successfully.';
		msg += iFailure+' failed to send.';
	this.failureMsgAlert(title, msg);
}

And the config.xml I added these changes,

<!-- for iOS -->
<feature name="SocialSharing">
  <param name="ios-package" value="SocialSharing" />
</feature>

<!-- for Android (you will find one in res/xml) -->
<feature name="SocialSharing">
  <param name="android-package" value="nl.xservices.plugins.SocialSharing" />
</feature>

It’s not throwing any errors. nl.xservices.plugins.SocialSharing in this namespace java file is available.

Please help me on this.