protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); textToken = FindViewById <TextView> (Resource.Id.textToken); textMessage = FindViewById <EditText> (Resource.Id.editTextSendMsg); buttonToken = FindViewById <Button> (Resource.Id.buttonToken); buttonSend = FindViewById <Button> (Resource.Id.buttonSend); buttonToken.Click += async delegate { MyRegistrationService.Register(this); }; if (MyRegistrationService.GCM_SENDER_ID == "YOUR-SENDER-ID") { throw new Exception("You must change MyGcmListenerService.GCM_SENDER_ID const to the value of your own Google Developer Console Project # which has Cloud Messaging For Android API enabled, and an OAUTH and Android Key setup in the Developer Console"); } }
public override async void OnTokenRefresh() { MyRegistrationService.Register(this); }