This repo is a Nawah Package that allows developers to integrate FCM into Nawah apps using Gateway Controller.
- From your app directory run:
nawah packages add gateway_fcm
- Add
fcm
Var tonawah_app.py
App Config:
vars = {
'fcm': {'token': 'FCM_API_TOKEN'}
}
fcm
gateway requires following arguments:registration_id
: Target device registration identifier. Typestr
.message_title
: Message title. Typestr
.message_body
: Message body. Typestr
.data_message
: Additional payload data to be sent with the message. Typedict
.
fcm
gateway accepts optional argument, namelyfcm_auth
, replicatingfcm
for dynamic FCM API credentials.- Use
fcm
gateway using Nawah Gateway Controller:
from nawah.gateway import Gateway
Gateway.send(gateway='fcm', registration_id=registration_id, message_title=message_title, message_body=message_body, data_message=data_message)