2
\$\begingroup\$

I am currently using the following code to let the player invite other players to my multiplayer game:

FB.AppRequest("Test Message", callback: this.HandleResult);

and

FB.AppRequest("Test Message", null, null, null, null, null, null, callback: this.HandleResult);

When tested on an Android phone, it only brought up a Facebook dialog box for the player to choose his/her friends. Clicking "Send" would close the dialog box, but no message whatsover would be received on the target person's Facebook.

I used to do:

FB.Mobile.AppInvite(new Uri("xxxx"), callback: this.HandleResult);

but I understand this has been obsolete, invoking only a black blank screen.

I applied for a 'user_friends' Facebook permission but was told it was not required.

Both 'Single Sign On' and 'Deep Linking' have been enabled on the Basic Settings page at Facebook Developer.

What else should I try?

I tried to print out the result of the callback function which looks like this:

public void HandleResult(IResult result){
    string r = "";
    if (result == null) return;
    if (!string.IsNullOrEmpty(result.Error)) r += "Error Response: " + result.Error + "\n";
    else if (result.Cancelled) r +=  "Cancelled Response: " + result.RawResult + "\n";
    else if (!string.IsNullOrEmpty(result.RawResult)) r += "Success Response:" + result.RawResult + "\n";
    else r+= "Empty Response\n";
    r+=result.ToString();
    GameObject.Find("FBText").GetComponent<Text>().text = r;
}

and obtained the following:

Success Response: {"request":"415323562654670","callback_id":"2","to":"3XXXXXXXXXXXXX"}
Facebook.Unity.AppRequestResult
AppRequestResult:
   Error: null
   RawResult:{"request":"415323562654670","callback_id":"2","to":"3XXXXXXXXXXXXX"}
   Cancelled: False
AppRequestResult:
   RequestID: 415323562654670
   To: 3XXXXXXXXXXXXX

The request seemed to be successful. However, no invitation was received at the target account.

I am using the latest Facebook SDK -- version 7.15.1.

\$\endgroup\$
  • \$\begingroup\$ First of all, I recommend using version 7.13. Version 7.15 is broken as hell, there's an issue with in-app purchases callbacks which causes crashes. Regarding the problem, I remember, that when I published my first app, after 1 or two weeks the FB login stopped working, with a message that one of the tokens is the debug token. I don't really remember which token was that, but when googled, I found it and replaced it. I'll try to look at that later and post it here. \$\endgroup\$ – Jacob May 5 at 10:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.