Facebook Invite Friends or Game Request For Android

Hi,

I’m trying to make a game request in facebook v4 plugin, this is for android. I already sent a request but when the person I sent it to, opened the link, there’s is a message saying “item not found”. I have a couple of questions that I would like to ask, they are as follows:

  1. To run facebook game request, should I use an app that has a package name uploaded already in google? And should be in a release mode not in debug?

  2. When I am making a game request, facebook sometimes shows all my friends but most of the time, it’s only a very few suggested friends and the search friends is not working. Any idea why it’s like this? I used filter = “APP_NON_USERS”.

  3. In  facebook.showDialog action “request”, the message parameter is not working for me. When I tried this with a custom message but the notifications in facebook only shows the title of the game , sender and a message “sent you a request”.

  4. How can I use facebook.showDialog(“link”) to get facebook friend’s list?

In the new version of facebook plugin, facebook.showDialog(“friends”) is deprecated. I can’t find any tutorial or example of this.

Any help is much appreciated. Thanks!

Russel

Hi lascanorussell,

For the “item no found” message when a person tries opening up a Game Request, this is likely because the recipient of your game request does not have your app installed on their device.

  • Should you use an app that has a package name uploaded already in google?

Depending on what that app is, it’s possible that Facebook wouldn’t allow you to do this. On iOS, you can test using the App Store ID of some other app that’s already in the App Store, so it’s worth experimenting with. Similarly, by using a package name already in Google Play, you could see if a recipient of a Game Request that doesn’t have your app installed on their device would be redirected to the App Store or Google Play when they tap the notification for the Game Request.

Eventually, you’d have to use your own package name, but it doesn’t hurt to experiment with these things.

  • When you are making a game request, facebook sometimes shows all your friends but most of the time, it’s only a very few suggested friends…

I believe Facebook will try to populate the suggested friends list with people you’ve sent Game Requests to in the past. So the more testing you do with certain accounts, the higher those accounts appear. If Facebook is showing all your friends in that dialog, then it probably doesn’t have any data to make better suggestions.

… the search friends is not working. Any idea why it’s like this? I used filter = “APP_NON_USERS”.

Can you describe (step-by-step) how the search friends is not working for you? Regarding the “APP_NON_USERS” filter, if all of your registered test accounts happen to authenticated your app in their Facebook Settings, it’d make sense for nothing to appear while searching for friends.

In  facebook.showDialog action “request”, the message parameter is not working for me. When I tried this with a custom message but the notifications in facebook only shows the title of the game , sender and a message “sent you a request”.

According to Facebook’s Game Requests documentation, this is the intended behavior.

“A plain-text message to be sent as part of the request. This text will surface in the App Center view of the request, but not on the notification jewel”

How can I use facebook.showDialog(“link”) to get facebook friend’s list?

If the end-user has the Facebook App installed on their device, the Share Dialog that appears will provide options for the end-user to tag friends and a location. See the facebook-v4-plugin-ios-beta-improvements-and-new-features blog post for more info.

If you just want to get the Facebook user’s friends list, you can use facebook.request() to call Facebook’s Graph API for this info. Something like this should do the trick.

facebook.request("/me/friends")

A lot can be accomplished just using facebook.request(), so I suggest you look through the documentation and corresponding Graph API documentation if you haven’t already.

Hi Ajay,

Thanks for your response.

I found a sample of facebook.showDialog( “friends”, onComplete ) in coronalabs blog but it is way back in 2014 and I don’t think it’s still working in the new facebook v4 plugin. Do you know where can I find an updated tutorial or even a simple example on how to use facebook.request("/me/friends") for getting facebook friends?

Thanks,

Russel

Hi lascanorussell,

For the “item no found” message when a person tries opening up a Game Request, this is likely because the recipient of your game request does not have your app installed on their device.

  • Should you use an app that has a package name uploaded already in google?

Depending on what that app is, it’s possible that Facebook wouldn’t allow you to do this. On iOS, you can test using the App Store ID of some other app that’s already in the App Store, so it’s worth experimenting with. Similarly, by using a package name already in Google Play, you could see if a recipient of a Game Request that doesn’t have your app installed on their device would be redirected to the App Store or Google Play when they tap the notification for the Game Request.

Eventually, you’d have to use your own package name, but it doesn’t hurt to experiment with these things.

  • When you are making a game request, facebook sometimes shows all your friends but most of the time, it’s only a very few suggested friends…

I believe Facebook will try to populate the suggested friends list with people you’ve sent Game Requests to in the past. So the more testing you do with certain accounts, the higher those accounts appear. If Facebook is showing all your friends in that dialog, then it probably doesn’t have any data to make better suggestions.

… the search friends is not working. Any idea why it’s like this? I used filter = “APP_NON_USERS”.

Can you describe (step-by-step) how the search friends is not working for you? Regarding the “APP_NON_USERS” filter, if all of your registered test accounts happen to authenticated your app in their Facebook Settings, it’d make sense for nothing to appear while searching for friends.

In  facebook.showDialog action “request”, the message parameter is not working for me. When I tried this with a custom message but the notifications in facebook only shows the title of the game , sender and a message “sent you a request”.

According to Facebook’s Game Requests documentation, this is the intended behavior.

“A plain-text message to be sent as part of the request. This text will surface in the App Center view of the request, but not on the notification jewel”

How can I use facebook.showDialog(“link”) to get facebook friend’s list?

If the end-user has the Facebook App installed on their device, the Share Dialog that appears will provide options for the end-user to tag friends and a location. See the facebook-v4-plugin-ios-beta-improvements-and-new-features blog post for more info.

If you just want to get the Facebook user’s friends list, you can use facebook.request() to call Facebook’s Graph API for this info. Something like this should do the trick.

facebook.request("/me/friends")

A lot can be accomplished just using facebook.request(), so I suggest you look through the documentation and corresponding Graph API documentation if you haven’t already.

Hi Ajay,

Thanks for your response.

I found a sample of facebook.showDialog( “friends”, onComplete ) in coronalabs blog but it is way back in 2014 and I don’t think it’s still working in the new facebook v4 plugin. Do you know where can I find an updated tutorial or even a simple example on how to use facebook.request("/me/friends") for getting facebook friends?

Thanks,

Russel