public WindowsPhoneNotificationService(IPushBroker pushBroker, ILogger logger, IWindowsPhoneServiceSettings settings)
 {
     PushBroker = pushBroker;
     Logger = logger;
     SetupPushSharpLogging(settings);
     Result = new OperationResult(false, string.Empty);
 }
Example #2
0
 public WindowsPhoneNotificationService(IPushBroker pushBroker, ILogger logger, IWindowsPhoneServiceSettings settings)
 {
     PushBroker = pushBroker;
     Logger     = logger;
     SetupPushSharpLogging(settings);
     Result = new OperationResult(false, string.Empty);
 }
Example #3
0
 public ServiceWorkerAdapter(IPushBroker <TNotification> broker, IPushConnection <INotification> connection)
 {
     Broker            = broker;
     Connection        = connection;
     CancelTokenSource = new CancellationTokenSource();
     notifications     = new BlockingCollection <TNotification>();
 }
Example #4
0
        private void UdpServerForm_Load(object sender, EventArgs e)
        {
            //Port = DEFAULT_PORT;
            //var ip = IPAddress.Any;

            //Console.WriteLine("Starting echo server...");
            //Console.WriteLine("Will begin listening for requests on {0}:{1}", ip, Port);
            //var bootstrapper =
            //    new ServerBootstrap()
            //        .WorkerThreads(2)
            //        .SetTransport(TransportType.Udp);
            //var reactor = bootstrapper.NewReactor(NodeBuilder.BuildNode().Host(ip).WithPort(Port));
            //reactor.OnConnection += (node, connection) =>
            //{
            //    ServerPrint(node,
            //        string.Format("Accepting connection from... {0}:{1}", node.Host, node.Port));
            //    connection.BeginReceive(Receive);
            //};
            //reactor.OnDisconnection += (reason, address) => ServerPrint(address.RemoteHost,
            //    string.Format("Closed connection to... {0}:{1} [Reason:{2}]", address.RemoteHost.Host,
            //        address.RemoteHost.Port, reason.Type));

            //reactor.Start();
            IConnectionConfig connectionConfig = new DefaultConnectionConfig();

            connectionConfig.SetOption(WebSocketParamEumns.Port.ToString(), 8088);
            var bootstrapper = new PushBootstrap()
                               .SetPushType(PushTypeEumns.WebSocket)
                               .WorkerThreads(2)
                               .BuildPushServerFactory <WebSocketNotifications>();
            IPushBroker <WebSocketNotifications> pushBroker = bootstrapper.NewPushBroker(connectionConfig) as IPushBroker <WebSocketNotifications>;

            pushBroker.OnConnection += PushBroker_OnNewConnection;
            pushBroker.Start();
        }
 public GoogleGcmNotificationService(IPushBroker pushBroker, ILogger logger, IGoogleServiceSettings settings)
 {
     PushBroker = pushBroker;
     _Settings  = settings;
     Logger     = logger;
     SetupPushSharpLogging(settings);
     Result = new OperationResult(false, string.Empty);
 }
 public AppleNotificationService(IPushBroker pushBroker, ILogger logger, IAppleServiceSettings settings)
 {
     PushBroker = pushBroker;
     _Settings = settings;
     Logger = logger;
     SetupPushSharpLogging(settings);
     Result = new OperationResult(false, string.Empty);
 }
Example #7
0
 public WorkDocker(IPushBroker <TNotification> broker, IPushConnectionFactory connectionFactory)
 {
     PushBroker        = broker;
     ConnectionFactory = connectionFactory;
     lockWorkers       = new object();
     workers           = new List <ServiceWorkerAdapter <TNotification> >();
     ScaleSize         = 1;
     //AutoScale = true;
     //AutoScaleMaxSize = 20;
 }
Example #8
0
        public static void RegisterWindowsService(this IPushBroker broker, WindowsPushChannelSettings channelSettings, string applicationId, IPushServiceSettings serviceSettings = null)
        {
            var service = new WindowsPushService(new WindowsPushChannelFactory(), channelSettings, serviceSettings);

            broker.RegisterService <WindowsRawNotification>(service, applicationId);
            broker.RegisterService <WindowsTileNotification>(service, applicationId);
            broker.RegisterService <WindowsToastNotification>(service, applicationId);
            broker.RegisterService <WindowsBadgeNumericNotification>(service, applicationId);
            broker.RegisterService <WindowsBadgeGlyphNotification>(service, applicationId);
        }
 protected void UnHookEvents(IPushBroker pushBroker)
 {
     pushBroker.OnNotificationSent          -= NotificationSent;
     pushBroker.OnChannelException          -= ChannelException;
     pushBroker.OnServiceException          -= ServiceException;
     pushBroker.OnNotificationFailed        -= NotificationFailed;
     pushBroker.OnDeviceSubscriptionExpired -= DeviceSubscriptionExpired;
     pushBroker.OnDeviceSubscriptionChanged -= DeviceSubscriptionChanged;
     pushBroker.OnChannelCreated            -= ChannelCreated;
     pushBroker.OnChannelDestroyed          -= ChannelDestroyed;
 }
