예제 #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            textViewMsg = FindViewById <TextView> (Resource.Id.textViewMsg);

            #region Check to ensure user has used their own GCM Service, Hub Name, and Hub Secret
            if (MyRegistrationService.GCM_SENDER_ID == "YOUR-SENDER-ID")
            {
                Log("You must change the SampleGcmBroadcastReceiver.SENDER_IDS to your own Sender ID for the sample to work!");
                return;
            }

            if (MyRegistrationService.HUB_NAME == "YOUR-HUB-NAME")
            {
                Log("You must enter your own Hub Name and Hub Listen Secret for the sample to work!");
                return;
            }
            #endregion

            Log("Registering for Remote Notifications...");

            MyRegistrationService.Register(this);
        }
예제 #2
0
 public override void OnTokenRefresh()
 {
     MyRegistrationService.Register(this);
 }