I would like to implement Facebook app invite into my mobile app so users can invite their friends to my app. I am using a hybrid framework called Ionic (cordova) but can't find any way to invite friends. There are Facebook plugins from ng-crodova but they do not handle app invites. Is there any plugin or simple solution to get this feature to work?
Setup a Facebook app. Create a New Ionic Angular App. Install Ionic Native Facebook Connect Plugin. Implement Facebook Login and Logout.
While developers can still use Cordova in the Ionic stack, the future is Ionic with Capacitor (or Capacitor on its own with any popular web stack!). These apps are known as Web Native apps, in contrast to the older hybrid approach.
PhoneGap is an Adobe product which is powered by Apache Cordova. Ionic is a framework which is a set of CSS classes and a JavaScript library, build on top of Cordova with AngularJS.
You cannot access any device-specific feature in Ionic without using Apache Cordova. Apache Cordova allows you to integrate the plugins which can add the functionality to access those features. However, there are many plugins available to cover most of the native functionalities.
You can use this plugin:
https://github.com/jeduan/cordova-plugin-facebook4
Its just a fork of ngCordova Facebook plugin Wizcorp/phonegap-facebook-plugin.
Then you can use appInvite like this:
facebookConnectPlugin.appInvite(
{
url: "http://example.com",
picture: "http://example.com/image.png"
},
function(obj){
if(obj) {
if(obj.completionGesture == "cancel") {
// user canceled, bad guy
} else {
// user really invited someone :)
}
} else {
// user just pressed done, bad guy
}
},
function(obj){
// error
console.log(obj);
}
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With