protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Facebook API initialization FacebookSdk.SdkInitialize(this.ApplicationContext); AppEventsLogger.ActivateApp(this.Application); _masterProfileTracker = new FBProfileTracker(); _masterProfileTracker.mOnProfileChanged += MasterProfileTracker_mOnProfileChanged; _masterProfileTracker.StartTracking(); // Create your application here SetContentView(Resource.Layout.FacebookLoginView); _fullNameTextView = FindViewById <TextView>(Resource.Id.fullNameTextView); _facebookLoginButton = FindViewById <LoginButton>(Resource.Id.facebookLoginButton); _facebookLoginButton.SetReadPermissions(new List <string> { "user_friends", "public_profile" }); _masterFBCallManager = CallbackManagerFactory.Create(); _facebookLoginButton.RegisterCallback(_masterFBCallManager, this); }
protected override void OnActivityResult(int requestCode, Result resultCode, Android.Content.Intent data) { try { FacebookSdk.SdkInitialize(this); // FacebookSdk.ApplicationId = "444917649791842"; //pune el id de la app de facebook AppEventsLogger.ActivateApp(Application); //no se que hace esta linea mprofileTracker = new MyProfileTracker(); mprofileTracker.mOnProfileChanged += MprofileTracker_mOnProfileChanged; mprofileTracker.StartTracking(); // Set our view from the "main" layout resource // SetContentView(Resource.Layout.configCuenta); //BtnFBLogin = FindViewById<LoginButton>(Resource.Id.fb_btn); BtnFBLogin.SetReadPermissions(new List <string> { "public_profile", "user_friends", "email", "user_birthday" }); mFBCallManager = CallbackManagerFactory.Create(); BtnFBLogin.RegisterCallback(mFBCallManager, this); //base.OnActivityResult(requestCode, resultCode, data); mFBCallManager.OnActivityResult(requestCode, (int)resultCode, data); } catch (Exception e) { Console.WriteLine(e); Console.WriteLine(e); Console.WriteLine(e); Console.WriteLine(e); Console.WriteLine(e); Console.WriteLine(e); Console.WriteLine(e); Console.WriteLine(e); Console.WriteLine(e); Console.WriteLine(e); Console.WriteLine(e); } }
protected override void OnResume() { base.OnResume(); AppEventsLogger.ActivateApp(this); UpdateUI(); }
//private void CreateAndShowDialog(string message, string title) //{ // AlertDialog.Builder builder = new AlertDialog.Builder(this); // builder.SetMessage(message); // builder.SetTitle(title); // builder.Create().Show(); //} protected override void OnCreate(Bundle bundle) { FormsAppCompatActivity.ToolbarResource = Resource.Layout.toolbar; base.OnCreate(bundle); Instance = this; App.ScreenWidth = (int)Resources.DisplayMetrics.WidthPixels; // real pixels App.ScreenHeight = (int)Resources.DisplayMetrics.HeightPixels; // real pixels FacebookSdk.SdkInitialize(ApplicationContext); AppEventsLogger.ActivateApp(Application); FacebookCallbackManager = CallbackManagerFactory.Create(); //var facebookCallback = new FacebookCallback() //{ // HandleSuccess = (Xamarin.Facebook.Login.LoginResult loginResult) => // { // //formsButton.LoginSuccess(loginResult.AccessToken.Token); // }, // HandleCancel = () => // { // // App code // }, // HandleError = (FacebookException exception) => // { // // App code // } //}; //LoginManager.Instance.RegisterCallback(FacebookCallbackManager, facebookCallback); //LoginManager.Instance.LogInWithReadPermissions(MainActivity.Instance, new[] { "public_profile" }); //this.Window.AddFlags(WindowManagerFlags.Fullscreen); global::Xamarin.Forms.Forms.Init(this, bundle); Xamarin.FormsMaps.Init(this, bundle); //Microsoft.WindowsAzure.MobileServices.CurrentPlatform.Init(); UserDialogs.Init(() => (Activity)Forms.Context); ImageCircleRenderer.Init(); LoadApplication(new App()); }
protected override void OnCreate(Bundle bundle) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(bundle); FacebookSdk.SdkInitialize(this); AppEventsLogger.ActivateApp(this); global::Xamarin.Forms.Forms.Init(this, bundle); DependencyService.Register <IFacebookManager, Droid_FacebookManager>(); if (CallbackManager == null) { CallbackManager = CallbackManagerFactory.Create(); } LoadApplication(new App()); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Main); // Create your application here #region Fb Implementation FacebookSdk.SdkInitialize(ApplicationContext); AppEventsLogger.ActivateApp(Application); fbloginButton = (Button)FindViewById(Resource.Id.LoginBtn); progressBar = FindViewById <ProgressBar>(Resource.Id.progressbar); /*UpBger = (LinearLayout)FindViewById(Resource.Id.UpBger); * Whiter = (LinearLayout)FindViewById(Resource.Id.Whiter); * MainLinear = (RelativeLayout)FindViewById(Resource.Id.MainLinear); * animated_android = (ImageView)FindViewById(Resource.Id.LoadImg);*/ /*AnimationDrawable animation = (AnimationDrawable)animated_android.Drawable; * animation.Start();*/ mCallBackManager = CallbackManagerFactory.Create(); LoginManager.Instance.RegisterCallback(mCallBackManager, this); fbloginButton.Click += delegate { //AnimateIris(UpBger); //AnimateIris2(Whiter, MainLinear); StartActivity(typeof(InterestSelectActivity)); var list = new List <string>(); list.Add("public_profile"); list.Add("email"); list.Add("user_birthday"); list.Add("user_likes"); //LoginManager.Instance.LogInWithReadPermissions(this, list); }; #endregion }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); FacebookSdk.SdkInitialize(ApplicationContext); AppEventsLogger.ActivateApp(Application); callbackManager = CallbackManagerFactory.Create(); LoginManager.Instance.RegisterCallback(callbackManager, facebookCallback); this.Window.AddFlags(WindowManagerFlags.Fullscreen); global::Xamarin.Forms.Forms.Init(this, bundle); Microsoft.WindowsAzure.MobileServices.CurrentPlatform.Init(); App.UIContext = this; LoadApplication(new ContosoMoments.App()); instance = this; #if PUSH // need to use a Google image on an Android emulator try { // Check to ensure everything's setup right GcmClient.CheckDevice(this); GcmClient.CheckManifest(this); // Register for push notifications System.Diagnostics.Debug.WriteLine("Registering..."); GcmClient.Register(this, PushHandlerBroadcastReceiver.SENDER_IDS); } catch (Java.Net.MalformedURLException) { CreateAndShowDialog(new Exception("There was an error creating the Mobile Service. Verify the URL"), "Error"); } catch (Exception e) { CreateAndShowDialog(e, "Error"); } #endif }
public override void OnCreate() { base.OnCreate(); FacebookSdk.SdkInitialize(ApplicationContext); AppEventsLogger.ActivateApp(this); }
public static void OnActivated() { AppEventsLogger.ActivateApp(Android.App.Application.Context as Android.App.Application); }
public void PublishInstall() { AppEventsLogger.ActivateApp(Application.Context, _facebookApplicationID); }
protected override void OnResume() { base.OnResume(); AppEventsLogger.ActivateApp(Application); }