public static void GetProfile(Action <bool, GDDeviceProfile> callback)
    {
        bool result = true;

        device.deviceId   = OpenUDIDPlugin.GetOpenUDID();
        device.deviceType = platforms.ContainsKey(Application.platform.ToString()) ? platforms[Application.platform.ToString()] : "";

        registeredServices = 0;
        foreach (GDService service in services)
        {
            service.GetProfile(device,
                               delegate(bool success) {
                if (!success)
                {
                    result = false;
                }

                registeredServices++;
                if (registeredServices == services.Count)
                {
                    if (callback != null)
                    {
                        callback(result, device);
                    }
                }
            }
                               );
        }
    }
Exemple #2
0
 void ProcessCreateUser(bool success)
 {
     if (Social.localUser.authenticated)
     {
         //Login with gamecenter id
         GamedoniaUsers.LoginUserWithGameCenterId(Social.localUser.id, ProcessLogin);
     }
     else
     {
         //Login with open_udid
         GamedoniaUsers.LoginUserWithOpenUDID(OpenUDIDPlugin.GetOpenUDID(), null);
     }
 }
Exemple #3
0
    void ProcessAuthentication(bool success)
    {
        GDUser      user        = new GDUser();
        Credentials credentials = new Credentials();

        credentials.open_udid = OpenUDIDPlugin.GetOpenUDID();
        user.credentials      = credentials;

        if (success)
        {
            credentials.gamecenter_id = Social.localUser.id;
        }

        GamedoniaUsers.CreateUser(user, ProcessCreateUser);
    }
Exemple #4
0
    public void Authenticate(Action <bool> callback)
    {
        if (Gamedonia.INSTANCE.debug)
        {
            Debug.Log("Silent Authentication");
        }
        this.callback = callback;

        GDUser      user        = new GDUser();
        Credentials credentials = new Credentials();

        credentials.open_udid = OpenUDIDPlugin.GetOpenUDID();
        user.credentials      = credentials;

        GamedoniaUsers.CreateUser(user, ProcessCreateUser);
    }
Exemple #5
0
 void ProcessCreateUser(bool success)
 {
     //Login with open_udid
     GamedoniaUsers.LoginUserWithOpenUDID(OpenUDIDPlugin.GetOpenUDID(), ProcessLogin);
 }