Firebase Cloud Messaging is a cross-platform messaging solution that allows sending messages at no cost. It supports notifications or data messages up to 4KB in size and versatile targeting. Notifications are displayed to the user, while data messages are received in the background. FCM supports notification payloads for display and click actions, as well as custom data payloads. Proper handling of notifications in the foreground and background is required. Token management and missing notifications can be issues to address. Capabilities vary across platforms for notifications, permissions, and upstream messaging.
8. A/B Testing with the console
• Presented at Firebase Dev Submit 2017
• Multiple audience target
• Different content / parameters
• Check results per audience
@Miqubel
18. Data Payload
"data":{
"title": "New Notification!",
"body": "Test",
"user_id": "1234",
"user_avatar": "http://example.com/users/1234/avatar.jpg",
"notification_type": "private_message"
},
@Miqubel
19. Notifications with data
class NotificationService : FirebaseMessagingService() {
override fun onMessageReceived(remoteMessage: RemoteMessage) {
val notification = NotificationCompat.Builder(this,”cid")
.setContentTitle(remoteMessage.data["title"])
.setContentText(remoteMessage.data["body"])
.setSmallIcon(R.mipmap.ic_launcher)
.build()
val manager = NotificationManager…
manager.notify(123, notification)
}
}
@Miqubel
20. Missing Notifications?
“The reason is that phone manufacturers
like Oppo, Xiaomi, and One Plus use a stock
ROM that disables the re-starting of
background services for most
apps.”
Neil Mathew: Why your Push Notifications
never see the light of day
@Miqubel
25. Web Alternative
• Fallback that supports all browsers
• Not free
• No background work
• Focused on data transport, not
notifications
• No need to request permissions
@Miqubel
26. iOS: all Apple
• Setup APNs (Apple Push Notification service)
• No difference between pure data vs. notifications
• Specific parameters just for iOS too
• “Just works”™
@Miqubel
27. Upstream messages
• Android & iOS: send “upstream” messages to your
server
• API missing on web?
• Asynchronous and battery efficient
@Miqubel