예제 #1
0
 private static void ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
 {
     if (App.Channel != null && App.Channel.ChannelUri != null)
     {
         CurrentChannel.ChannelUri = App.Channel.ChannelUri.AbsoluteUri;
     }
 }
예제 #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);
            }
        }
예제 #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()));
     });
 }
예제 #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();
        }
예제 #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();
        }
예제 #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(() => { });
        }
예제 #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); //异步操作完成时发生
        }
예제 #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()));
     });
 }
예제 #11
0
 private void PushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
 {
     Dispatcher.BeginInvoke(() =>
     {
         System.Diagnostics.Debug.WriteLine(e.ChannelUri.ToString());
     });
 }
예제 #12
0
 /// <summary>
 /// Raises the ChannelUriUpdated event.
 /// </summary>
 /// <param name="e"></param>
 protected virtual void OnChannelUriUpdated(NotificationChannelUriEventArgs e)
 {
     if (ChannelUriUpdated != null)
     {
         ChannelUriUpdated(this, e);
     }
 }
예제 #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();
        }
예제 #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)));
 }
예제 #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);
 }
예제 #16
0
        void myChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            // サービスにチャンネルを登録する
            Debug.WriteLine("Notification channel URI:" + e.ChannelUri.ToString());

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

            });
        }
예제 #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());
        });
 }
예제 #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);
     });
 }
예제 #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();
        }
예제 #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();
        }
예제 #22
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));
 }
예제 #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() });
        }
예제 #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();
     }
     
 }
예제 #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));
        }
예제 #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();
        }
예제 #28
0
파일: Utils.cs 프로젝트: nbclark/commuter
        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);
 }
예제 #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()));
     });
 }
예제 #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();
            }
        }
예제 #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();
        }
예제 #33
0
        void OnChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
        {
            channelUri = e.ChannelUri;

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

            httpChannel.HttpNotificationReceived += OnHttpNotification;
            httpChannel.ShellToastNotificationReceived += OnToastNotification;
        }
예제 #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);
            }
예제 #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());
     }
         );
 }
예제 #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");
        }
예제 #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));
        }
예제 #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));
        }
예제 #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());
        }
예제 #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;
            }
        }
예제 #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());
 }
예제 #47
0
 private void PushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
 {
     throw new NotImplementedException();
 }
예제 #48
0
    static void channel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
    {

    }
예제 #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();
                }*/


            });
        }
예제 #50
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();
        }
        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();
        }
예제 #54
0
 private void ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
 {
     App.ViewModel.ChannelUri = e.ChannelUri;
     UpdateShellTileBinding();
 }
예제 #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.
        }
예제 #56
0
 private void CurrentChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
 {
     NotifyRegitrationIfNeeded();
 }
예제 #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);
 }
예제 #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");
        }
예제 #60
0
        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"));
        }