0

I have a quiz game and I log in using Facebook SDK. In this way, I can see all my friends that play game and invite them for a match.

My question is: how to invite specific friend and send push notification to him? I have list of friends with their Fb ids, and when I click on one, I want to send push notification, so friend could click on it and compete with me.

I have read a lot on internet, but did not find anything useful. I don't want to write server code. Node or something.

Thanks!

vanste25
  • 1,754
  • 14
  • 39

1 Answers1

1

Game requests offer a "to" parameter for specifying a specific friend ID, that is all you need:

https://developers.facebook.com/docs/games/services/gamerequests

As you can read in the docs, it can be a list of IDs and/or invite tokens (if the user did not authorize your App yet).

For push notifications in your App, you can take a look at Firebase, for example: How can I send a Firebase Cloud Messaging notification without use the Firebase Console?

andyrandy
  • 72,880
  • 8
  • 113
  • 130
  • In this way, I get notification in facebook. But I want to receive it as normal push notification in Android, so user could click on it and compete. – vanste25 Dec 24 '17 at 15:00
  • if you want to send push notifications from your android app...well, that is not really related to facebook. – andyrandy Dec 24 '17 at 15:18
  • added more information about push notifications. there is another thread about that already on stackoverflow – andyrandy Dec 24 '17 at 15:21