Notification
Enabling and Disabling Services
Env variables
For Push notifications and Internal notifications we can set what service we want to use.
Push notifications
- To enable push notifications you need to update
pushNotificationsServiceType
variable in env file for your environment. - Possible values of the variable are:
- PushNotificationsServiceType.remote
- PushNotificationsServiceType.local
- PushNotificationsServiceType.both
- PushNotificationsServiceType.none
- Here for context, remote service is used when dev wants to implement notifications for chat like notifications, and local service is used when dev wants to implement notifications for reminder like notifications.
PushNotificationsServiceType.remote
- If developer sets env variable value equals to
PushNotificationsServiceType.remote
then they have to add one more variable, because to enable remote notifications we rely onOnesignal
. They can follow this section and do the configuration for one signal. When they find the one signal app id. Developer can add it usingoneSignalConfig: const OneSignalConfig(appId: 'your-app-id'),
.
PushNotificationsServiceType.local
- If developer sets env variable value equals to
PushNotificationsServiceType.local
then they can push any local notification without any additional configuration.
PushNotificationsServiceType.both
- If developer sets env variable value equals to
PushNotificationsServiceType.both
then they can push any local notification without any additional configuration. But for remote they need to do setup for onesignal as mentioned in this section. And both kind of services will be available.
PushNotificationsServiceType.none
- If developer sets env variable value equals to
PushNotificationsServiceType.none
then app will not use any kind of service and won't be able to push remote or local notifications.
More details
Please visit push notifications section for more details.
Internal (in-app) notifications
- To enable internal notifications you need to update
internalNotificationsServiceType
variable in env file for your environment. - Possible values of the variable are:
- InternalNotificationsServiceType.firebase
- InternalNotificationsServiceType.pusher
- InternalNotificationsServiceType.custom
- InternalNotificationsServiceType.none
InternalNotificationsServiceType.firebase
- If developer sets env variable value equals to
InternalNotificationsServiceType.firebase
then they have to do the setup for firebase fire store and run flutterfire configure. Read about it here.
InternalNotificationsServiceType.pusher
- If developer sets env variable value equals to
InternalNotificationsServiceType.pusher
then they have to do the setup for firebase fire store and run flutterfire configure. Read about it here.
InternalNotificationsServiceType.custom
- If developer sets env variable value equals to
InternalNotificationsServiceType.custom
then they have to setup custom service, here
InternalNotificationsServiceType.none
- If developer sets env variable value equals to
InternalNotificationsServiceType.none
then app will not use any kind of service and won't be able to dump internal notifications.
More details
Please visit internal notifications section for more details.