Search Unity

Unity iOS app requests credentials every time I try to share score to facebook

Discussion in 'Scripting' started by SanSolo, May 9, 2016.

  1. SanSolo

    SanSolo

    Joined:
    Feb 25, 2014
    Posts:
    85
    I'm creating an iOS game with Unity3D. I want to implement score share feature in the game. I followed everything from the dev guide and it works fine on Android.

    However, on iOS, whenever the share on FB button is tapped, it prompts for credentials inspite of the app having been authorized.

    This is my Share on FB method :

    Code (csharp):
    1.  
    2. public void ShareOnFB ()
    3. {
    4.  
    5.  
    6. FB.ShareLink (
    7. new Uri ("myurl"),
    8. "Sweetly scored " + LeaderboardManger.instance.GetTotalScore () + " in My Game. Can you beat my score?",
    9. null,
    10. null,
    11. this.HandleResult);
    12.  
    13. }
    And the initial method called when user authorizes the app is as follows :

    Code (csharp):
    1.  
    2. public void CallFBLogin ()
    3. {
    4.  
    5. if (FB.IsInitialized && !FB.IsLoggedIn) {
    6.  
    7.  
    8. FB.LogInWithReadPermissions (new List<string> () { "public_profile", "email", "user_friends" }, this.FBLoginCallBack);
    9.  
    10.  
    11.  
    12.  
    13. } else {
    14. InitializeFB ();
    15. }
    16.  
    17.  
    18. }
    This is working fine on Android, but not on iOS. Any help please?