{"action":"closed","issue":{"url":"https://api.github.com/repos/Redth/PushSharp/issues/457","repository_url":"https://api.github.com/repos/Redth/PushSharp","labels_url":"https://api.github.com/repos/Redth/PushSharp/issues/457/labels{/name}","comments_url":"https://api.github.com/repos/Redth/PushSharp/issues/457/comments","events_url":"https://api.github.com/repos/Redth/PushSharp/issues/457/events","html_url":"https://github.com/Redth/PushSharp/issues/457","id":48571294,"number":457,"title":"WindowsPhone firing 6 events for a single WindowsPhoneToastNotification notification","user":{"login":"benamada","id":8443403,"avatar_url":"https://avatars.githubusercontent.com/u/8443403?v=3","gravatar_id":"","url":"https://api.github.com/users/benamada","html_url":"https://github.com/benamada","followers_url":"https://api.github.com/users/benamada/followers","following_url":"https://api.github.com/users/benamada/following{/other_user}","gists_url":"https://api.github.com/users/benamada/gists{/gist_id}","starred_url":"https://api.github.com/users/benamada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benamada/subscriptions","organizations_url":"https://api.github.com/users/benamada/orgs","repos_url":"https://api.github.com/users/benamada/repos","events_url":"https://api.github.com/users/benamada/events{/privacy}","received_events_url":"https://api.github.com/users/benamada/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Redth/PushSharp/labels/v2-is-dead-wont-fix","name":"v2-is-dead-wont-fix","color":"d4c5f9"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-11-12T22:24:09Z","updated_at":"2016-02-21T03:35:02Z","closed_at":"2016-02-21T03:35:02Z","body":"When using the boilerplate code:\r\n\r\n    pushBroker.RegisterWindowsPhoneService();\r\n    pushBroker.QueueNotification(new WindowsPhoneToastNotification()....);\r\n\r\nI get 6 of each of the following events firing: `ChannelCreated`, `NotificationSent`, `ChannelDestroyed`.\r\n\r\nIt looks like it's related to the fact that `RegisterWindowsPhoneService` registers 6 separate Windows Phone services ([source](https://github.com/Redth/PushSharp/blob/master/PushSharp.WindowsPhone/WindowsPhonePushBrokerExtensions.cs)).\r\n\r\n**This doesn't seem right that I'm queuing a single `WindowsPhoneToastNotification` notification, but events for these other 5 services are firing** (`WindowsPhoneCycleTileNotification`, `WindowsPhoneFlipTileNotification`, `WindowsPhoneIconicTileNotification`, `WindowsPhoneTileNotification`, `WindowsPhoneRawNotification`).\r\n\r\nAs a workaround, rather than calling `RegisterWindowsPhoneService`, I'm using the following code from [this closed issue](https://github.com/Redth/PushSharp/issues/351):\r\n\r\n    pushBroker.RegisterService<WindowsPhoneToastNotification>(\r\n        new WindowsPhonePushService(new WindowsPhonePushChannelSettings()));\r\n\r\nWith the above code, these events only fire 1 time, which is the expected behavior.\r\n\r\nI'm on PushSharp v2.2.0."}}