I am trying to implement social sharing within ionic app, I was able to successfully share links through native share sheet. When the link is clicked by the person whom the link is shared with it is meant to link back to the item within the app, If the the user have the app installed, otherwise, it prompt the user to install the app. But it is not work that way, rather it asks if you want to open with playstore or browser.
Below is the first thing I did which shares the link successfully after installing cordova social share
.controller('myCtrl',function(,$state,$cordovaContacts,$ionicActionSheet,$cordovaSocialSharing)
{
$scope.share = function(id)
{
$cordovaSocialSharing
.share("my Link Description", null, null,"https://play.google.com/store/apps/deatils?com.ionicframework.myapp/app/item/"+id) // Share via native share sheet
.then(function(result) {
// Success!
}, function(err) {
// An error occured. Show a message to the user
});
}
}
and the view is like this
<a ng-click="share(id)"><i class="ion ion-share"></i> </a>
When the link refused to work as I expected, I did a further research, and I found Custom URL scheme PhoneGap Plugin which is a cool plugin for Cordova that is designed to allow to launch apps by clicking on a link in an email or on a web page
after installing the plug , the link is meant to be used like this;
<a href="mycoolapp://">Open my app</a>
<a href="mycoolapp://somepath">Open my app</a>
<a href="mycoolapp://somepath?foo=bar">Open my app</a>
<a href="mycoolapp://?foo=bar">Open my app</a>
but if I put any of this raw into the social sharing implementation, it shared it as it is written , so the link cannot be clicked.