Getting Started

1. Install Flutter SDK

flutter pub add talkplus_flutter_sdk

or

dependencies:
  talkplus_flutter_sdk: ^0.5.5

2. Initialize

await TalkPlusAPI.init("YOUR_APP_ID");

3. Login / Logout Process

  1. You need to login (either using loginAnonymous or loginWithToken) once TalkPlus SDK has been initialized.

  2. Once user is logged in, FCM token that was registered stays valid until the user logs out. This lets the user receive push notifications even when offline.

  3. When user logs out, make sure to call logout function. If this step is omitted and a different user logs into the same device, the latter user will continue to receive push messages intended for the previous user.

4. Realtime Message

  • TalkPlus subscribes/unsubscribes to realtime channels in sync with app lifecycle.

  • TalkPlus SDK uses WebSocket to receive messages when your app is in foreground. When you app goes to background, SDK uses FCM to receive messages.


  • If you intend to receive messages when app goes into background, please refer to Push Notification section on how to set up FCM.

  • FCM integration is used alongside WebSocket in order to minimize app battery consumption.

Last updated