freshdesk_flutter_sdk 1.2.0
freshdesk_flutter_sdk: ^1.2.0 copied to clipboard
Official Freshdesk Flutter SDK — in-app customer support, live chat, and knowledge base for Android and iOS, wrapping the native Freshdesk SDKs.
example/README.md
freshdesk_flutter_sdk example #
A minimal example of initializing the SDK and opening the support experience.
For a full, runnable demo app (push notifications, JWT, unread badge, events),
see the sample_app/
in the repository.
import 'package:flutter/material.dart';
import 'package:freshdesk_flutter_sdk/freshdesk_flutter_sdk.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
// Initialize once, as early as possible, before any other SDK call.
await FreshdeskSdk.initialize(
const FreshdeskSdkConfig(
token: '<YOUR_TOKEN>',
host: '<YOUR_HOST>',
sdkId: '<YOUR_SDK_ID>',
locale: 'en',
),
);
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Freshdesk SDK example')),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
onPressed: () => FreshdeskSdk.openSupport(),
child: const Text('Open support'),
),
ElevatedButton(
onPressed: () => FreshdeskSdk.openKnowledgeBase(),
child: const Text('Open knowledge base'),
),
],
),
),
),
);
}
}
Credentials come from your Freshdesk portal: Admin Settings → Mobile Chat SDK
(token, host, sdkId). See the
API reference
for the full surface.