How to invite friends to facebook app via the Graph API

Marc Greenstock

I hope this hasn't been answered before, I have looked everywhere but I have come up empty. There are a few similar questions here but none have the answer I am looking for:

I want to send a Facebook Canvas App invite to the OAuth signed in user's friends via the Graph API.

I seem to be going around in circles with the documentation as everything points to the JS SDK dialog (https://developers.facebook.com/docs/reference/dialogs/requests/). The end result is the same where a notification will materialise for the invited friends with "{User} has invited you to try {App name}" but I don't want to use the JS dialog.

It appears I should be looking here https://developers.facebook.com/docs/games/notifications however when I try to send a notification, I can only send to users who are already using the app. This tip seems to suggest the limitation I am seeing however the language used is confusing:

All notifications from an app are treated the same way, independent of how they're sent, via this API or as a person-to-person request. People won't see a first receipt prompt for invites, that is they have not authorized the app and a friend is simply inviting them to try the app.

Can anyone help?

Marc Greenstock

So it turns out, thank to CBroe's comment that it is not possible to invite via the Graph API (I wish it were clearer in the documentation).

It is not necessary, however, to use the friend select dialog. It is possible to generate your own list of friends using either the graph api, server-side or client-side and produce a confirmation box by using the JS SDK like so:

$('form').on('submit', function(e) {
  e.preventDefault();
  var userIds = $(this).find('input:checkbox:checked').map(function() {
    return parseInt($(this).val(),10);
  }).get();
  FB.ui({method: 'apprequests',
    message: 'Check this app out!',
    to: userIds
  });
});

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to invite friends to facebook app via the Graph API

From Dev

Facebook App Invite, Invite Friends

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 Facebook friends to use app

From Dev

Facebook graph api friends of friends

From Dev

Facebook SDK. Invite friends to the app

From Dev

How can I get the facebook friends_count of a user profile via graph API 2.2?

From Dev

Unfollowing friends, groups, pages on Facebook via Graph API

From Dev

Unfollowing friends, groups, pages on Facebook via Graph API

From Dev

How to get list of Facebook friends for testing an app, given the new Graph API limitations?

From Dev

How to get list of Facebook friends for testing an app, given the new Graph API limitations?

From Dev

Facebook Graph API - Issues with friends that have installed the app

From Dev

How to Invite facebook friends though my application?

From Dev

How to programmatically invite Facebook friends on a website

From Dev

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

From Dev

Facebook graph api search friends

From Dev

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

From Dev

Facebook: How to get friends' check ins with Graph Api?

From Dev

using Facebook Graph API how can i access friends names

From Dev

How to test Friends Data Permissions in Facebook Graph API Explorer

From Dev

How to get list of friends in Facebook Graph API ver 2.5?

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 get a facebook users friends and profile picture of friends using graph api v2.0?

From Dev

How to get a facebook users friends and profile picture of friends using graph api v2.0?

From Dev

Get facebook friends posts using graph API

From Dev

Facebook Graph API 2.2 mutual friends

Related Related

  1. 1

    How to invite friends to facebook app via the Graph API

  2. 2

    Facebook App Invite, Invite Friends

  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 Facebook friends to use app

  7. 7

    Facebook graph api friends of friends

  8. 8

    Facebook SDK. Invite friends to the app

  9. 9

    How can I get the facebook friends_count of a user profile via graph API 2.2?

  10. 10

    Unfollowing friends, groups, pages on Facebook via Graph API

  11. 11

    Unfollowing friends, groups, pages on Facebook via Graph API

  12. 12

    How to get list of Facebook friends for testing an app, given the new Graph API limitations?

  13. 13

    How to get list of Facebook friends for testing an app, given the new Graph API limitations?

  14. 14

    Facebook Graph API - Issues with friends that have installed the app

  15. 15

    How to Invite facebook friends though my application?

  16. 16

    How to programmatically invite Facebook friends on a website

  17. 17

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

  18. 18

    Facebook graph api search friends

  19. 19

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

  20. 20

    Facebook: How to get friends' check ins with Graph Api?

  21. 21

    using Facebook Graph API how can i access friends names

  22. 22

    How to test Friends Data Permissions in Facebook Graph API Explorer

  23. 23

    How to get list of friends in Facebook Graph API ver 2.5?

  24. 24

    Invite Facebook friends to use app from Objective C or PHP

  25. 25

    Facebook Messenger SDK to share app Invite to Friends iOS

  26. 26

    How to get a facebook users friends and profile picture of friends using graph api v2.0?

  27. 27

    How to get a facebook users friends and profile picture of friends using graph api v2.0?

  28. 28

    Get facebook friends posts using graph API

  29. 29

    Facebook Graph API 2.2 mutual friends

HotTag

Archive