-
-
Notifications
You must be signed in to change notification settings - Fork 105
Add macOS and tvOS push notification support #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add macOS and tvOS push notification support #58
Conversation
@flovilmart This is what I came up with. Can you please take a look? |
Is |
I need some help on the last spec test. I do not know why it fails with I added some debug logging and saw this:
It groups devices correctly: However it reports invalid connection for ios and tvos devices later. Any idea what part in the code causes this problem? |
I spend hours trying to figure out why this test case does fail. Because I did not know what change caused the test case to fail I switched back to the master branch. Result: The test case does not run either!
So I do not see how I can make this test pass if it does not even work in your current master. @flovilmart I really need help on this PR now. I do not see what I can improve now. |
The print out shows that the tests are passing. (0 failures) |
So this is ready to merge?
… On 3 Mar 2017, at 14:07, Florent Vilmart ***@***.***> wrote:
The print out shows that the tests are passing. (0 failures)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I'll check it out on my machine and see what can fail |
I found the reason of the failures (APNs is throwing an exception when the certificate is missing), and I'Ll try to provide a fix on the top of your branch, Is that ok for you? |
@flovilmart This is great news! Of course you can add your changes. I granted you push access to my fork in case it is required. Thank you for looking into it and helping me out! :) |
That's not required, I can push on the PR branch directly :) Thanks! |
@funkenstrahlen I uncovered additional inconsistencies with our implementation. I'm still working on it :) |
src/ParsePushAdapter.js
Outdated
let devices = deviceMap[pushType]; | ||
|
||
if (!sender) { | ||
if (pushType == 'tvos') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure this fallback is required. Even if it leads to redundancy for all 'apple' push types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this as it was suggested in the related issue. However I also think it is better to not add redundancy and require the admin to define a certificate for each plattform he wants to support.
src/ParsePushAdapter.js
Outdated
sender = this.senderMap['ios']; | ||
} else if (pushType == 'ios') { | ||
// if there is only a tvos push configuration available reuse it for ios | ||
sender = this.senderMap['tvos']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it may also be 'macos'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you suggesting to also add macos
into this redundancy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I'm not sure if we should automatically do that. Do you Think of any real world use case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally think it is is more transparent if we do not add this redundancy. If someone needs support for multiple push targets he needs to define all of them in his config. He can use the same certificate of course.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you agree on this I will remove the redundancy code and adjust the spec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fully agreed! less code, better code!
@flovilmart Thanks for fixing the spec! Anything further I can do to help getting this merged? What inconsistencies did you recognize? |
@flovilmart I removed the redundancy push configuration code as we discussed and also adjusted the spec. |
Yeah! Took some commits but we're there!! |
Awesome! Thanks for helping me getting this done! :) Do you think this is worth a version bump? |
Yep definitely! We should probably release it :) Do you want to open a PR with the version bump and CHANGELOG? |
Make push notifications work for macOS and tvOS.
This is linked to this issue: #11