Esempio n. 1
0
 private static void ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
 {
     if (App.Channel != null && App.Channel.ChannelUri != null)
     {
         CurrentChannel.ChannelUri = App.Channel.ChannelUri.AbsoluteUri;
     }
 }
Esempio n. 2
0
 private void PushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
 {
     if (UriUpdated != null)
     {
         UriUpdated(e.ChannelUri.ToString());
     }
 }
        /// <summary>
        /// Handles the ChannelUriUpdated event of the Channel control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="NotificationChannelUriEventArgs"/> instance containing the event data.</param>
        private async void Channel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            try
            {
                var hub = new NotificationHub(Constants.HubName, Constants.ConnectionString);

                Debug.WriteLine(e.ChannelUri.ToString());

                // register the channel in NH without tags
                //var result = await hub.RegisterNativeAsync(e.ChannelUri.ToString());
                var result = await hub.RegisterNativeAsync(e.ChannelUri.ToString(), SettingsHelper.Tags);


                if (result.RegistrationId != null)
                {
                    Deployment.Current.Dispatcher.BeginInvoke(() =>
                    {
                        MessageBox.Show(result.RegistrationId);
                    });
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }
Esempio n. 4
0
 private void PushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
 {
     Dispatcher.BeginInvoke(() => {
         System.Diagnostics.Debug.WriteLine(e.ChannelUri.ToString());
         MessageBox.Show(String.Format("Channel uri is {0}", e.ChannelUri.ToString()));
     });
 }
Esempio n. 5
0
        private void OnChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            Debug.WriteLine(e.ChannelUri.ToString());
            TLUtils.WriteLine(String.Format("Channel Uri is {0}", e.ChannelUri));

            RegisterDeviceAsync();
        }
Esempio n. 6
0
        private static void ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e, Action <Exception> callback)
        {
            Channel = HttpNotificationChannel.Find(Channel_Name);
            if (Channel != null)
            {
                //if (!channel.IsShellTileBound)
                //{
                //    // you can register the phone application to recieve tile images from remote servers [this is optional]
                //    var uris = new Collection<Uri>(Allowed_Domains);
                //    channel.BindToShellTile(uris);
                //    //channel.BindToShellTile();
                //}

                if (!Channel.IsShellToastBound)
                {
                    Channel.BindToShellToast();
                }

                RegisterForNotifications(callback);
                //RegisterWithNotificationService(callback);
            }
            else
            {
                if (callback != null)
                {
                    callback(new NetmeraException(NetmeraException.ErrorCode.EC_PUSH_DEVICE_NOT_REGISTERED, "Channel URI update failed"));
                }
            }
        }
        private void ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            // Retrieve the Channel again as the URI is updated
            this.notificationChannel = HttpNotificationChannel.Find(ChannelName);

            // Bind the channel with Toast and Tile
            if (!this.notificationChannel.IsShellToastBound)
            {
                this.notificationChannel.BindToShellToast();
            }

            if (!this.notificationChannel.IsShellTileBound)
            {
                System.Collections.ObjectModel.Collection <Uri> externalTileUris = new System.Collections.ObjectModel.Collection <Uri> {
                    new Uri(@"http://upload.wikimedia.org/wikipedia/commons/8/8f/MSICO-Start.png")
                };
                this.notificationChannel.BindToShellTile(externalTileUris);
            }

            // Setup the notification event handlers
            this.HookupNotificationHandlers();

            // Send the device id and the URI to the app notification web service.
            // Web service should update the URI if it already stored in the web service
            this.RegisterForNotifications();
        }
Esempio n. 8
0
        private void OnChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            Debug.WriteLine(e.ChannelUri.ToString());

            Telegram.Logs.Log.Write(string.Format("PushService.OnChannelUriUpdated\nnewUri={0}\noldUri={1}", e.ChannelUri, (_pushChannel != null ? _pushChannel.ChannelUri : null)));
            RegisterDeviceAsync(() => { });
        }
Esempio n. 9
0
        void httpChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            WebClient webClient = new WebClient();

            webClient.OpenReadAsync(new Uri("http://localhost:49343/websend.aspx?url=" + e.ChannelUri));   //在不阻止调用线程的情况下,从资源返回数据
            webClient.OpenReadCompleted += new OpenReadCompletedEventHandler(webClient_OpenReadCompleted); //异步操作完成时发生
        }
