Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Social.localUser.Authenticate

Discussion in 'iOS and tvOS' started by JRavey, Jun 5, 2012.

  1. JRavey

    JRavey

    Joined:
    May 12, 2009
    Posts:
    2,377
    I have used Prime31's excellent plugins, but figured I should give Unity's built-in API a try since it's there. I'm beginning to suspect it doesn't actually work or for it to work one has to meet certainly poorly documented requirements.

    I built a test case of just one scene with just one script:
    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. public class GCTest : MonoBehaviour {
    6.    
    7.     void OnGUI()
    8.     {
    9.         if(GUI.Button(new Rect(0, 0, 50, 50), "GC"))
    10.         {
    11.             Social.localUser.Authenticate(CheckAuth);
    12.         }
    13.     }
    14.    
    15.     public void CheckAuth(bool success)
    16.     {
    17.         if(success)
    18.         {
    19.             Debug.Log("Authorized");
    20.         }
    21.     }
    22. }
    23.  
    Just as with my full project, the results are always the same.
    Code (csharp):
    1.  
    2. authenticateWithCompletionHandler: exit
    3. Failed to authenticate local user The requested operation has been cancelled.
    4.  
    I've tried with the team .* profile and with the titular specific profile.

    The build settings are using "Development Build", although I tried it with and without that.

    Am I wasting my time here? I worked on this for a few hours being deciding to just simply test that one method in isolation.
     
  2. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    I can confirm that Unity's social api works perfectly on iOS. I am not sure why it is not working for you though.
     
  3. JRavey

    JRavey

    Joined:
    May 12, 2009
    Posts:
    2,377
    Hmm...that's good to know. Something is probably different in our projects. I figured starting from a completely empty project would be a good place start; however, that didn't work.

    I've done every recommendation I can find, most are pretty obvious like logging out of GameCenter, etc.

    If you have a few moments, would you kindly share your project settings? Did you change anything in XCode? Did you user your team's .* profile or the title-specific one?
     
  4. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    Nope

    I used the wildcard one (the .*).

    I haven't heard you mention anything about your sandbox account. Have you created/logged into this yet?
     
  5. JRavey

    JRavey

    Joined:
    May 12, 2009
    Posts:
    2,377
    Thanks for the info.

    The login prompt actually never shows, but I do have a Sandbox account from other apps that used Prime31's plugin.

    Do you know the version of Unity and Xcode you have?

    Sorry for the torrents of questions.
     
  6. JRavey

    JRavey

    Joined:
    May 12, 2009
    Posts:
    2,377
    It looks like I'm just going back to Prime31's plugin.

    The Social API has problems and I would like to use it, but I don't have time to guess the magic combinations required to make it work. At some point, it would be nice to get a response from Unity on this.

    FWIW, I am using Unity 3.5.2f2 Pro/iOS Pro with XCode 4.3.2.
     
    Last edited: Jun 6, 2012