- the Talqui SDK for React Native or Flutter, version 0.2.0 or later;
- Firebase Cloud Messaging set up in your app (React Native Firebase or FlutterFire);
- for iOS, your APNs authentication key uploaded to your Firebase project (Project settings → Cloud Messaging).
1. Create a service account
Talqui sends with a service account key of your Firebase project, restricted to sending notifications.- In the Google Cloud console, select your Firebase project and open IAM & Admin → Service accounts.
- Create service account, name it (for example
talqui-push) and give it the role Firebase Cloud Messaging API Admin. No other role is needed. - Open the account, go to Keys → Add key → Create new key → JSON. A
.jsonfile downloads.
2. Upload it to Talqui
- In app.talqui.chat, open Plugins → WebChat, open the connection and go to the Notificações (Notifications) tab.
- Under Como avisar (How to notify), choose Pela Talqui (Through Talqui).
- In Aplicativo (Firebase) (App), click Enviar chave JSON (Upload JSON key) and pick the file.
3. Hand the device token to the SDK
Pass the FCM token to the SDK and keep it fresh. Then open the chat when the user taps a Talqui notification.handlePush opens the chat and returns true for a Talqui notification, and does nothing for yours, so you can call it for every tap. The token is linked to the visitor once the chat loads, and logout() unlinks it, so the next person on the phone never gets the previous user’s replies.
React Native Firebase needs native code, so push notifications don’t work in Expo Go: use a development build. The chat itself still works in Expo Go.
4. Test it
- Open the chat in your app and send a message.
- Send the app to the background (or lock the phone).
- Reply from your Talqui inbox.
- About 20 seconds later the notification arrives. Tap it: the chat opens.
When the app is open
Talqui only notifies a user who isn’t looking at the chat. If the app is open on another screen, the push still arrives. On Android, FCM hands it to your foreground handler instead of showing it: tell it apart from your own pushes withisTalquiPush and show your own banner, or update the unread badge.