Esempio n. 10
0
 private void PushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
 {
     Dispatcher.BeginInvoke(() => {
         System.Diagnostics.Debug.WriteLine(e.ChannelUri.ToString());
         MessageBox.Show(String.Format("Channel uri is {0}", e.ChannelUri.ToString()));
     });
 }
Esempio n. 11
0
 private void PushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
 {
     Dispatcher.BeginInvoke(() =>
     {
         System.Diagnostics.Debug.WriteLine(e.ChannelUri.ToString());
     });
 }
Esempio n. 12
0
 /// <summary>
 /// Raises the ChannelUriUpdated event.
 /// </summary>
 /// <param name="e"></param>
 protected virtual void OnChannelUriUpdated(NotificationChannelUriEventArgs e)
 {
     if (ChannelUriUpdated != null)
     {
         ChannelUriUpdated(this, e);
     }
 }
Esempio n. 13
0
        void NotificationService_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            FSLog.Info("Channel URL: ", e.ChannelUri.ToString());

            // update URI to settings
            SettingsManager.NotificationChannelUriString = e.ChannelUri.ToString();
        }
Esempio n. 14
0
 private void OnHttpChannelChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
 {
     SubscribeToNotifications();
     OnManagementIdChanged(null);
     SubscribeToManagementServiceAsync();
     Deployment.Current.Dispatcher.BeginInvoke(() => UpdateStatus(string.Format("Channel created successfully: {0}", e.ChannelUri)));
 }
Esempio n. 15
0
 /// <summary>
 /// Event handler for the ChannelUriUpdate event.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void channel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
 {
     channel.ChannelUriUpdated -= channel_ChannelUriUpdated;
     //System.Diagnostics.Debug.WriteLine(e.ChannelUri.AbsoluteUri);
     ChannelUri = e.ChannelUri.AbsoluteUri;
     OnChannelUriUpdated(e);
 }
Esempio n. 16
0
        void myChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            // サービスにチャンネルを登録する
            Debug.WriteLine("Notification channel URI:" + e.ChannelUri.ToString());

            string channel = e.ChannelUri.ToString();
            RegistToService(channel);
        }
Esempio n. 17
0
        private void PushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            Dispatcher.BeginInvoke(() =>
            {
                System.Diagnostics.Debug.WriteLine(e.ChannelUri.ToString());

            });
        }
Esempio n. 18
0
 void pushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
 {
     Dispatcher.BeginInvoke(() =>
        {
        // Display the new URI for testing purposes. Normally, the URI would be passed back to your web service at this point.
        System.Diagnostics.Debug.WriteLine(e.ChannelUri.ToString());
        });
 }
Esempio n. 19
0
 private void PushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
 {
     Dispatcher.BeginInvoke(() =>
     {
         (Application.Current as App).Usuario.Url = e.ChannelUri.ToString();
         AtualizarUsuario((Application.Current as App).Usuario);
     });
 }
Esempio n. 20
0
        void httpChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            Trace("Channel opened. Got Uri:\n" + httpChannel.ChannelUri.ToString());

            Trace("Subscribing to channel events");
            SubscribeToService();
            SubscribeToNotifications();
        }
Esempio n. 21
0
        private void Channel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            Debug.WriteLine("Channel opened. Got Uri:\n" + _notificationChannel.ChannelUri);
            Debug.WriteLine("Subscribing to channel events");

            SubscribeToService(AppID);
            SubscribeToNotifications();
        }
 void PushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
 {
     // return uri to js
     RegisterResult result = new RegisterResult();
     result.ChannelName = this.channelName;
     result.Uri = pushChannel.ChannelUri.ToString();
     this.DispatchCommandResult(new PluginResult(PluginResult.Status.OK, result));
 }
Esempio n. 23
0
        private async void OnNotificationChannelEvent(object sender, NotificationChannelUriEventArgs e)
        {
            var push = App.MobileServiceClient.GetPush();
            await push.UnregisterNativeAsync();

            if (App.Hub != null)
                await push.RegisterNativeAsync(App.CurrentChannel.ChannelUri.ToString(), new string[] { App.Hub.Id.ToString() });
        }
Esempio n. 24
0
        /// <summary>
        /// Handler for push notification channel Uri updates.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void channel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            RegisterForPushNotifications();

            if (!(sender as HttpNotificationChannel).IsShellToastBound)
            {
                (sender as HttpNotificationChannel).BindToShellToast();
            }
        }
 void uriChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
 {
     if (e.ChannelUri.ToString() != string.Empty) {
         txBlock_Notificacion.Text = "UriChannel OK";
        // Btn_Alta.IsEnabled = true;
         vUriMPNS = e.ChannelUri.ToString();
     }
     
 }
