/*Metodo de registro*/ public void btn_empezar(object sender, EventArgs e) { //pantalla para logearse FacebookSdk.SdkInitialize(this.ApplicationContext); SetContentView(Resource.Layout.Main); mProfileTracker = new MyProfileTracker(); mProfileTracker.mOnProfileChanged += mProfileTracker_mOnProfileChanged; mProfileTracker.StartTracking(); /*Informacion extraida de facebook*/ mTxtFirstName = FindViewById <TextView>(Resource.Id.txtFirstName); mTxtLastName = FindViewById <TextView>(Resource.Id.txtLastName); mTxtName = FindViewById <TextView>(Resource.Id.txtName); mProfilePic = FindViewById <ProfilePictureView>(Resource.Id.profilePic); // LoginButton btnFacebook = FindViewById <LoginButton>(Resource.Id.login_button); btnFacebook.Click += botonFB; btnRegistrar = FindViewById <Button>(Resource.Id.btnRegistrar); btnRegistrar.Click += btn_registrar; btnIniciarSesion = FindViewById <Button>(Resource.Id.btnIniciarSesion); btnIniciarSesion.Click += btn_iniciar_sesion; }
public Facebook() { mProfileTracker = new MyProfileTracker(); mProfileTracker.mOnProfileChanged += mProfileTracker_mOnProfileChanged; mProfileTracker.StartTracking(); LoginButton btnFacebook = FindViewById <LoginButton>(Resource.Id.login_button); btnFacebook.SetReadPermissions(new List <string> { "public_profile", "user_friends", "email" }); mCallBackManager = CallbackManagerFactory.Create(); btnFacebook.RegisterCallback(mCallBackManager, this); }