Channel Talk Flutter Plugin.(Unofficial)
Add channel_io_flutter Plugin to pubspec.yaml.
dependencies:
channel_io_flutter:
git:
url: https://github.com/cb-cloud/channel_io_flutter.git
ref: main
Add pod installation to ios/Podfile.
target 'Runner' do
use_frameworks!
use_modular_headers!
# Add line
pod 'ChannelIOSDK', podspec: 'https://mobile-static.channel.io/ios/latest/xcframework.podspec'
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
- Implement firebase_messaging and make sure it works: https://pub.dev/packages/firebase_messaging#android-integration
- Add the Firebase server key to Channel Talk: https://developers.channel.io/docs/android-push-notification
- Add the following to your AndroidManifest.xml file.
<service
android:name="com.cbcloud.channel_io_flutter.PushInterceptService"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
import 'package:channel_io_flutter/channel_io_flutter.dart';
import 'package:flutter/material.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await ChannelIoFlutter.boot(pluginKey: 'pluginKey');
runApp(MaterialApp(home: MyApp()));
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: FloatingActionButton(
onPressed: () async {
await ChannelIoFlutter.showMessenger();
},
),
),
);
}
}