facebook app invite using ionic (cordova phonegap)
Asked Answered
A

1

10

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?

Arthrospore answered 5/10, 2015 at 20:36 Comment(2)
Did you find a solution? I would like to solve this problem as well.Stimulate
Any luck trying my answer?Croat
A
1

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);
    }
);
Arrhenius answered 4/5, 2016 at 13:30 Comment(3)
Bonna, any help you could lend would be amazing as I'm stuck on it and the example you show does not fit with the Ionic-Native plugin. ionicframework.com/docs/v2/native/facebookTillman
Sorry @Tillman I just tried my solution on ionic framework v1. I would like to start working with the new version but I still didn't take the time for it.Croat
@Bonna, I just put FB on my tablet yesterday; new tablet. It wouldn't work because somehow an old FB was downloaded on it?!? When I updated it today it all worked just fine.Tillman

© 2022 - 2024 — McMap. All rights reserved.