Esempio n. 26
0
        void PushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            // return uri to js
            RegisterResult result = new RegisterResult();

            result.ChannelName = this.channelName;
            result.Uri         = pushChannel.ChannelUri.ToString();
            this.DispatchCommandResult(new PluginResult(PluginResult.Status.OK, result));
        }
Esempio n. 27
0
        void devicePushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            //toastClient.SubscribeToToastsAsync(e.ChannelUri.ToString());
            client.AddSubscriptionAsync(e.ChannelUri.ToString());

            // Allows the application to react to toast notifications

            _devicePushChannel.BindToShellToast();
        }
Esempio n. 28
0
        static void _channel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            _channel = HttpNotificationChannel.Find("Commuter");

            if (null != _channel)
            {
                BindNotifications();
            }
        }
 /// <summary>
 /// Event handler for when the push channel Uri is updated.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void PushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
 {
     Deployment.Current.Dispatcher.BeginInvoke(() =>
     {
         // Display the new URI for testing purposes.   Normally, the URI would be passed back to your web service at this point.
         System.Diagnostics.Debug.WriteLine(e.ChannelUri.ToString());
     });
     Deployment.Current.Dispatcher.BeginInvoke(new PushServiceRegistrationCallback(mRegistrationCallback), e.ChannelUri.ToString(), false);
 }
Esempio n. 30
0
 /// <summary>
 /// Event handler for when the push channel Uri is updated.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void PushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
 {
     Dispatcher.BeginInvoke(() =>
     {
         // Display the new URI for testing purposes.   Normally, the URI would be passed back to your web service at this point.
         System.Diagnostics.Debug.WriteLine(e.ChannelUri.ToString());
         MessageBox.Show(String.Format("Channel Uri is {0}",
                                       e.ChannelUri.ToString()));
     });
 }
Esempio n. 31
0
        /// <summary>
        /// When creating a new channel for push notification, its Uri updates.
        /// This event is raised when that occurs.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void channel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            RegisterClient(e.ChannelUri);
            HttpNotificationChannel channel = (sender as HttpNotificationChannel);

            if (!channel.IsShellToastBound)
            {
                channel.BindToShellToast();
            }
        }
Esempio n. 32
0
        /// <summary>
        /// Event handler for when the push channel Uri is updated.
        /// </summary>
        public void ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            NotificationUri = e.ChannelUri.ToString();
            installaction.notificationUri = NotificationUri;

            // Display the new URI for testing purposes.   Normally, the URI would be passed back to your web service at this point.
            BmobDebug.Log(String.Format("Channel Uri is {0}", NotificationUri));

            fetchAndUpdateNotifactionUri();
        }
Esempio n. 33
0
        void OnChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            channelUri = e.ChannelUri;

            httpChannel.BindToShellTile();
            httpChannel.BindToShellToast();

            httpChannel.HttpNotificationReceived += OnHttpNotification;
            httpChannel.ShellToastNotificationReceived += OnToastNotification;
        }
Esempio n. 34
0
        private async void OnNotificationChannelEvent(object sender, NotificationChannelUriEventArgs e)
        {
            var push = App.MobileServiceClient.GetPush();
            await push.UnregisterNativeAsync();

            if (App.Hub != null)
            {
                await push.RegisterNativeAsync(App.CurrentChannel.ChannelUri.ToString(), new string[] { App.Hub.Id.ToString() });
            }
        }
            private void OnChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
            {
#if DEBUG
                Debug.WriteLine("Push channel URI changed to " + e.ChannelUri);
#endif
                PluginResult result = new PluginResult(PluginResult.Status.OK, e.ChannelUri.ToString());

                result.KeepCallback = true;
                parent.DispatchCommandResult(result, callbackId);
            }
Esempio n. 36
0
 private void AtualizarUriCanal(object sender, NotificationChannelUriEventArgs e)
 {
     Dispatcher.BeginInvoke(
         () => {
         System.Diagnostics.Debug.WriteLine(e.ChannelUri.ToString());
         MessageBox.Show(String.Format("{0}", e.ChannelUri.ToString()));
         aidentro = e.ChannelUri.ToString();
     }
         );
 }
 private void AtualizarUriCanal(object sender, NotificationChannelUriEventArgs e)
 {
     Dispatcher.BeginInvoke(
         () => {
         System.Diagnostics.Debug.WriteLine(e.ChannelUri.ToString());
         Models.Usuario u = new Models.Usuario();
         u.AtualizarUsuario(textBoxUsuario.Text, e.ChannelUri.ToString());
     }
         );
 }
