public void Blackberry_Simple_Test() { var waitCallback = new ManualResetEvent (false); var settings = new BlackberryPushChannelSettings("APPID", "PWD"); var c = new BlackberryPushChannel (settings); var n = new BlackberryNotification (); n.Content = new BlackberryMessageContent("text/plain", "66"); n.QualityOfService = QualityOfServiceLevel.Unconfirmed; n.SourceReference = "3682-8s4B97Rc2388i46I8M08769D005ra6286o4"; n.DeliverBeforeTimestamp = DateTime.UtcNow.AddMinutes(1); var r = new BlackberryRecipient ("push_all"); n.Recipients.Add (r); c.SendNotification (n, (sender, resp) => { waitCallback.Set(); }); waitCallback.WaitOne (); }
public Task <HttpResponseMessage> PostNotification(BlackberryPushChannelSettings channelSettings, BlackberryNotification n) { var c = new MultipartContent("related", channelSettings.Boundary); c.Headers.Remove("Content-Type"); c.Headers.TryAddWithoutValidation("Content-Type", "multipart/related; boundary=" + channelSettings.Boundary + "; type=application/xml"); var xml = n.ToPapXml(); c.Add(new StringContent(xml, Encoding.UTF8, "application/xml")); var bc = new ByteArrayContent(n.Content.Content); bc.Headers.Add("Content-Type", n.Content.ContentType); foreach (var header in n.Content.Headers) { bc.Headers.Add(header.Key, header.Value); } c.Add(bc); return(PostAsync(channelSettings.SendUrl, c)); }
public BlackberryPushChannel(BlackberryPushChannelSettings channelSettings, Common.PushServiceSettings serviceSettings = null) : base(channelSettings, serviceSettings) { blackberrySettings = channelSettings; transport = new BlackberryMessageTransportAsync(); transport.MessageResponseReceived += new Action<BlackberryMessageTransportResponse>(transport_MessageResponseReceived); transport.UnhandledException += new Action<BlackberryNotification, Exception>(transport_UnhandledException); }
public BlackberryHttpClient(BlackberryPushChannelSettings channelSettings) : base() { this.channelSettings = channelSettings; var authInfo = channelSettings.ApplicationId + ":" + channelSettings.Password; authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo)); this.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", authInfo); this.DefaultRequestHeaders.ConnectionClose = true; this.DefaultRequestHeaders.Remove("connection"); }
public Task<HttpResponseMessage> PostNotification(BlackberryPushChannelSettings channelSettings, BlackberryNotification n) { var c = new MultipartContent ("related", channelSettings.Boundary); c.Headers.Remove("Content-Type"); c.Headers.TryAddWithoutValidation("Content-Type", "multipart/related; boundary=" + channelSettings.Boundary + "; type=application/xml"); var xml = n.ToPapXml (); c.Add (new StringContent (xml, Encoding.UTF8, "application/xml")); var bc = new ByteArrayContent(n.Content.Content); bc.Headers.Add("Content-Type", n.Content.ContentType); foreach (var header in n.Content.Headers) bc.Headers.Add(header.Key, header.Value); c.Add(bc); return PostAsync (channelSettings.SendUrl, c); }
public static void RegisterBlackberryService(this PushBroker broker, BlackberryPushChannelSettings channelSettings, IPushServiceSettings serviceSettings = null) { RegisterBlackberryService (broker, channelSettings, null, serviceSettings); }
public static void RegisterBlackberryService(this PushBroker broker, BlackberryPushChannelSettings channelSettings, string applicationId = null, IPushServiceSettings serviceSettings = null) { broker.RegisterService<BlackberryNotification>(new BlackberryPushService(channelSettings, serviceSettings), applicationId); }
public BlackberryPushChannel(BlackberryPushChannelSettings channelSettings, Common.PushServiceSettings serviceSettings = null) : base(channelSettings, serviceSettings) { blackberrySettings = channelSettings; }
public BlackberryPushService(IPushChannelFactory pushChannelFactory, BlackberryPushChannelSettings channelSettings, IPushServiceSettings serviceSettings) : base(pushChannelFactory ?? new BisPushChannelFactory(), channelSettings ?? new BlackberryPushChannelSettings(), serviceSettings) { }
public BlackberryPushChannel(BlackberryPushChannelSettings channelSettings) { bisChannelSettings = channelSettings; http = new BlackberryHttpClient(bisChannelSettings); }
public BlackberryPushChannel(BlackberryPushChannelSettings channelSettings) : this(channelSettings, null) { }
public void StartBlackberryPushService(Blackberry.BlackberryPushChannelSettings channelSettings, PushServiceSettings serviceSettings = null) { bbService = new Blackberry.BlackberryPushService(channelSettings, serviceSettings); bbService.Events.RegisterProxyHandler(this.Events); }
public BlackberryPushChannelFactory(BlackberryPushChannelSettings channelSettings) { this.channelSettings = channelSettings; }
public BlackberryPushService(BlackberryPushChannelSettings channelSettings, IPushServiceSettings serviceSettings) : this(default(IPushChannelFactory), channelSettings, serviceSettings) { }
public BlackberryPushService(IPushChannelFactory pushChannelFactory, BlackberryPushChannelSettings channelSettings) : this(pushChannelFactory, channelSettings, default(IPushServiceSettings)) { }
public BlackberryPushService(BlackberryPushChannelSettings channelSettings, Common.PushServiceSettings serviceSettings) : base(channelSettings, serviceSettings) { }
public BlackberryPushService( BlackberryPushChannelSettings channelSettings, PushServiceSettings serviceSettings) : base(new BlackberryPushChannelFactory(channelSettings), serviceSettings) { }