Пример #1
0
    void DrawUserManagement()
    {
        // facebook
        DrawAddRemoveProvider("Facebook Identity", () =>
        {
            DemoGuiUtils.DrawButton("Add", AddFacebookUserIdentity, !UserHasFacebookIdentity(), GSStyles.Button);
            DemoGuiUtils.DrawButton("Remove", RemoveFacebookUserIdentity, UserHasFacebookIdentity(), GSStyles.Button);
            DemoGuiUtils.DrawButton("Switch User", SwitchToFacebookUser, true, GSStyles.Button);
        });

        // custom provider
        DrawAddRemoveCustomProvider();
        DrawAddRemoveProperty();
        DrawBatchUpdateSection();

        DrawGetUsersByAuthIdentitiesSection();

        DemoGuiUtils.DrawButton("Log Out", () =>
        {
            GetSocial.ResetUser(() =>
            {
                _console.LogD("User has been successfully logged out.");
                demoController.FetchCurrentUserData();
            },
                                error => _console.LogE("Failed to log out user, error: " + error)
                                );
        }, true, GSStyles.Button);

        DemoGuiUtils.DrawButton("Reset without init", () =>
        {
            GetSocial.Reset(() =>
            {
                demoController.PopMenuSection();
                demoController.FetchCurrentUserData();
            }, error =>
            {
                _console.LogE("Failed to reset user: " + error);
            });
        }, true, GSStyles.Button);
    }