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.
Check out our comprehensive example provided with this plugin.
Join the community
If you have any question or problems, please join us on Discord
Read the Frequently Asked Questions first before creating a new issue.
We will add some code samples soon
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.
The iOS and Android SDKs take different approaches to push notifications. Notable differences include:
- 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.
- 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
firebaseto 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:
main.dart- which configures
FirebaseMessagingwith message handlers, initializes
FlutterLocalNotificationsPlugin, 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.
- Twilio Programmable Chat utility package.