예제 #1
0
        private void mProfileTracker_mOnProfileChanged(object sender, OnProfileChangedEventArgs e)
        {
            Pessoa alguem = new Pessoa();

            if (e.mProfile != null)
            {
                try
                {
                    alguem.primeiroNome = e.mProfile.FirstName;
                    alguem.sobrenome    = e.mProfile.LastName;
                    alguem.nome         = e.mProfile.Name;
                }
                catch (Exception ex)
                {
                    //Handle error
                }
            }

            AlertDialog.Builder builder = new AlertDialog.Builder(this);
            builder.SetTitle("Mensagem");
            builder.SetMessage("" + alguem.primeiroNome + ", " + alguem.sobrenome + ", " + alguem.nome);
            builder.SetCancelable(false);
            builder.SetPositiveButton("OK", (senderAlert, args) => { });
            builder.Show();
        }
예제 #2
0
        private void MprofileTrackerOnM_OnProfileChanged(object sender, OnProfileChangedEventArgs e)
        {
            try
            {
                if (e.mProfile != null)
                {
                    try
                    {
                        FB_firstName = e.mProfile.FirstName;
                        FB_lastName  = e.mProfile.LastName;
                        FB_name      = e.mProfile.Name;
                        FB_profileId = e.mProfile.Id;

                        var request    = GraphRequest.NewMeRequest(AccessToken.CurrentAccessToken, this);
                        var parameters = new Bundle();
                        parameters.PutString("fields", "id,name,age_range,email");
                        request.Parameters = parameters;
                        request.ExecuteAsync();
                    }
                    catch (Java.Lang.Exception ex)
                    {
                        Console.WriteLine(ex);
                    }
                }
                else
                {
                    Toast.MakeText(this, GetString(Resource.String.Lbl_Null_Data_User), ToastLength.Short).Show();
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
예제 #3
0
        void mProfileTracker_mOnProfileChanged(object sender, OnProfileChangedEventArgs e)
        {
            if (e.mProfile != null)
            {
                try
                {
                    //mTxtFirstName.Text = e.mProfile.FirstName;
                    //mTxtLastName.Text = e.mProfile.LastName;
                    //mTxtName.Text = e.mProfile.Name;
                    //mTxtEmail.Text = e.mProfile.Email;
                    mProfilePic.ProfileId = e.mProfile.Id;
                    System.Diagnostics.Debug.Write("welllllllllllllllll" + e.mProfile.Class);
                    System.Diagnostics.Debug.Write("welllllllllllllllll" + e.mProfile.Handle);

                    System.Diagnostics.Debug.Write("welllllllllllllllll");
                }

                catch (Exception ex)
                {
                    //Handle error
                }
            }

            else
            {
                //the user must have logged out
                //mTxtFirstName.Text = "First Name";
                //mTxtLastName.Text = "Last Name";
                //mTxtName.Text = "Name";
                mProfilePic.ProfileId = null;
            }
        }
예제 #4
0
 void mProfileTracker_mOnProfileChanged(object sender, OnProfileChangedEventArgs e)
 {
     if (e.mProfile != null)
     {
         try
         {
             string name      = e.mProfile.Name;
             string profileId = e.mProfile.Id;
         }
         catch (Java.Lang.Exception exc)
         {
         }
     }
     else
     {
     }
 }
예제 #5
0
 private async void profileChanged(object sender, OnProfileChangedEventArgs e)
 {
     if (e.mProfile != null)
     {
         try
         {
             Profile profile = e.mProfile;
             //await Task.Delay(5000);
             if (!jaEntrou)
             {
                 await Conectar(profile);
             }
         }
         catch (System.Exception ex)
         {
             DroidUtils.MostraMensagem("profileChanged", ex.Message);
         }
     }
 }
예제 #6
0
        void mProfileTracker_mOnProfileChanged(object sender, OnProfileChangedEventArgs e)
        {
            LoginManager.Instance.LogInWithReadPermissions(this, new List <string> {
                "user_friends", "public_profile"
            });
            if (e.mProfile != null)
            {
                try
                {
                    var sc = new SocialLoginData();
                    sc.scFirstName     = e.mProfile.FirstName;
                    sc.scLastName      = e.mProfile.LastName;
                    sc.scUserName      = e.mProfile.FirstName + e.mProfile.LastName;
                    sc.scSocialId      = e.mProfile.Id;
                    facebookpicture    = "http://graph.facebook.com/" + e.mProfile.Id + "/picture?type=large";
                    sc.scProfileImgUrl = facebookpicture;
                    sc.scEmail         = email ?? "";

                    sc.scSource    = "facebook";
                    sc.scAccessUrl = "http://facebook.com/profile.php?id=" +
                                     e.mProfile.Id;

                    sc.scSocialOauthToken = AccessToken.CurrentAccessToken.Token;
                    sc.scAccount          = AccessToken.CurrentAccessToken.UserId;


                    GraphRequest request = GraphRequest.NewMeRequest(AccessToken.CurrentAccessToken, this);

                    Bundle parameters = new Bundle();
                    parameters.PutString("fields", "id,name,email,picture");
                    request.Parameters = parameters;
                    request.ExecuteAsync();



                    StartRegistration(sc);
                }

                catch (Java.Lang.Exception ex) { }
            }
        }
예제 #7
0
 void mProfileTracker_mOnProfileChanged(object sender, OnProfileChangedEventArgs e)
 {
     if (e.mProfile != null)
     {
         try
         {
             TxtFirstName.Text  = e.mProfile.FirstName;
             TxtLastName.Text   = e.mProfile.LastName;
             TxtName.Text       = e.mProfile.Name;
             mprofile.ProfileId = e.mProfile.Id;
         }
         catch (Java.Lang.Exception ex) { }
     }
     else
     {
         TxtFirstName.Text  = "First Name";
         TxtLastName.Text   = "Last Name";
         TxtName.Text       = "Name";
         mprofile.ProfileId = null;
     }
 }
        //Login With Facebook
        private void ProfileTrackerOnMOnProfileChanged(object sender, OnProfileChangedEventArgs e)
        {
            try
            {
                if (e.MProfile != null)
                {
                    //var FbFirstName = e.MProfile.FirstName;
                    //var FbLastName = e.MProfile.LastName;
                    //var FbName = e.MProfile.Name;
                    //var FbProfileId = e.MProfile.Id;

                    var request    = GraphRequest.NewMeRequest(AccessToken.CurrentAccessToken, this);
                    var parameters = new Bundle();
                    parameters.PutString("fields", "id,name,age_range,email");
                    request.Parameters = parameters;
                    request.ExecuteAsync();
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }
예제 #9
0
 private void OFacebookService_mOnProfileChanged(object sender, OnProfileChangedEventArgs e)
 {
     if (e.mProfile != null)
     {
         try
         {
             txtFirstName.Text     = e.mProfile.FirstName;
             txtLastName.Text      = e.mProfile.LastName;
             txtName.Text          = e.mProfile.Name;
             pictureView.ProfileId = e.mProfile.Id;
         }
         catch (Java.Lang.Exception ex)
         {
         }
     }
     else
     {
         txtFirstName.Text     = "First Name";
         txtLastName.Text      = "Last Name";
         txtName.Text          = "Name";
         pictureView.ProfileId = null;
     }
 }
예제 #10
0
        private void OFacebookService_mOnProfileChanged(object sender, OnProfileChangedEventArgs e)
        {
            var fb = Owner.GetInstance();

            if (e.mProfile != null)
            {
                try
                {
                    fb.firstName  = e.mProfile.FirstName;
                    fb.lastName   = e.mProfile.LastName;
                    fb.facebookId = e.mProfile.Id;
                    StartActivity(typeof(RegisterActivity));
                }
                catch (Java.Lang.Exception ex)
                {
                }
            }
            else
            {
                fb.firstName = string.Empty;
                fb.lastName  = string.Empty;
                fb.id        = string.Empty;
            }
        }
예제 #11
0
 void mProfileTracker_mOnProfileChanged(object sender, OnProfileChangedEventArgs e)
 {
     mTxtFirstName.Text = e.mProfile.FirstName;
 }