Esempio n. 38
0
        // Subscribe to the received channel
        void httpChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            Trace("Channel opened. Got Uri: " + httpChannel.ChannelUri.ToString());
            Dispatcher.BeginInvoke(() => SaveChannelInfo());
            Trace("Subscribing to channel events");
            SubscribeToService();
            Trace("Subscribe to the channel to Tile and Toast notifications");
            SubscribeToNotifications();

            Trace("Channel created successfully");
        }
Esempio n. 39
0
        void PushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            // return uri to js
            var result = new RegisterResult
            {
                ChannelName = this.pushOptions.ChannelName,
                Uri         = e.ChannelUri.ToString()
            };

            this.ExecuteCallback(this.pushOptions.UriChangedCallback, JsonConvert.SerializeObject(result));
        }
Esempio n. 40
0
        void PushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            // return uri to js
            RegisterResult result = new RegisterResult
            {
                ChannelName = this.pushOptions.WP8.ChannelName,
                Uri         = e.ChannelUri.ToString()
            };

            SendEvent(JsonConvert.SerializeObject(result));
        }
Esempio n. 41
0
        void channel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            if (!channel.IsShellTileBound)
                channel.BindToShellTile();

            if (!channel.IsShellToastBound)
                channel.BindToShellToast();

            try
            {
                channelUri = channel.ChannelUri.ToString();
                apiMethodRequest.SendRequest(VkApi.Authorization.AccessToken, "account.registerDevice", new Dictionary<string, string>() { {"token", channel.ChannelUri.ToString()} });
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            if (!channel.IsShellTileBound)
            {
                channel.BindToShellTile();
            }

            if (weeklyThaiRecipeSettings.IsNotificationAllowed)
            {
                if (!channel.IsShellToastBound)
                {
                    channel.BindToShellToast();
                }
            }

            string uniqueId = deviceIdRepository.RetrieveId();
            registrationService.RegisterPhone(uniqueId, e.ChannelUri.ToString());
        }
Esempio n. 43
0
        void channel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            if (!channel.IsShellTileBound)
                channel.BindToShellTile();

            if (!channel.IsShellToastBound)
                channel.BindToShellToast();
            channel.ShellToastNotificationReceived += new EventHandler<NotificationEventArgs>(channel_ShellToastNotificationReceived);
            channel.HttpNotificationReceived += new EventHandler<HttpNotificationEventArgs>(channel_HttpNotificationReceived);

            try
            {
                pushClient.RegisterPhoneAsync(WP7App1.Bootstrapper.phoneId, channel.ChannelUri.ToString(), username);
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
Esempio n. 44
0
 void PushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
 {
     Debug.WriteLine(e.ChannelUri.ToString());
     PushChannel = e.ChannelUri;
 }
        void httpChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            connectedToMSPN = true;

            ClearDataRequests();

            App.Trace("Channel opened. Got Uri:\n" +
                httpChannel.ChannelUri.ToString());
            App.Trace("Subscribing to channel events");
            SubscribeToService();
            SubscribeToNotifications();

            UpdateStatus("Channel created successfully");
        }
 void channel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
 {
     Dispatcher.BeginInvoke(() => channelUri.Text = e.ChannelUri.ToString());
 }
Esempio n. 47
0
 private void PushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
 {
     throw new NotImplementedException();
 }
Esempio n. 48
0
    static void channel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
    {

    }
