{"action":"closed","issue":{"url":"https://api.github.com/repos/mutualmobile/MMWormhole/issues/43","labels_url":"https://api.github.com/repos/mutualmobile/MMWormhole/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/mutualmobile/MMWormhole/issues/43/comments","events_url":"https://api.github.com/repos/mutualmobile/MMWormhole/issues/43/events","html_url":"https://github.com/mutualmobile/MMWormhole/issues/43","id":83451751,"number":43,"title":"Multiple notifications","user":{"login":"halkmund","id":3176300,"avatar_url":"https://avatars.githubusercontent.com/u/3176300?v=3","gravatar_id":"","url":"https://api.github.com/users/halkmund","html_url":"https://github.com/halkmund","followers_url":"https://api.github.com/users/halkmund/followers","following_url":"https://api.github.com/users/halkmund/following{/other_user}","gists_url":"https://api.github.com/users/halkmund/gists{/gist_id}","starred_url":"https://api.github.com/users/halkmund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/halkmund/subscriptions","organizations_url":"https://api.github.com/users/halkmund/orgs","repos_url":"https://api.github.com/users/halkmund/repos","events_url":"https://api.github.com/users/halkmund/events{/privacy}","received_events_url":"https://api.github.com/users/halkmund/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/mutualmobile/MMWormhole/milestones/3","html_url":"https://github.com/mutualmobile/MMWormhole/milestones/1.2.0","labels_url":"https://api.github.com/repos/mutualmobile/MMWormhole/milestones/3/labels","id":1108621,"number":3,"title":"1.2.0","description":"","creator":{"login":"cnstoll","id":1586401,"avatar_url":"https://avatars.githubusercontent.com/u/1586401?v=3","gravatar_id":"","url":"https://api.github.com/users/cnstoll","html_url":"https://github.com/cnstoll","followers_url":"https://api.github.com/users/cnstoll/followers","following_url":"https://api.github.com/users/cnstoll/following{/other_user}","gists_url":"https://api.github.com/users/cnstoll/gists{/gist_id}","starred_url":"https://api.github.com/users/cnstoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cnstoll/subscriptions","organizations_url":"https://api.github.com/users/cnstoll/orgs","repos_url":"https://api.github.com/users/cnstoll/repos","events_url":"https://api.github.com/users/cnstoll/events{/privacy}","received_events_url":"https://api.github.com/users/cnstoll/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":10,"state":"open","created_at":"2015-05-13T13:57:05Z","updated_at":"2015-06-02T15:27:02Z","due_on":"2015-05-15T05:00:00Z","closed_at":null},"comments":3,"created_at":"2015-06-01T11:41:06Z","updated_at":"2015-06-02T15:27:02Z","closed_at":"2015-06-02T15:27:02Z","body":"We encountered this issue in our WatchKit app:\r\n\r\nISSUE:\r\nCalling listenForMessageWithIdentifier n times for an identifier will register n callbacks at the DarwinNotifyCenter. When passing a message, the wormhole broadcasts it n times.\r\n\r\nSOLUTION:\r\nA possible solution would be to change registerForNotificationsWithIdentifier by adding:\r\n\r\n[self unregisterForNotificationsWithIdentifier:identifier];\r\n\r\nLike this:\r\n\r\n- (void)registerForNotificationsWithIdentifier:(NSString *)identifier {\r\n    \r\n    // Only registers once!!!\r\n    [self unregisterForNotificationsWithIdentifier:identifier];\r\n    \r\n    CFNotificationCenterRef const center = CFNotificationCenterGetDarwinNotifyCenter();\r\n    CFStringRef str = (__bridge CFStringRef)identifier;\r\n    CFNotificationCenterAddObserver(center,\r\n                                    (__bridge const void *)(self),\r\n                                    wormholeNotificationCallback,\r\n                                    str,\r\n                                    NULL,\r\n                                    CFNotificationSuspensionBehaviorDeliverImmediately);\r\n}\r\n\r\n"}}