private static void ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e) { if (App.Channel != null && App.Channel.ChannelUri != null) { CurrentChannel.ChannelUri = App.Channel.ChannelUri.AbsoluteUri; } }
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); } }
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())); }); }
private void OnChannelUriUpdated(object sender, NotificationChannelUriEventArgs e) { Debug.WriteLine(e.ChannelUri.ToString()); TLUtils.WriteLine(String.Format("Channel Uri is {0}", e.ChannelUri)); RegisterDeviceAsync(); }
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(); }
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(() => { }); }
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); //异步操作完成时发生 }
private void PushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e) { Dispatcher.BeginInvoke(() => { System.Diagnostics.Debug.WriteLine(e.ChannelUri.ToString()); }); }
/// <summary> /// Raises the ChannelUriUpdated event. /// </summary> /// <param name="e"></param> protected virtual void OnChannelUriUpdated(NotificationChannelUriEventArgs e) { if (ChannelUriUpdated != null) { ChannelUriUpdated(this, e); } }
void NotificationService_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e) { FSLog.Info("Channel URL: ", e.ChannelUri.ToString()); // update URI to settings SettingsManager.NotificationChannelUriString = e.ChannelUri.ToString(); }
private void OnHttpChannelChannelUriUpdated(object sender, NotificationChannelUriEventArgs e) { SubscribeToNotifications(); OnManagementIdChanged(null); SubscribeToManagementServiceAsync(); Deployment.Current.Dispatcher.BeginInvoke(() => UpdateStatus(string.Format("Channel created successfully: {0}", e.ChannelUri))); }
/// <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); }
void myChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e) { // サービスにチャンネルを登録する Debug.WriteLine("Notification channel URI:" + e.ChannelUri.ToString()); string channel = e.ChannelUri.ToString(); RegistToService(channel); }
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()); }); }
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); }); }
void httpChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e) { Trace("Channel opened. Got Uri:\n" + httpChannel.ChannelUri.ToString()); Trace("Subscribing to channel events"); SubscribeToService(); SubscribeToNotifications(); }
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)); }
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() }); }
/// <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(); } }
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(); }
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); }
/// <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())); }); }
/// <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(); } }
/// <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 OnChannelUriUpdated(object sender, NotificationChannelUriEventArgs e) { channelUri = e.ChannelUri; httpChannel.BindToShellTile(); httpChannel.BindToShellToast(); httpChannel.HttpNotificationReceived += OnHttpNotification; httpChannel.ShellToastNotificationReceived += OnToastNotification; }
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); }
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()); } ); }
// 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"); }
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)); }
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)); }
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()); }
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; } }
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()); }
private void PushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e) { throw new NotImplementedException(); }
static void channel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e) { }
/// <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(); }*/ }); }
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(); }
private void ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e) { App.ViewModel.ChannelUri = e.ChannelUri; UpdateShellTileBinding(); }
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. }
private void CurrentChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e) { NotifyRegitrationIfNeeded(); }
/// <summary> /// 推送通知URL更新时触发 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private static void _pushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e) { JudgeUri(e.ChannelUri.AbsoluteUri); }
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")); }