Facebook App Invite, Invite Friends

Atul O Holic

I switched to Facebook 4.0 in order to implement AppInviteDialog for Android. I followed this reference.

The dialog appears, I can select friends, invite them, I get the onSuccess() call, but my friends don't get the invite.

I have used the below applink URL: https://fb.me/****412097*****

No previewImageURL although I saw my app's image on the dialog.

Code:

//Inside onCreate -

        callbackManager = CallbackManager.Factory.create();

        mInvititeDialog = new AppInviteDialog(this);
        mInvititeDialog.registerCallback(callbackManager,
                new FacebookCallback<AppInviteDialog.Result>() {

                    @Override
                    public void onSuccess(Result result) {
                        NetworkController.showCustomToast(
                                InviteFriendsActivity.this,
                                "Invitation Sent Successfully!");
                        finish();
                    }

                    @Override
                    public void onCancel() {
                        Log.d("Result", "Cancelled");
                        NetworkController.showCustomToast(
                                InviteFriendsActivity.this, "Cancelled");
                        finish();
                    }

                    @Override
                    public void onError(FacebookException exception) {
                        Log.d("Result", "Error " + exception.getMessage());
                        NetworkController.showCustomToast(
                                InviteFriendsActivity.this,
                                "Error while inviting friends");
                        finish();
                    }
                });


    if (AppInviteDialog.canShow()) {
            AppInviteContent content = new AppInviteContent.Builder()
                            .setApplinkUrl(appLinkUrl).build();

            AppInviteDialog.show(InviteFriendsActivity.this, content);

    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        // TODO Auto-generated method stub
        super.onActivityResult(requestCode, resultCode, data);
        callbackManager.onActivityResult(requestCode, resultCode, data);

    }

No help from below similar links (even though they are from ios)

Code for fb invitation not working

https://stackoverflow.com/questions/27547826/facebook-app-invites-issue

Facebook App Invite not received

Atul O Holic

Ok, turns out everything was working fine after all. My mistake was in assuming not having the app installed, and not having the app authorized should generate a push notification.

After creating a new test user, using a device where the app was not currently installed and the app NEVER having been authorized with the user.

So the key here is that no push notification will be generated if the app is installed on the target device, even if the user has not authorized the app previously. Also, seemingly, if the user has authorized the app previously, even if it was removed it at some point, it also will not generate a notification.

So if you want to test this, create an entirely new test user and log in on the Facebook app on the platform you are testing on, and make sure the app is not installed on the device.

I think it should still generate a notification despite app being installed, because multiple users might be using the same device, but that's how it seems to be right now.

I'll leave this here in case anyone has a similar problem in the future.

Live long and prosper!

Source

It did actually work for me, however I am not very sure if it covers all the scenarios and is the perfect solution. Posting here for other users and suggestions if any.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Invite Facebook friends to use app

From Dev

Facebook SDK. Invite friends to the app

From Dev

How to invite friends in windows 8 facebook app?

From Dev

How to invite friends in windows 8 facebook app?

From Dev

IOS - Facebook how to invite friends to download app?

From Dev

Invite Friends Notification is not showing on facebook

From Dev

Invite friends to play games on facebook

From Dev

How to invite friends to facebook app via the Graph API

From Dev

How to invite friends to facebook app via the Graph API

From Dev

Invite Facebook friends to use app from Objective C or PHP

From Dev

Facebook Messenger SDK to share app Invite to Friends iOS

From Dev

How to Invite facebook friends though my application?

From Dev

How to programmatically invite Facebook friends on a website

From Dev

Facebook invite friends button for static html page

From Dev

How to invite friends to the Facebook application that is not a game?

From Dev

Facebook App Invite "FBSDKAppInviteContent" not recognized

From Dev

Facebook App Invite Dialog is not working

From Dev

Facebook App Invite "FBSDKAppInviteContent" not recognized

From Dev

Facebook API 2.1 - About Invite Friends And App-scoped User IDs

From Dev

iOS Facebook sdk Invite to friend Reqest Sent but not getting Notificaton on friends

From Dev

Facebook invite friends doesn't work on native android browser

From Dev

i want to invite friends by posting on there wall with facebook sdk

From Dev

android how to display all my facebook friends and invite to play

From Dev

Facebook App invite requires canvas URL

From Dev

Error while using facebook app invite for android

From Dev

How do rails app have invite your friends custom url?

From Dev

Facebook SDK Unity Invite

From Dev

Android Facebook Invite

From Dev

IOS Facebook SDK invite Missing App Link URL

Related Related

  1. 1

    Invite Facebook friends to use app

  2. 2

    Facebook SDK. Invite friends to the app

  3. 3

    How to invite friends in windows 8 facebook app?

  4. 4

    How to invite friends in windows 8 facebook app?

  5. 5

    IOS - Facebook how to invite friends to download app?

  6. 6

    Invite Friends Notification is not showing on facebook

  7. 7

    Invite friends to play games on facebook

  8. 8

    How to invite friends to facebook app via the Graph API

  9. 9

    How to invite friends to facebook app via the Graph API

  10. 10

    Invite Facebook friends to use app from Objective C or PHP

  11. 11

    Facebook Messenger SDK to share app Invite to Friends iOS

  12. 12

    How to Invite facebook friends though my application?

  13. 13

    How to programmatically invite Facebook friends on a website

  14. 14

    Facebook invite friends button for static html page

  15. 15

    How to invite friends to the Facebook application that is not a game?

  16. 16

    Facebook App Invite "FBSDKAppInviteContent" not recognized

  17. 17

    Facebook App Invite Dialog is not working

  18. 18

    Facebook App Invite "FBSDKAppInviteContent" not recognized

  19. 19

    Facebook API 2.1 - About Invite Friends And App-scoped User IDs

  20. 20

    iOS Facebook sdk Invite to friend Reqest Sent but not getting Notificaton on friends

  21. 21

    Facebook invite friends doesn't work on native android browser

  22. 22

    i want to invite friends by posting on there wall with facebook sdk

  23. 23

    android how to display all my facebook friends and invite to play

  24. 24

    Facebook App invite requires canvas URL

  25. 25

    Error while using facebook app invite for android

  26. 26

    How do rails app have invite your friends custom url?

  27. 27

    Facebook SDK Unity Invite

  28. 28

    Android Facebook Invite

  29. 29

    IOS Facebook SDK invite Missing App Link URL

HotTag

Archive