We would like to look at the possibility of adding push notifications for iOS and Android to our app.
Here's how I envision it working:
1. We need a custom user field (that the user can't change) such as
2. We will set
3. Whenever an 'alert/notification' is set in the forum, we'd need to hook into that call and program the following logic:
a. Only if
b. Send a HTTP POST request to https://api.OurApp.com/notification/ with the following information:
- Forum User ID
- Notification Title
- Notification Text
- URL of Forum page to 'view' the content for the notification
Really I just need help with #2 and #3. Basically I'm not sure how to create a custom user field which is hidden to the user, and I'm not sure how to hook into the right place in XenForo where notifications are created.
Here's how I envision it working:
1. We need a custom user field (that the user can't change) such as
IsAppUser
which is anything but true
by default.2. We will set
IsAppUser
to true
in our custom login script which the app already uses.3. Whenever an 'alert/notification' is set in the forum, we'd need to hook into that call and program the following logic:
a. Only if
IsAppUser==true
b. Send a HTTP POST request to https://api.OurApp.com/notification/ with the following information:
- Forum User ID
- Notification Title
- Notification Text
- URL of Forum page to 'view' the content for the notification
Really I just need help with #2 and #3. Basically I'm not sure how to create a custom user field which is hidden to the user, and I'm not sure how to hook into the right place in XenForo where notifications are created.