Esempio n. 49
0
        /// <summary>
        /// Event handler for when the push channel Uri is updated.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void PushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {

            Dispatcher.BeginInvoke(() =>
            {
                // Display the new URI for testing purposes.   Normally, the URI would be passed back to your web service at this point.
                System.Diagnostics.Debug.WriteLine(e.ChannelUri.ToString());
                pushurl = e.ChannelUri.ToString();
                //MessageBox.Show(String.Format("Channel Uri is {0}",
                //    e.ChannelUri.ToString()));
                /*using (var httpClient = new HttpClient())
                {
                    //httpClient.BaseAddress = new Uri("http://alarm.fr.to/");
                    httpClient.DefaultRequestHeaders.Accept.Clear();
                    httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                    httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", "YW5vbnltb3VzOmFub255bW91cw==");

                    var message = new
                    {
                        url = e.ChannelUri.ToString()
                    };
                    var json_object = JsonConvert.SerializeObject(message);


                    HttpContent content = new StringContent(json_object.ToString(), Encoding.UTF8);
                    content.Headers.ContentType = new MediaTypeHeaderValue("application/json");


                    //HttpResponseMessage response = httpClient.PostAsync("http://alarm.fr.to/api", content).Result;
                    var response = httpClient.PostAsync("http://alarm.fr.to/api", content);
                    //string statusCode = response.StatusCode.ToString();

                    //response.EnsureSuccessStatusCode();
                    //Task<string> responseBody = response.Content.ReadAsStringAsync();
                }*/


            });
        }
        /// <summary>
        /// Event handler for when the push channel Uri is updated.
        /// </summary>
        public void ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            NotificationUri = e.ChannelUri.ToString();
            installaction.notificationUri = NotificationUri;

            // Display the new URI for testing purposes.   Normally, the URI would be passed back to your web service at this point.
            BmobDebug.Log(String.Format("Channel Uri is {0}", NotificationUri));

            fetchAndUpdateNotifactionUri();
        }
        void PushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            //Store channel URI in app setttings
            AppSettings.StoreSetting(Shared.SETTING_CHANNEL_URI, e.ChannelUri.ToString());

            Dispatcher.BeginInvoke(() =>
            {
                //Enable Register/unregister toggle button
                ToggleSwitchRegisterUnregister.IsEnabled = true;

                SetProcessing(false);
                TextBlockError.Text = "";
            });
        }
 void httpChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
 {
     //You get the new Uri (or maybe it's updated)
     OnChannelUriChanged(e.ChannelUri);
 }
        private async void ChannelUriUpdated(
            object sender, NotificationChannelUriEventArgs args)
        {
            RegistrationId = args.ChannelUri.ToString();
            
            if (!_attemptedRegistration) return;

            await SetUpInAppNotificationsAsync();
        }
Esempio n. 54
0
 private void ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
 {
     App.ViewModel.ChannelUri = e.ChannelUri;
     UpdateShellTileBinding();
 }
Esempio n. 55
0
        private void PushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            Debug.WriteLine("[App] New Push channel URI is {0}", e.ChannelUri);

            // Store the push channel URI
            this.PushChannelUri = e.ChannelUri;

            //  Let listeners know that we have a push channel URI
            if (this.PushChannelUriChanged != null)
            {
                this.PushChannelUriChanged(this, this.PushChannelUri);
            }

            // TODO: Let your cloud server know that the push channel to this device is e.ChannelUri.
        }
Esempio n. 56
0
 private void CurrentChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
 {
     NotifyRegitrationIfNeeded();
 }
Esempio n. 57
0
 /// <summary>
 /// 推送通知URL更新时触发
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private static void _pushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
 {
     JudgeUri(e.ChannelUri.AbsoluteUri);
 }
Esempio n. 58
0
        private void PushChannelOnChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            Log("URI update invoked\n");

            // Display the new URI for testing purposes. Normally, the URI would be passed back to your web service at this point.
            RegisterOnServer(e.ChannelUri.ToString());
        }
        /// <summary>
        /// Event signaled when the notification channel is established
        /// </summary>
        /// <param name="sender">The sending object</param>
        /// <param name="e">The event arguments</param>
        private void httpChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            Trace("Channel opened. Got Uri:\n" + HttpChannel.ChannelUri.ToString());

            
            if ((NotificationFlag & NotificationFlagType.Toast) == NotificationFlagType.Toast)
            {
                SubscribeToToastNotifications(HttpChannel);
            }
            if ((NotificationFlag & NotificationFlagType.Tile) == NotificationFlagType.Tile)
            {
                SubscribeToTileNotifications(HttpChannel);
            }
            
            //NotificationFlag |= NotificationFlagType.Tile;
            UpdateStatus("Channel created successfully");
        }
        void httpChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            Trace("Channel opened. Got Uri:\n" + httpChannel.ChannelUri.ToString());
            Trace("Subscribing to channel events");
            SubscribeToService();

            Dispatcher.BeginInvoke(() => UpdateStatus("Channel created successfully"));
        }