{"action":"created","issue":{"url":"https://api.github.com/repos/ostownsville/cordova-plugin-fcm/issues/7","repository_url":"https://api.github.com/repos/ostownsville/cordova-plugin-fcm","labels_url":"https://api.github.com/repos/ostownsville/cordova-plugin-fcm/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/ostownsville/cordova-plugin-fcm/issues/7/comments","events_url":"https://api.github.com/repos/ostownsville/cordova-plugin-fcm/issues/7/events","html_url":"https://github.com/ostownsville/cordova-plugin-fcm/pull/7","id":256605692,"number":7,"title":"Updated readme and slight fix for topics","user":{"login":"chrisjpalmer","id":29791291,"avatar_url":"https://avatars3.githubusercontent.com/u/29791291?v=4","gravatar_id":"","url":"https://api.github.com/users/chrisjpalmer","html_url":"https://github.com/chrisjpalmer","followers_url":"https://api.github.com/users/chrisjpalmer/followers","following_url":"https://api.github.com/users/chrisjpalmer/following{/other_user}","gists_url":"https://api.github.com/users/chrisjpalmer/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisjpalmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisjpalmer/subscriptions","organizations_url":"https://api.github.com/users/chrisjpalmer/orgs","repos_url":"https://api.github.com/users/chrisjpalmer/repos","events_url":"https://api.github.com/users/chrisjpalmer/events{/privacy}","received_events_url":"https://api.github.com/users/chrisjpalmer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-09-11T07:26:13Z","updated_at":"2017-09-19T22:02:16Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/ostownsville/cordova-plugin-fcm/pulls/7","html_url":"https://github.com/ostownsville/cordova-plugin-fcm/pull/7","diff_url":"https://github.com/ostownsville/cordova-plugin-fcm/pull/7.diff","patch_url":"https://github.com/ostownsville/cordova-plugin-fcm/pull/7.patch"},"body":"**Updated the readme.**\r\nWe should consider taking down the 'donate' stuff. Or if we can get back in touch with the original project manager we could leave it up for them.\r\n\r\n**Topics**\r\nSlight fix for topics, you no longer need the '/topics/' prefix according to the current API.\r\n\r\n**Auto-subscription to Topics**\r\nAlso in a different PR it was discussed whether we needed to reimplement the automatic topic subscription to 'ios' and 'all' topics. The basis of this thought was to try and be consistent with the android side of the plugin. Android does indeed to some automatic topic subscription:\r\n\r\n```\r\nFirebaseMessaging.getInstance().subscribeToTopic(\"android\");\r\n FirebaseMessaging.getInstance().subscribeToTopic(\"all\");\r\n```\r\n\r\nAnd ios is meant to do the same (not actually a requirement of Firebase)\r\n```\r\n[[FIRMessaging messaging] subscribeToTopic:@\"ios\"]\r\n[[FIRMessaging messaging] subscribeToTopic:@\"all\"]\r\n```\r\n\r\nHowever it turns out this is slightly tricker than we all thought. If you do it in the plugin initialiser, FCM returns an error saying that there is no device token. The reason is FCM hasn't been given a chance to load. You get this error specifically: `Cannot subscribe to topic: ios with token: (null)`\r\n\r\nI had a brief look at [this blog post](https://stackoverflow.com/questions/37549717/cannot-receive-push-notification-on-ios-from-firebase-3-2-0-topics) and tried the suggested solution but it does not work - i am guessing due to FCM method swizzling which denies the callback from being fired directly.\r\n\r\n\r\nWe could turn swizzling off... it may solve the problem, or it may not. Nevertheless its a bit of work and debugging to do that. For now its probably okay to leave them out and perhaps take the auto-subscriptions out of the android side as well to be consistent.\r\n\r\nThe readme does not mention this 'auto-subscription' anywhere and it kind of goes against the expected behaviour of the plugin. Would be interested on your thoughts @ostownsville \r\n\r\n**Enabled  [FIRMessaging messaging].delegate = self for iOS 9.0**\r\nI noticed that this code was only included in the iOS 10 preprocessor macro. Its actually needed for iOS 9 as well because even though data messages in iOS 9 don't use the message:didRecieveMessage: methods, the token refresh mechanism is actually provided though the FIRMessagingDelegate!"},"comment":{"url":"https://api.github.com/repos/ostownsville/cordova-plugin-fcm/issues/comments/330686741","html_url":"https://github.com/ostownsville/cordova-plugin-fcm/pull/7#issuecomment-330686741","issue_url":"https://api.github.com/repos/ostownsville/cordova-plugin-fcm/issues/7","id":330686741,"user":{"login":"chrisjpalmer","id":29791291,"avatar_url":"https://avatars3.githubusercontent.com/u/29791291?v=4","gravatar_id":"","url":"https://api.github.com/users/chrisjpalmer","html_url":"https://github.com/chrisjpalmer","followers_url":"https://api.github.com/users/chrisjpalmer/followers","following_url":"https://api.github.com/users/chrisjpalmer/following{/other_user}","gists_url":"https://api.github.com/users/chrisjpalmer/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisjpalmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisjpalmer/subscriptions","organizations_url":"https://api.github.com/users/chrisjpalmer/orgs","repos_url":"https://api.github.com/users/chrisjpalmer/repos","events_url":"https://api.github.com/users/chrisjpalmer/events{/privacy}","received_events_url":"https://api.github.com/users/chrisjpalmer/received_events","type":"User","site_admin":false},"created_at":"2017-09-19T22:02:16Z","updated_at":"2017-09-19T22:02:16Z","author_association":"NONE","body":"Hi there. This one has a good fix for iOS 9, could we get merged?"}}
{"actor":{"display_login":"chrisjpalmer"}}