public void AmazonAdm_Simple_Test() { var wait = new ManualResetEvent(false); var settings = new AdmPushChannelSettings ("client_id", "client_secret"); var adm = new AdmPushChannel (settings); var n = new AdmNotification (); n.Data.Add ("Test", "value"); n.RegistrationId = "12345"; adm.SendNotification (n, (sender, response) => wait.Set()); wait.WaitOne (); }
public AdmPushChannel (AdmPushChannelSettings admSettings) { this.admSettings = admSettings; Expires = DateTime.UtcNow.AddYears(-1); //http.DefaultRequestHeaders.Add ("Content-Type", "application/json"); http.DefaultRequestHeaders.Add ("X-Amzn-Type-Version", "[email protected]"); http.DefaultRequestHeaders.Add ("X-Amzn-Accept-Type", "[email protected]"); http.DefaultRequestHeaders.Add ("Accept", "application/json"); //http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", this.AccessToken); http.DefaultRequestHeaders.ConnectionClose = true; http.DefaultRequestHeaders.Remove("connection"); }
public AdmPushChannel(AdmPushChannelSettings admSettings) { this.admSettings = admSettings; Expires = DateTime.UtcNow.AddYears(-1); //http.DefaultRequestHeaders.Add ("Content-Type", "application/json"); http.DefaultRequestHeaders.Add("X-Amzn-Type-Version", "[email protected]"); http.DefaultRequestHeaders.Add("X-Amzn-Accept-Type", "[email protected]"); http.DefaultRequestHeaders.Add("Accept", "application/json"); //http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", this.AccessToken); http.DefaultRequestHeaders.ConnectionClose = true; http.DefaultRequestHeaders.Remove("connection"); }
public static void RegisterGcmService(this PushBroker broker, AdmPushChannelSettings channelSettings, PushServiceSettings serviceSettings = null) { broker.RegisterService<AdmNotification>(new AdmPushService(new AdmPushChannelFactory(), channelSettings, serviceSettings)); }
public static void RegisterAdmService(this IPushBroker broker, AdmPushChannelSettings channelSettings, IPushServiceSettings serviceSettings = null) { RegisterAdmService (broker, channelSettings, null, serviceSettings); }
public AdmPushService(IPushChannelFactory pushChannelFactory, AdmPushChannelSettings channelSettings, IPushServiceSettings serviceSettings) : base(pushChannelFactory ?? new AdmPushChannelFactory(), channelSettings, serviceSettings) { }
public AdmPushService(IPushChannelFactory pushChannelFactory, AdmPushChannelSettings channelSettings) : this(pushChannelFactory, channelSettings, default(IPushServiceSettings)) { }
public AdmPushService(AdmPushChannelSettings channelSettings, IPushServiceSettings serviceSettings) : this(default(IPushChannelFactory), channelSettings, serviceSettings) { }