Example #10
0
        public static void RegisterWindowsPhoneService(this IPushBroker broker, WindowsPhonePushChannelSettings channelSettings, string applicationId, IPushServiceSettings serviceSettings = null)
        {
            var service = new WindowsPhonePushService(new WindowsPhonePushChannelFactory(), channelSettings, serviceSettings);

            broker.RegisterService <WindowsPhoneCycleTileNotification>(service, applicationId);
            broker.RegisterService <WindowsPhoneFlipTileNotification>(service, applicationId);
            broker.RegisterService <WindowsPhoneIconicTileNotification>(service, applicationId);
            broker.RegisterService <WindowsPhoneTileNotification>(service, applicationId);
            broker.RegisterService <WindowsPhoneToastNotification>(service, applicationId);
            broker.RegisterService <WindowsPhoneRawNotification>(service, applicationId);
        }
Example #11
0
 public static void RegisterBlackberryService(this IPushBroker broker, BlackberryPushChannelSettings channelSettings, IPushServiceSettings serviceSettings = null)
 {
     RegisterBlackberryService(broker, channelSettings, null, serviceSettings);
 }
 public NotificationSender(IPushBroker broker)
 {
     this.broker = broker;
     this.channels = new Dictionary<Type, IPushChannel>();
 }
Example #13
0
 public static WindowsBadgeGlyphNotification WindowsBadgeGlyphNotification(this IPushBroker broker)
 {
     return(new WindowsBadgeGlyphNotification());
 }
Example #14
0
 public static void RegisterAdmService(this IPushBroker broker, AdmPushChannelSettings channelSettings, string applicationId, IPushServiceSettings serviceSettings = null)
 {
     broker.RegisterService <AdmNotification>(new AdmPushService(new AdmPushChannelFactory(), channelSettings, serviceSettings));
 }
Example #15
0
 public static GcmNotification GcmNotification(this IPushBroker broker)
 {
     return(new GcmNotification());
 }
Example #16
0
 /// <summary>
 /// Create a new instance of the <see cref="FirefoxOSNotification"/> class.
 /// </summary>
 ///
 /// <param name="broker">Registration broker.</param>
 ///
 /// <returns>Created notification object.</returns>
 public static FirefoxOSNotification FirefoxOSNotification(this IPushBroker broker)
 {
     return(new FirefoxOSNotification());
 }
Example #17
0
 /// <summary>
 /// Registers FirefoxOS service.
 /// </summary>
 ///
 /// <param name="broker">Registration broker.</param>
 public static void RegisterFirefoxOSService(this IPushBroker broker)
 {
     broker.RegisterService <FirefoxOSNotification>(new FirefoxOSPushService());
 }
Example #18
0
 public static void RegisterWindowsPhoneService(this IPushBroker broker, string applicationId, IPushServiceSettings serviceSettings = null)
 {
     RegisterWindowsPhoneService(broker, null, applicationId, serviceSettings);
 }
Example #19
0
 public static WindowsPhoneRawNotification WindowsPhoneRawNotification(this IPushBroker broker)
 {
     return(new WindowsPhoneRawNotification());
 }
Example #20
0
 public static void RegisterChromeGcmService(this IPushBroker broker, ChromePushChannelSettings channelSettings, string applicationId = null, IPushServiceSettings serviceSettings = null)
 {
     broker.RegisterService <ChromeNotification>(new ChromePushService(channelSettings, serviceSettings), applicationId);
 }
Example #21
0
 public static void RegisterWindowsService(this IPushBroker broker, WindowsPushChannelSettings channelSettings, IPushServiceSettings serviceSettings = null)
 {
     RegisterWindowsService(broker, channelSettings, null, serviceSettings);
 }
Example #22
0
 public static void RegisterChromeGcmService(this IPushBroker broker, ChromePushChannelSettings channelSettings, IPushServiceSettings serviceSettings = null)
 {
     RegisterChromeGcmService(broker, channelSettings, null, serviceSettings);
 }
Example #23
0
 public static WindowsToastNotification WindowsToastNotification(this IPushBroker broker)
 {
     return(new WindowsToastNotification());
 }
Example #24
0
 public static BlackberryNotification BlackberryNotification(this IPushBroker broker)
 {
     return(new BlackberryNotification());
 }
Example #25
0
 public static AdmNotification AdmNotification(this IPushBroker broker)
 {
     return(new AdmNotification());
 }
Example #26
0
 public static void RegisterWindowsPhoneService(this IPushBroker broker, IPushServiceSettings serviceSettings = null)
 {
     RegisterWindowsPhoneService(broker, null, null, serviceSettings);
 }
Example #27
0
 public static ChromeNotification ChromeNotification(this IPushBroker broker)
 {
     return(new ChromeNotification());
 }
Example #28
0
 public static void RegisterC2dmService(this IPushBroker broker, C2dmPushChannelSettings channelSettings, string applicationId, IPushServiceSettings serviceSettings = null)
 {
     broker.RegisterService <C2dmNotification>(new C2dmPushService(channelSettings, serviceSettings), applicationId);
 }
Example #29
0
 public static C2dmNotification C2dmNotification(this IPushBroker broker)
 {
     return(new C2dmNotification());
 }
Example #30
0
 public static void RegisterBlackberryService(this IPushBroker broker, BlackberryPushChannelSettings channelSettings, string applicationId = null, IPushServiceSettings serviceSettings = null)
 {
     broker.RegisterService <BlackberryNotification>(new BlackberryPushService(channelSettings, serviceSettings), applicationId);
 }