{"id":13789920,"url":"https://github.com/fayeed/flutter_freshchat","last_synced_at":"2025-10-23T05:38:50.476Z","repository":{"id":34643564,"uuid":"181683287","full_name":"fayeed/flutter_freshchat","owner":"fayeed","description":"The unofficial flutter plugin for Freshchat","archived":true,"fork":false,"pushed_at":"2022-03-27T13:18:15.000Z","size":25227,"stargazers_count":32,"open_issues_count":16,"forks_count":37,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-24T20:36:12.225Z","etag":null,"topics":["conversation","flutter","flutter-plugin","freshchat"],"latest_commit_sha":null,"homepage":"https://pub.dartlang.org/packages/flutter_freshchat","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fayeed.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-16T12:17:35.000Z","updated_at":"2024-02-12T19:32:37.000Z","dependencies_parsed_at":"2022-08-08T01:16:03.121Z","dependency_job_id":null,"html_url":"https://github.com/fayeed/flutter_freshchat","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fayeed%2Fflutter_freshchat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fayeed%2Fflutter_freshchat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fayeed%2Fflutter_freshchat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fayeed%2Fflutter_freshchat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fayeed","download_url":"https://codeload.github.com/fayeed/flutter_freshchat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253695082,"owners_count":21948811,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["conversation","flutter","flutter-plugin","freshchat"],"created_at":"2024-08-03T22:00:34.589Z","updated_at":"2025-10-23T05:38:45.029Z","avatar_url":"https://github.com/fayeed.png","language":"Dart","funding_links":[],"categories":["Packages"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ch1 align=\"center\" style=\"font-size: 48px;\"\u003e💬 Flutter Freshchat\u003c/h1\u003e\n  \u003ch5 align=\"center\"\u003e\nA Flutter plugin for integrating Freshchat in your mobile app.\n\u003c/p\u003e\n\n## Setup\n\n### Android\n\nAdd this to your `AndroidManifest.xml`\n\n```xml\n\u003cprovider\n    android:name=\"android.support.v4.content.FileProvider\"\n    android:authorities=\"com.example.demoapp.provider\"\n    android:exported=\"false\"\n    android:grantUriPermissions=\"true\"\u003e\n    \u003cmeta-data\n        android:name=\"android.support.FILE_PROVIDER_PATHS\"\n        android:resource=\"@xml/freshchat_file_provider_paths\" /\u003e\n\u003c/provider\u003e\n```\n\nIf you have migrated to AndroidX your might need change the provider attribute `android:name` to this:\n\n```xml\n\u003cprovider android:name=\"androidx.core.content.FileProvider\"\u003e\n\u003c/provider\u003e\n```\n\nAdd this to your `Strings.xml` located inside `android/src/res/values`\n\n```xml\n\u003cstring name=\"freshchat_file_provider_authority\"\u003ecom.example.demoapp.provider\u003c/string\u003e\n```\n\n**Firebase Cloud Messaging support**\n\n1. Add dependency in `\u003capp-name\u003e/android/app/build.gradle`\n\n```gradle\ndependencies {\n  implementation \"com.github.freshdesk:freshchat-android:3.3.0\"\n}\n```\n\n2. Create `FreshchatMessagingService.java` (Java, not Kotlin) class to your app in the same directory as your `MainActivity` class\n\n```java\npackage com.example.app;\n\nimport com.freshchat.consumer.sdk.Freshchat;\nimport com.google.firebase.messaging.RemoteMessage;\nimport io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService;\n\npublic class FreshchatMessagingService extends FlutterFirebaseMessagingService {\n\n    @Override\n    public void onNewToken(String token) {\n        super.onNewToken(token);\n    }\n\n    @Override\n    public void onMessageReceived(final RemoteMessage remoteMessage) {\n        super.onMessageReceived(remoteMessage);\n        if (Freshchat.isFreshchatNotification(remoteMessage)) {\n            Freshchat.handleFcmMessage(this, remoteMessage);\n        }\n    }\n}\n```\n\n3. In `AndroidManifest.xml` add\n\n```xml\n\u003cservice android:name=\".FreshchatMessagingService\"\u003e\n  \u003cintent-filter\u003e\n    \u003caction android:name=\"com.google.firebase.MESSAGING_EVENT\" /\u003e\n  \u003c/intent-filter\u003e\n\u003c/service\u003e\n```\n\n4. In your `Application` class change\n```java\nFlutterFirebaseMessagingService.setPluginRegistrant(this)\n```\nto\n```java\nFreshchatMessagingService.setPluginRegistrant(this)\n```\n\n### IOS\n\n1. Add this to info.plist\n   \u003e Starting with iOS 10, Apple requires developers to declare access to privacy-sensitive controls ahead of time.\n\n```xml\n\u003ckey\u003eNSPhotoLibraryUsageDescription\u003c/key\u003e\n\u003cstring\u003eTo Enable access to Photo Library\u003c/string\u003e\n\u003ckey\u003eNSCameraUsageDescription\u003c/key\u003e\n\u003cstring\u003eTo take Images from Camera\u003c/string\u003e\n```\n\n2. If you encounter `non-modular header` error during project build\n\n```bash\nerror: include of non-modular header inside framework module 'flutter_freshchat.FlutterFreshchatPlugin'\n```\n\n\u003e - Manually in xcode update the FreshchatSDK.h to be in the flutter_freshchat target and public.\n\u003cimg width=\"930\" alt=\"FreshchatSDK_fix\" src=\"https://user-images.githubusercontent.com/40217827/88995177-452a6880-d2a7-11ea-8cbc-2e47ebf62ff8.png\"\u003e\nYou may have to do this each time your switch or rebuild the xcode project from flutter.\n\n\u003c!-- 4. At this point if you try to build you will get an error something related to duplicate `info.plist` (Note: It's something to do with Freshchat) you can remove this info by following the below instructions:\n\n- Open your `.xcworkspace` in xcode.\n- Goto to `Pods`.\n- Select target `flutter_freshchat`.\n- Select Build Phases and then go to Compile Sources.\n- Look for two `info.plist` entries and remove them. --\u003e\n\n## Usage\n\nTo use this plugin, add `flutter_freshchat` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/).\n\n```dart\nimport 'package:flutter_freshchat/flutter_freshchat.dart';\n```\n\nInitialize the Freshchat app with `appID`, `appKey` \u0026 `domain` which you could get from here: [Where to find App ID and App Key](https://support.freshchat.com/support/solutions/articles/229192)\u003cbr/\u003e\u003cbr/\u003e\nIt has following [FreshchatConfig] properties:\n\n- `domain` Each Freshchat cluster falls in to one of this domains:\n  - US - https://msdk.freshchat.com (default)\n  - AU - https://msdk.au.freshchat.com\n  - EU - https://msdk.eu.freshchat.com\n  - IN - https://msdk.in.freshchat.com\n  - US2 - https://msdk.us2.freshchat.com\n\n- `cameraEnabled` property is used to either enable or disable camera\n  within freshchat conversation widget. It default value is set to `true`.\n\n- `gallerySelectionEnabled` property is used to either enable or disable gallery\n  within freshchat conversation widget. It default value is set to `true`.\n\n- `teamMemberInfoVisible` property is used to show team member info\n  within freshchat conversation widget. It default value is set to `true`.\n\n- `responseExpectationEnabled` property is used to show exceptions that occur\n  within freshchat conversation widget. It default value is set to `true`.\n\n- `showNotificationBanner` property is used enabled or disable in-app notification\n  banner. It default value is set to `true`. (NOTE: IOS only).\n\n- `notificationSoundEnabled` property is used enabled or disable in-app notification\n  sound. It default value is set to `true`. (NOTE: IOS only).\n\n```dart\nawait FlutterFreshchat.init(\n  appID: 'YOUR_APP_ID_HERE',\n  appKey: 'YOUR_APP_KEY_HERE',\n  domain: 'https://msdk.freshchat.com'\n  );\n```\n\nUpdate the user info by setting by creating a `FreshchatUser` object\n\n```dart\nFreshchatUser user = FreshchatUser.initial();\nuser.email = \"john@test.com\";\nuser.firstName = \"john\";\nuser.lastName = \"doe\";\nuser.phoneCountryCode = \"+91\";\nuser.phone = \"0123456789\";\n\nawait FlutterFreshchat.updateUserInfo(user: user);\n\n// Custom properties can be set by creating a Map\u003cString, String\u003e\nMap\u003cString, String\u003e customProperties = Map\u003cString, String\u003e();\ncustomProperties[\"loggedIn\"] = \"true\";\n\nawait FlutterFreshchat.updateUserInfo(user: user, customProperties: customProperties);\n```\n\nIdentify the user user by usin email address or any way you uniquely identify the user.\n`externalID` is required and returns a `restoreID` you can save it and use to restore the chats\n\n```dart\nawait FlutterFreshchat.identifyUser(externalID: 'USER_UNIQUE_ID', restoreID: 'USER_RESTORE_ID');\n```\n\nShow conversation opens a conversation screen and also list all the other conversation if a list obejct is supplied to it. You can also pass a title for the chat screen.\n\n```dart\nawait FlutterFreshchat.showConversations(tags: const [], title: 'CHAT_SCREEN_TITLE');\n```\n\nSend message directly within the app without opening the Freshchat interface. `tag` is optional.\n\n```dart\nawait FlutterFreshchat.send(message: 'YOUR_MESSAGE_HERE', tag: 'YOUR_TAG_HERE');\n```\n\nShowFAQs opens a FAQ screen in a grid like format as default you can change the default setting by changing this paramters.\u003cbr\u003e\n`showFaqCategoriesAsGrid = true`\u003cbr\u003e\n`showContactUsOnAppBar = true`\u003cbr\u003e\n`showContactUsOnFaqScreens = false`\u003cbr\u003e\n`showContactUsOnFaqNotHelpful = false`\u003cbr\u003e\n\n```dart\nawait FlutterFreshchat.showFAQs();\n```\n\nGets the unseen message count from freshchat you can use this to show a counter.\n\n```dart\nint count = await FlutterFreshchat.getUnreadMsgCount();\n```\n\nReset user data at logout or when deemed appropriate based on user action in the app.\n\n```dart\nawait FlutterFreshchat.resetUser();\n```\n\n## Example\n\nFind the example wiring in the [Flutter_Freshchat example application](https://github.com/fayeed/flutter_freshchat/blob/master/example/lib/main.dart).\n\n## API details\n\nSee the [flutter_freshchat.dart](https://github.com/fayeed/flutter_freshchat/blob/master/lib/flutter_freshchat.dart) for more API details\n\n## Issues and feedback\n\nPlease file [issues](https://github.com/fayeed/flutter_freshchat/issues)\nto send feedback or report a bug. Thank you!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffayeed%2Fflutter_freshchat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffayeed%2Fflutter_freshchat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffayeed%2Fflutter_freshchat/lists"}