Facebook Invite button not working on unity

646 views Asked by At

My facebook invite button isn't working. Here is the code

public void Invite() {
    FB.Mobile.AppInvite (new System.Uri ("app link"), null, InviteCallback); 
}

void InviteCallback(IAppInviteResult result) {
   if (result.Cancelled) 
    { Debug.Log ("Invite cancelled. "); } 
   else if (!string.IsNullOrEmpty (result.Error))
    { Debug.Log ("Error in               invite: " + result.Error); } 
   else { Debug.Log ("Invite was successful: " + result.RawResult); }
}

The results show

"Invite was successful: {did_complete":true,"callback_id":"3"} UnityEngine.Debug:Log(Object)"`

So I know it got sent, but when I asked my friend to check their Facebook account, they said they didn't receive anything from me. Does anyone know what to do to fix this or why it isn't showing up in my friends Facebook notifications when I sent it?

1

There are 1 answers

0
Cuneyt On

Is this the Debug result when using Unity editor. Probably you see Mock Dialog on the game play and press success button and seeing that sentence. Build your app and deploy it (android or iOS), after that check again on a real device. When using mobile invite your friend will NOT see invite on his/her browser. Check it on actual device's facebook app.

Be sure when you send from android, other party it should be android (if iOS both should be iOS) (Last sentence is my guess, not tested yet, Im already working on this)