Search Unity

Social.localUser.Authenticate dont call callback

Discussion in 'iOS and tvOS' started by dimitroff, Jan 6, 2016.

  1. dimitroff

    dimitroff

    Joined:
    Apr 3, 2013
    Posts:
    131
    I am having a weird problem the last couple of days, I am not sure, if it's an iOS or a Unity bug.

    GameCenter seems to work fine and at some point it just hangs, I tracked it to: Social.localUser.Authenticate never calling it's callback function. My app is still not released, so I guess I am testing with the sandboxed version of GameCenter, anybody having the same issue?

    Thanks!
     
  2. PetroUnityDev

    PetroUnityDev

    Joined:
    Nov 19, 2014
    Posts:
    5
    We are having the exact same problem. Anyone have any leads?
     
  3. dimitroff

    dimitroff

    Joined:
    Apr 3, 2013
    Posts:
    131
    It seems it's a wide spread GameCenter bug, there is a huge thread on Apple's forum and still no solution. For now I just have to restart my phone, in order to get it working again.
     
  4. NeonBigT

    NeonBigT

    Joined:
    May 26, 2015
    Posts:
    2
  5. NeonBigT

    NeonBigT

    Joined:
    May 26, 2015
    Posts:
    2
    Unfortunate news, the ticket has just been updated and the issue lies with Apple. Once the authentication window is shown once in a session, it can not be shown again.
     
  6. guywald

    guywald

    Joined:
    Aug 22, 2013
    Posts:
    13
    I'm having a similar issue. Just to understand, better if it's the same problem:
    When the app loadscall Socal.localUser.authenticate. It takes about 1 or 2 seconds for the connection to the Game Center to happen but the call back isn't called (a debug log doesn't print).

    Is this correct?

    Thanks
     
  7. gfaraj

    gfaraj

    Joined:
    Jul 11, 2016
    Posts:
    35
    Anyone know how to handle this situation correctly?
     
  8. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    513
    I've recently submitted a bug report with repo case wih 5.5.2. In my case Socal.localUser.authenticate was returning false in most of the cases randomly even if the user is logged in. Here is the reply I've received today:

    We're currently working on this issue. This issue causes crash in some cases. It's because we're pushing an integer instead of a string. So it's essentially becoming a random number.
    You can track the original case here: https://issuetracker.unity3d.com/is...nticate-crashes-in-string-memcpy2-m2338403668
     
  9. gfaraj

    gfaraj

    Joined:
    Jul 11, 2016
    Posts:
    35
    Thank you PixelEnvision. The situation I'm having trouble handling is when the callback passed to Authenticate is not called if the user cancels the log in. They say this is "by design" but don't provide a way to handle this situation.
     
  10. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    513
    @gfaraj Just an idea..

    I would set a variable such as loginfinished = false; right before calling authenticate and set it to true after a successful/failed login. And also invoke a check function with few seconds delay before calling authenticate. So when the function is called you can tell if loginfinished still false and know if it's cancelled. Not ideal but that might help with your case?