Example #1
0
        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 ();
        }
Example #2
0
		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");
		}
Example #3
0
        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);
		}
Example #6
0
 public AdmPushService(IPushChannelFactory pushChannelFactory, AdmPushChannelSettings channelSettings, IPushServiceSettings serviceSettings)
     : base(pushChannelFactory ?? new AdmPushChannelFactory(), channelSettings, serviceSettings)
 {
 }
Example #7
0
 public AdmPushService(IPushChannelFactory pushChannelFactory, AdmPushChannelSettings channelSettings)
     : this(pushChannelFactory, channelSettings, default(IPushServiceSettings))
 {
 }
Example #8
0
 public AdmPushService(AdmPushChannelSettings channelSettings, IPushServiceSettings serviceSettings)
     : this(default(IPushChannelFactory), channelSettings, serviceSettings)
 {
 }
Example #9
0
		public AdmPushService(IPushChannelFactory pushChannelFactory, AdmPushChannelSettings channelSettings, IPushServiceSettings serviceSettings)
			: base(pushChannelFactory ?? new AdmPushChannelFactory(), channelSettings, serviceSettings)
		{
		}
Example #10
0
		public AdmPushService(IPushChannelFactory pushChannelFactory, AdmPushChannelSettings channelSettings)
			: this(pushChannelFactory, channelSettings, default(IPushServiceSettings))
		{
		}
Example #11
0
		public AdmPushService(AdmPushChannelSettings channelSettings, IPushServiceSettings serviceSettings)
			: this(default(IPushChannelFactory), channelSettings, serviceSettings)
		{
		}