Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat: push permission prompt #101
feat: push permission prompt #101
Changes from 35 commits
05b5141
3ab0477
f284358
b54a680
7ed40a8
98a9cc9
3facddf
4c47773
9261f8e
948aa94
8e6ccc5
3fc5213
50dccfd
8b563b2
a53d30d
010ea97
9446e0b
763ff12
42aa796
2559412
bc3a5bb
09538c6
f2e187e
8abcb6e
43b55a6
7f63d0c
45d35d6
805245a
b11b6fc
203efad
4a2414f
2091998
5a9bf2c
91a245e
f7e4845
0af13ec
13d2f5b
bf640df
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Is there a reason why
any
is used for options parameter?What about using a typescript
interface
instead?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.
That's a good point. I used
any
to prevent customer from importing another interface or config class. But this can be changed.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.
Ok, I can see how not needing to include another import could be nice. However, I believe that if a customer is using typescript in their project, they are OK with adding more imports for types in their code. Also, they probably prefer a strongly typed API when interacting with our SDK. With this in mind, I do believe it's preferred that we replace
any
with a strongly typed interface.If we were to organize all of the
interface
s in the project, I think the import statements for our SDK could look nice in a customer's app.Here is an example of the imports could look like in a customer's app:
I do not see this as a blocker for this PR.
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.
Small idea to share, I think changing the function name to something such as:
would match the function naming of
getPushPermissionStatus
.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.
This is a great suggestion. I will add this in a separate PR. I appreciate the suggestion.
I used "prompt" to make it specific that calling this method would show a prompt on the screen and not do something in the background.
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.
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 tried implementing
customerio-reactnative/types
and found that it has to be a completely new library inside ourcustomerio-reactnative
with it's own package.json, index.ts and other important files. Since we are waiting to release this feature on priority, I do not want to take more time learning & implementing it at the moment. But I really loved the suggestion and will make sure to add it in the future updates. I would also like to add other configs likeCioConfigOptions
to /types so that the importingcustomerio-reactive
could get reclustered as we release new features in future.I still lean towards having promt in the function name as it makes things clear to me as a user. I discussed with Rehan and we both had same POV.
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.
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.
Going along with the comment about a strongly typed parameter for
showPromptForPushNotifications
, we know the data type that is being returned from thePromise
.We should be providing customers with a data type return value that they can easily parse in their code.