3. The different notification providers
• Firebase Cloud Messaging
• APNS
• OneSignal
• Airship
• …
A lot of them are based on Firebase Cloud Messaging directly,
often providing additional features
4. Differences between device notifications and server notifications?
Server noti
fi
cations
• Noti
fi
cations that depend on another
person's action
• Noti
fi
cations that depend on a
speci
fi
c time or event
Device noti
fi
cations
• Scheduled from the user
• Doesn’t need tracking from the
server
• Triggered depending on user’s
location
6. Setup notification your Flutter App using FCM
• Each platform needs a speci
fi
c setup
• You will need platform con
fi
guration
fi
les `google-services.json` and
`GoogleInfo.plist`
• You should con
fi
rm each platform as you go when building noti
fi
cations
https://
fi
rebase.google.com/docs/cloud-messaging/
fl
utter/client
7. Setup notification your Flutter App using FCM
Requesting permissions
• Every platform now requires permission to display a noti
fi
cation
• Good practices:
• Not requesting permissions as soon as your app is open
• You should explain what will be sent
• Users should be able to unsubscribe from each noti
fi
cation type
individually
https://
fi
rebase.google.com/docs/cloud-messaging/
fl
utter/client
8. Setup notification your Flutter App using FCM
Requesting permissions
https://
fi
rebase.google.com/docs/cloud-messaging/
fl
utter/client
9. Differences between foreground and background
Background noti
fi
cations
• App can be opened or not
• If app is killed, it will be started to
handle the noti
fi
cation
• You should handle the noti
fi
cation
quickly enough
Foreground noti
fi
cations
• Receiving a noti
fi
cation when the
app is already opened
• A device noti
fi
cation should probably
not be displayed
• Adding the noti
fi
cation to the
noti
fi
cation page
10. Setup notification your Flutter App using FCM
Listen to noti
fi
cations in Foreground
https://
fi
rebase.google.com/docs/cloud-messaging/
fl
utter/client
11. Setup notification your Flutter App using FCM
Listen to noti
fi
cations in Background
https://
fi
rebase.google.com/docs/cloud-messaging/
fl
utter/client
12. Send notification from a server using TS
• You can send a noti
fi
cation using Node.js, Java, Python, Go or C#
• No Dart SDK currently, you can use the API directly
• Using `
fi
rebase init functions` is the easiest way of initializing a TypeScript
Cloud Function to send a noti
fi
cation
14. The data-only notifications
Trigger actions in your app
• Data-only noti
fi
cations are used to trigger actions in your App
• Could be logging something or changing a setting
• Your app has to answer this noti
fi
cation fast enough; otherwise it might get
rate limited
• Your app will have to handle the noti
fi
cation on its own
16. Bind a notification to GoRouter
• You can get the global instance
of the router and use it
17. Access Riverpod in the background thread
• Allows to reuse the chain of dependency
from Riverpod outside of the Widget Tree
• You should still access the
ProviderContainer from Consumer
widget when you can
18. When to use Flutter Local Notification
• FLN is a powerful Flutter plugins that allow to display of noti
fi
cation locally
• It supports features like displaying grouped noti
fi
cation
• Can be used to customise noti
fi
cation for each platforms
• Can be used with data-only noti
fi
cations
19. Notification Id
• You should ensure that your noti
fi
cation is always bound to an Id
• Helps to clear the noti
fi
cation if needed
• Prevent displaying the noti
fi
cation twice if the servers sends it too many time
20. Threads
• Helps user identi
fi
es noti
fi
cations
from the same conversation
• Easy with Flutter Local
Noti
fi
cation
21. Debugging notifications
• When your noti
fi
cation cannot be received on iOS, there is a special issue to
help you troubleshoot and get all the logs required