Getting Started
Execution
- CLI
- Docker
# Select PushNotifications while configuring your modules
npx @conduitplatform/cli deploy --config
Prerequisites
# Set up the Container Network
docker network create conduit
# Start Redis
docker run -d --name conduit-redis \
--network-alias redis \
--network "conduit" \
-h conduit-redis \
-p 6379:6379 \
docker.io/library/redis:latest
# Start Conduit
docker run -d --name conduit-core \
--network-alias conduit \
--network "conduit" \
-h conduit-core \
-p 55152:55152 -p 3030:3030 -p 3031:3031 \
-e REDIS_HOST="conduit-redis" -e REDIS_PORT="6379" \
ghcr.io/conduitplatform/conduit:latest
# Start MongoDB
docker run -d --name conduit-mongo \
--network-alias mongo \
--network "conduit" \
-h conduit-mongo \
-p 27017:27017 \
docker.io/library/mongo:latest
# Start Database
docker run -d --name conduit-database \
--network-alias database \
--network "conduit" \
-h conduit-database \
-e REGISTER_NAME="true" -e CONDUIT_SERVER="conduit-core:55152" \
-e DB_TYPE="mongodb" \
-e DB_CONN_URI="mongodb://conduit-mongo:27017" \
ghcr.io/conduitplatform/database:latest
# Start Router
docker run -d --name conduit-router \
--network-alias router \
--network "conduit" \
-h conduit-router \
-p 3000:3000 -p 3001:3001 \
-e REGISTER_NAME="true" -e CONDUIT_SERVER="conduit-core:55152" \
ghcr.io/conduitplatform/router:latest
docker run -d --name conduit-push-notifications \
--network-alias push-notifications \
--network "conduit" \
-h conduit-push-notifications \
-e REGISTER_NAME="true" -e CONDUIT_SERVER="conduit-core:55152" \
ghcr.io/conduitplatform/push-notifications:latest
Where do I start?
To start sending notifications you need to create a Firebase project.
Make sure you've configured the module.
Send notifications
Client App
The first thing you have to keep in your mind is that each token is related to notification token.
In fact, the notification token is the Firebase Cloud Messaging registration token.
Your first job is to set up a client application and retrieve its registration token.
See how to set up your client here.
Set notification token
After receiving the FCM registration token, you are ready to proceed.
As mentioned above, each user is related to a token. In a way I lied.
You are the one to link these Firebase tokens to your user accounts through an application request.
For details on how to do that, check out your generated Swagger or GraphQL route documentation.
Send a message
Select the user that you want to receive the push notification and make sure that the selected user has a token assigned to himself.