-
Notifications
You must be signed in to change notification settings - Fork 18
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 notification related endpoints and editorconfig #12
Conversation
|
||
const router = express.Router(); | ||
|
||
router.get('/', async (req, res) => { |
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 think receiving notifications with http transport is not used anymore, so we may not need this route. Can you confirm @jm90m ?
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 we are removing this, the validTokenMiddleware
can be applied to the whole /notifications
route.
I think what we miss is a way to send push notification to bSteem users when we stream them here: https://github.com/singhpratyush/busy-api/blob/3334b319b1e84fa190ab6e3ea8d099667852601c/server.js#L273 |
@bonustrack: I was planning to add it in further patches. But I can add it here if we want. |
17ab982
to
7226c93
Compare
I feel like if we want to merge it to master we should make it all in one PR, or we can create new branch and apply multiple PRs there. |
I'll add send notification hooks in this patch itself. |
- Use Authorization header for taking steemconnect access token - Use expo sdk to validate tokens - Return notifications at /notifications
34d11ac
to
a5a7761
Compare
@bonustrack @Sekhmet: I've added the code to send push notifications. Sorry for the delay. |
@@ -0,0 +1,87 @@ | |||
const Expo = require('expo-server-sdk'); |
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.
We use 2 spaces as the indentation. This file uses tabs. Can you update it?
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.
Sure. I'll also add an editorconfig.
helpers/expoNotifications.js
Outdated
message = { | ||
body: `${data.author} mentioned you in a ` + (data.is_root_post ? 'post.' : 'comment.'), | ||
}; | ||
break |
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.
Missing semicolon there.
a5a7761
to
809f185
Compare
25ae017
to
da59d70
Compare
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.
Awesome job.
Yayy 🎉 |
Related: busyorg/busy#1872.