-
Notifications
You must be signed in to change notification settings - Fork 614
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
fix: normalize use of integers for notification IDs #195
Conversation
A bit of ancient history. So if we are going to accept String as identifier, it should be documented that it only allows strings with numeric format, and Android code should be updated to accept those too. (This is only an Android limitation, on iOS it could use regular strings without casing to integer) So, I personally think that we should stick to allowing only number, but make getPending and other methods return the identifier as integer and not as string. |
I agree. @theproducer can you add this?
Agreed, but this is a breaking change for apps. This PR address this particular issue. We should definitely fix the architecture issues in a later release, but it will have to be a major version with documented breaking changes. |
It’s a breaking change, but it’s technically a new plugin, so I think it’s the perfect time for doing it. Part of moving plugins out was to find design flaws and fix them and this is clearly a bug. |
But we should try to minimize the amount of work app developers need to do when updating from v2 to v3.
This may have been an early goal, but we started moving them over faster to save time. With the plugins moved out, we have the opportunity for app developers to migrate incrementally instead of all at once, and I think we should do that here. |
Yeah, but in this case despite fixing it is a breaking change, it’s a bug fix after all, I don’t think we should avoid fixing it properly just to not break it. If you create a notification with an integer, you should be able to cancel it with an integer, making the user convert it to string makes no sense to me. |
Ok, I've gone ahead and made changes so that it requires / returns integers in both directions. |
Can you change the PR title and description? |
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.
on iOS, when you schedule a notification it still returns the id as string
also when the notification is received and received
listener is called, the id is also a string
on Android and web it's working fine
Scheduling a notification takes an integer ID, yet canceling a notification expects a string (and will do nothing if a integer is sent).
This PR brings consistency to the schedule and cancel methods, now requiring an integer ids for both operations.
closes #176