protected override void OnCreate(Bundle bundle) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(bundle); var options = new FirebaseOptions.Builder() .SetApplicationId("simplemessager") .SetApiKey("AIzaSyCg847Wo53-3PLgUpkMWNpda9yL3qR-7HQ") .SetDatabaseUrl("https://simplemessager.firebaseio.com/") // .SetGcmSenderId(GcmSenderId) .Build(); instance = this; FirebaseApp.InitializeApp(this, options); VideoViewRenderer.Init(); // QuickbloxPlatform.Init(); global::Xamarin.Forms.Forms.Init(this, bundle); var layoutParams = new LinearLayout.LayoutParams( Resources.DisplayMetrics.WidthPixels, Resources.DisplayMetrics.HeightPixels); //App.NetworkProvider.GetSessionInfo(); this.Receiver = new AcceptInvitationListener(); isPublished = false; LoadApplication(new App()); try { GcmClient.CheckDevice(this); GcmClient.CheckManifest(this); System.Diagnostics.Debug.WriteLine("Registering..."); GcmClient.Register(this, PushHandlerBroadcastReceiver.SENDER_IDS); var isRegistered = GcmClient.IsRegistered(this); var isOnServerRegistered = GcmClient.IsRegisteredOnServer(this); } catch (Java.Net.MalformedURLException) { CreateAndShowDialog("There was an error creating the client.Verify the URL.", "Error"); } catch (Exception e) { CreateAndShowDialog(e.Message, "Error"); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Login); ISharedPreferences prefs = PreferenceManager.GetDefaultSharedPreferences(this); if (!onEmulator) { GcmClient.CheckDevice(this); GcmClient.CheckManifest(this); if (!GcmClient.IsRegisteredOnServer(this)) { GcmClient.UnRegister(this); } GcmClient.Register(this, GcmBroadcastReceiver.SENDER_IDS); } this.uriText = FindViewById <EditText>(Resource.Id.ServiceUri); this.tagsText = FindViewById <EditText>(Resource.Id.ServiceTags); this.loginTestResult = FindViewById <TextView>(Resource.Id.LoginTestResult); this.uriText.Text = prefs.GetString(Keys.MobileServiceUri, null); this.tagsText.Text = prefs.GetString(Keys.TagExpression, null); FindViewById <Button>(Resource.Id.RunTests).Click += OnClickRunTests; FindViewById <Button>(Resource.Id.MSALogin).Click += OnClickMicrosoftAccountLoginAndRefresh; FindViewById <Button>(Resource.Id.AADLogin).Click += OnClickAADLoginAndRefresh; FindViewById <Button>(Resource.Id.GoogleLogin).Click += OnClickGoogleLoginAndRefresh; FindViewById <Button>(Resource.Id.FacebookLogin).Click += OnClickFacebookLoginAndRefresh; FindViewById <Button>(Resource.Id.TwitterLogin).Click += OnClickTwitterLoginAndRefresh; string autoStart = ReadSettingFromIntentOrDefault(Keys.AutoStart, "false"); if (autoStart != null && autoStart.ToLower() == "true") { TestConfig config = new TestConfig { MobileServiceRuntimeUrl = ReadSettingFromIntentOrDefault(Keys.MobileServiceUri), RuntimeVersion = ReadSettingFromIntentOrDefault(Keys.RuntimeVersion), TagExpression = ReadSettingFromIntentOrDefault(Keys.TagExpression), TestFrameworkStorageContainerUrl = ReadSettingFromIntentOrDefault(Keys.StorageUrl), TestFrameworkStorageContainerSasToken = ReadSettingFromIntentOrDefault(Keys.StorageSasToken) }; App.Harness.SetAutoConfig(config); RunTests(); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Login); ISharedPreferences prefs = PreferenceManager.GetDefaultSharedPreferences(this); //Check to ensure everything's setup right GcmClient.CheckDevice(this); GcmClient.CheckManifest(this); if (!GcmClient.IsRegisteredOnServer(this)) { GcmClient.UnRegister(this); } GcmClient.Register(this, GcmBroadcastReceiver.SENDER_IDS); this.uriText = FindViewById <EditText>(Resource.Id.ServiceUri); this.tagsText = FindViewById <EditText>(Resource.Id.ServiceTags); this.uriText.Text = prefs.GetString(Keys.MobileServiceUri, null); this.tagsText.Text = prefs.GetString(Keys.TagExpression, null); FindViewById <Button>(Resource.Id.RunTests).Click += OnClickRunTests; FindViewById <Button>(Resource.Id.Login).Click += OnClickLogin; string autoStart = ReadSettingFromIntentOrDefault(Keys.AutoStart, "false"); if (autoStart != null && autoStart.ToLower() == "true") { TestConfig config = new TestConfig { MobileServiceRuntimeUrl = ReadSettingFromIntentOrDefault(Keys.MobileServiceUri), RuntimeVersion = ReadSettingFromIntentOrDefault(Keys.RuntimeVersion), TagExpression = ReadSettingFromIntentOrDefault(Keys.TagExpression) }; App.Harness.SetAutoConfig(config); RunTests(); } }