twilio_programmable_chat 0.1.1+8 twilio_programmable_chat: ^0.1.1+8 copied to clipboard
Integrate the Twilio Chat SDK with your Flutter app using this Twilio Programmable Chat Flutter plugin.
Notice: Twilio Sunsetting Programmable Chat on July 25, 2022 #
twilio_programmable_chat #
Flutter plugin for Twilio Programmable Chat, which enables you to build a chat application.
This Flutter plugin is a community-maintained project for Twilio Programmable Chat and not maintained by Twilio. If you have any issues, please file an issue instead of contacting support.
This package is currently work-in-progress and should not be used for production apps. We can't guarantee that the current API implementation will stay the same between versions, until we have reached v1.0.0.
Example #
Check out our comprehensive example provided with this plugin.
Join the community #
If you have any question or problems, please join us on Discord
FAQ #
Read the Frequently Asked Questions first before creating a new issue.
Supported platforms #
- Android
- iOS
Web(not yet)
Code samples #
We will add some code samples soon
Push Notifications #
General #
Required steps for enabling push notifications in iOS and Android apps apply.
Some links for more information:
Note: At this time it seems that both the Android and iOS SDKs only support registering for push notifications once per connection.
Platform Specifics #
The iOS and Android SDKs take different approaches to push notifications. Notable differences include:
iOS #
- The iOS SDK uses APNs whereas Android uses FCM.
- The iOS SDK handles receiving and displaying push notifications.
- Due to the fact that APNs token format has changed across iOS implementations, we have elected to retrieve the token from the OS ourselves at time of registration rather than attempting to anticipate what method of encoding might be used when transferring the token back and forth across layers of the app, or what format the token might take.
Android #
- The Android SDK offers options for GCM and FCM. As GCM has largely been deprecated by Google, we have elected to only handle FCM.
- The Android SDK does not receive messages or handle notifications.
- Rather than introducing a dependency on
firebase
to the plugin, we have elected to leave token retrieval, message and notification handling to the user of the plugin.- An example of this can be seen in the example app.
- Notable parts of the implementation in the example app include:
Application.kt
- which is used to allow for receiving background messages withfirebase_messaging
and displaying them withflutter_local_notifications
, as the plugins must be registered independently of theActivity
lifecycle.main.dart
- which configuresFirebaseMessaging
with message handlers, initializesFlutterLocalNotificationsPlugin
, and creates a notification channel.chat_bloc.dart
- which retrieves tokens (if on Android), and registers and unregisters for notifications.
Development and Contributing #
Interested in contributing? We love merge requests! See the Contribution guidelines.