Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook invite in phonegap returns OK

I need to be able to invite friends to my application on Android. I'm using HTML/js with Phonegap. The login with FB is working fine with the plugin but i can't make the invite work.

My code is:

FB.ui(
   {method: 'apprequests',
    message: 'test'},
   function(response) {
    alert("res:" + response);
    }
);

I can select the friends, it sends the request but in the alert i get "res:OK" instead of the IDs of the friends. In addition, in order to make it work, i must configure "Website" platform in addition to Android. Is there another way? I want to open specific page in the application for those who already have the application.

My FB settings:

Base:
  App Domains: <empty>
Android:
  Package Name: com.milab.idc.sheets
  Class Name: com.milab.idc.sheets.ProjectActivity
Website:
  Site URL: https://play.google.com/store/apps/details?id=com.milab.idc.sheets

My Play store page: https://play.google.com/store/apps/details?id=com.milab.idc.sheets

Thanks

like image 411
RonnyR Avatar asked May 10 '14 16:05

RonnyR


1 Answers

the facebook documentation say you should populate the to parameter with the friends id

FB.ui({ method: 'apprequests', message: 'Come play Friend Smash with me!', to: friend_ids }, function(){ //handle result }

it seems like it is missing.

plus you should receive the Refence_id that point on the request and not the friend_id.

like image 92
Rugdr Avatar answered Sep 29 '22 18:09

Rugdr