Skip to main content

Sending Push Notifications

Data flow for push notifications

Overview

We use OneSignal as a push notification service provider. We offer an API to send push notifications to Cozie. If you want to send push notifications to Cozie independent of us, you will need to copy the Cozie source code and publish your own version of the Cozie app, while doing so you need to setup your own OneSignal account and replace the OneSignal credentials in the Cozie source code.

Lambda function code

Lambda configuration

ConfigurationValueComment
General configuration
Memory512 MB
Ephemeral storage512 MBdefault value
Timeout0 min 10 sec
Triggers
API Gatewaycozie-apple-v3-researcher-api
Environment variables
DB_HOSTXXX.influxcloud.net(replace 'XXX')
DB_NAMEcozie-apple
DB_PASSWORDXXX(replace 'XXX')
DB_PORT8086
DB_USERCozie-Apple-Lambda-API-Push-Notification
onesignal_app_idXXX(replace 'XXX')
onesignal_tokenXXX(replace 'XXX')
Layers
AWSSDKPandas-Python311AWS Layer for Pandas, Numpy, requests
InfluxCustom layer for InfluxDB client