//CognitoAccessTokenTracker tracker;

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            callbackManager = CallbackManagerFactory.Create();

            LoginManager.Instance.RegisterCallback(callbackManager, new FacebookCallback <LoginResult>()
            {
                HandleSuccess = loginResult =>
                {
                    var accessToken = loginResult.AccessToken;
                    CognitoSyncUtils.UpdateCredentials(accessToken.Token);
                    Intent todoActivity = new Intent(this, typeof(TodoActivity));
                    StartActivity(todoActivity);
                },
                HandleCancel = () =>
                {
                    CognitoSyncUtils.UpdateCredentials(string.Empty);
                },
                HandleError = loginError =>
                {
                    CognitoSyncUtils.UpdateCredentials(string.Empty);
                }
            });
            LoginManager.Instance.LogInWithReadPermissions(this, new List <string> {
                "public_profile"
            });

            CognitoSyncUtils.Initialize();
        }
Ejemplo n.º 2
0
        // This is the main entry point of the application.
        static void Main(string[] args)
        {
            SettingsBaseConfiguration.LogLevel = LogLevel.Debug;

            CognitoSyncUtils.Initialize();

            // if you want to use a different Application Delegate class from "AppDelegate"
            // you can specify it here.
            UIApplication.Main(args, null, "AppDelegate");
        }