EventHopper / EHServerSide

Server-Side functionality including REST API, hosting scripts & client-server modules
0 stars 0 forks source link

Notification Service Integration (ServerSide) #221

Closed kylermintah closed 3 years ago

kylermintah commented 3 years ago

OneSignal Notification Service Class Integration

This addition will allow use of the Notification service class throughout the rest of the server. .env file will need to be updated with ONESIGNAL_API_SECRET & ONESIGNAL_APP_ID

sendNotification parameters (.../services/onesignal/index.ts)

title - string which will be notification heading message - string which will be notification content target_user_ids - array of user_id strings

export function sendNotification (
  title: string,
  message: string,
  target_user_ids: string[],
) { ... }

Example:

sendNotification('this is a test', 'message', ['<target_uid>']);

image

Opportunities to expand

Notifications were currently be sent as separate individual notifications. If we would like to group them together we could do so via Notification Stacking on Android