diff --git a/.gitignore b/.gitignore
index 86f284979..e765a1228 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,8 +13,6 @@ lib/basic_api/generated/*.json
*.iws
.idea/
-.fvm
-
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
@@ -32,7 +30,6 @@ coverage/
/packages/**/pubspec_overrides.yaml
/packages/**/pubspec.lock
-
gradlew.bat
local.properties
gradlew
@@ -73,3 +70,6 @@ gradle/
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
/.idea/
+
+# FVM Version Cache
+.fvm/
\ No newline at end of file
diff --git a/packages/intercom_flutter/.gitignore b/packages/intercom_flutter/.gitignore
new file mode 100644
index 000000000..94ca74321
--- /dev/null
+++ b/packages/intercom_flutter/.gitignore
@@ -0,0 +1 @@
+/intercom_flutter/example/lib/generated_plugin_registrant.dart
diff --git a/packages/intercom_flutter/README.md b/packages/intercom_flutter/README.md
new file mode 100755
index 000000000..7b48a8619
--- /dev/null
+++ b/packages/intercom_flutter/README.md
@@ -0,0 +1,212 @@
+# intercom_flutter
+
+[![Pub](https://img.shields.io/pub/v/intercom_flutter.svg)](https://pub.dev/packages/intercom_flutter)
+![CI](https://github.com/v3rm0n/intercom_flutter/workflows/CI/badge.svg)
+
+Flutter wrapper for Intercom [Android](https://github.com/intercom/intercom-android), [iOS](https://github.com/intercom/intercom-ios), and [Web](https://developers.intercom.com/installing-intercom/docs/basic-javascript) projects.
+
+- Uses Intercom Android SDK Version `15.11.2`.
+- The minimum Android SDK `minSdk` required is 21.
+- The compile Android SDK `compileSdk` required is 34.
+- Uses Intercom iOS SDK Version `18.2.2`.
+- The minimum iOS target version required is 15.
+- The Xcode version required is 15.
+
+## Usage
+
+Import `package:intercom_flutter/intercom_flutter.dart` and use the methods in `Intercom` class.
+
+Example:
+```dart
+import 'package:flutter/material.dart';
+import 'package:intercom_flutter/intercom_flutter.dart';
+
+void main() async {
+ // initialize the flutter binding.
+ WidgetsFlutterBinding.ensureInitialized();
+ // initialize the Intercom.
+ // make sure to add keys from your Intercom workspace.
+ // don't forget to set up the custom application class on Android side.
+ await Intercom.instance.initialize('appIdHere', iosApiKey: 'iosKeyHere', androidApiKey: 'androidKeyHere');
+ runApp(App());
+}
+
+class App extends StatelessWidget {
+
+ @override
+ Widget build(BuildContext context) {
+ return FlatButton(
+ child: Text('Open Intercom'),
+ onPressed: () async {
+ // messenger will load the messages only if the user is registered in Intercom.
+ // either identified or unidentified.
+ await Intercom.instance.displayMessenger();
+ },
+ );
+ }
+}
+
+```
+
+See Intercom [Android](https://developers.intercom.com/installing-intercom/docs/intercom-for-android) and [iOS](https://developers.intercom.com/installing-intercom/docs/intercom-for-ios) package documentation for more information.
+
+### Android
+
+Make sure that your app's `MainActivity` extends `FlutterFragmentActivity` (you can check the example).
+
+Permissions:
+```xml
+
+```
+
+Optional permissions:
+
+```xml
+
+
+
+```
+
+Enable AndroidX + Jetifier support in your android/gradle.properties file (see example app):
+
+```
+android.useAndroidX=true
+android.enableJetifier=true
+```
+
+According to the documentation, Intercom must be initialized in the Application onCreate. So follow the below steps to achieve the same:
+- Setup custom application class if you don't have any.
+ - Create a custom `android.app.Application` class named `MyApp`.
+ - Add an `onCreate()` override. The class should look like this:
+ ```kotlin
+ import android.app.Application
+
+ class MyApp: Application() {
+
+ override fun onCreate() {
+ super.onCreate()
+ }
+ }
+ ```
+ - Open your `AndroidManifest.xml` and find the `application` tag. In it, add an `android:name` attribute, and set the value to your class' name, prefixed by a dot (.).
+ ```xml
+
+ ```
+- Now initialize the Intercom SDK inside the `onCreate()` of custom application class according to the following:
+```kotlin
+import android.app.Application
+import io.maido.intercom.IntercomFlutterPlugin
+
+class MyApp : Application() {
+ override fun onCreate() {
+ super.onCreate()
+
+ // Add this line with your keys
+ IntercomFlutterPlugin.initSdk(this, appId = "appId", androidApiKey = "androidApiKey")
+ }
+}
+```
+
+### iOS
+Make sure that you have a `NSPhotoLibraryUsageDescription` entry in your `Info.plist`.
+
+### Push notifications setup
+This plugin works in combination with the [`firebase_messaging`](https://pub.dev/packages/firebase_messaging) plugin to receive Push Notifications. To set this up:
+
+* First, implement [`firebase_messaging`](https://pub.dev/packages/firebase_messaging)
+* Then, add the Firebase server key to Intercom, as described [here](https://developers.intercom.com/installing-intercom/docs/android-fcm-push-notifications#section-step-3-add-your-server-key-to-intercom-for-android-settings) (you can skip 1 and 2 as you have probably done them while configuring `firebase_messaging`)
+* Follow the steps as described [here](https://developers.intercom.com/installing-intercom/docs/ios-push-notifications) to enable push notification in iOS.
+* Starting from Android 13 you may need to ask for notification permissions (as of version 13 `firebase_messaging` should support that)
+* Ask FirebaseMessaging for the token that we need to send to Intercom, and give it to Intercom (so Intercom can send push messages to the correct device), please note that in order to receive push notifications in your iOS app, you have to send the APNS token to Intercom. The example below uses [`firebase_messaging`](https://pub.dev/packages/firebase_messaging) to get either the FCM or APNS token based on the platform:
+
+```dart
+final firebaseMessaging = FirebaseMessaging.instance;
+final intercomToken = Platform.isIOS ? await firebaseMessaging.getAPNSToken() : await firebaseMessaging.getToken();
+
+Intercom.instance.sendTokenToIntercom(intercomToken);
+```
+
+Now, if either Firebase direct (e.g. by your own backend server) or Intercom sends you a message, it will be delivered to your app.
+
+### Web
+You don't need to do any extra steps for the web. Intercom script will be automatically injected.
+But you can pre-define some Intercom settings, if you want (optional).
+```html
+
+```
+#### Following functions are not yet supported on Web:
+
+- [ ] unreadConversationCount
+- [ ] setInAppMessagesVisibility
+- [ ] sendTokenToIntercom
+- [ ] handlePushMessage
+- [ ] isIntercomPush
+- [ ] handlePush
+- [ ] displayCarousel
+- [ ] displayHelpCenterCollections
+
+## Using Intercom keys with `--dart-define`
+
+Use `--dart-define` variables to avoid hardcoding Intercom keys.
+
+### Pass the Intercom keys with `flutter run` or `flutter build` command using `--dart-define`.
+```dart
+flutter run --dart-define="INTERCOM_APP_ID=appID" --dart-define="INTERCOM_ANDROID_KEY=androidKey" --dart-define="INTERCOM_IOS_KEY=iosKey"
+```
+Note: You can also use `--dart-define-from-file` which is introduced in Flutter 3.7.
+
+### Reading keys in Dart side and initialize the SDK.
+```dart
+String appId = String.fromEnvironment("INTERCOM_APP_ID", "");
+String androidKey = String.fromEnvironment("INTERCOM_ANDROID_KEY", "");
+String iOSKey = String.fromEnvironment("INTERCOM_IOS_KEY", "");
+
+Intercom.instance.initialize(appId, iosApiKey: iOSKey, androidApiKey: androidKey);
+```
+
+### Reading keys in Android native side and initialize the SDK.
+
+* Add the following code to `build.gradle`.
+```
+def dartEnvironmentVariables = []
+if (project.hasProperty('dart-defines')) {
+ dartEnvironmentVariables = project.property('dart-defines')
+ .split(',')
+ .collectEntries { entry ->
+ def pair = new String(entry.decodeBase64(), 'UTF-8').split('=')
+ [(pair.first()): pair.last()]
+ }
+}
+```
+
+* Place `dartEnvironmentVariables` inside the build config
+```
+defaultConfig {
+ ...
+ buildConfigField 'String', 'INTERCOM_APP_ID', "\"${dartEnvironmentVariables.INTERCOM_APP_ID}\""
+ buildConfigField 'String', 'INTERCOM_ANDROID_KEY', "\"${dartEnvironmentVariables.INTERCOM_ANDROID_KEY}\""
+}
+```
+
+* Read the build config fields
+```kotlin
+import android.app.Application
+import android.os.Build
+import io.maido.intercom.IntercomFlutterPlugin
+
+class MyApp : Application() {
+ override fun onCreate() {
+ super.onCreate()
+
+ // Add this line with your keys
+ IntercomFlutterPlugin.initSdk(this,
+ appId = BuildConfig.INTERCOM_APP_ID,
+ androidApiKey = BuildConfig.INTERCOM_ANDROID_KEY)
+ }
+}
+```
diff --git a/packages/intercom_flutter/intercom_flutter/.gitignore b/packages/intercom_flutter/intercom_flutter/.gitignore
new file mode 100644
index 000000000..0af474fe6
--- /dev/null
+++ b/packages/intercom_flutter/intercom_flutter/.gitignore
@@ -0,0 +1,13 @@
+.DS_Store
+.dart_tool/
+
+.packages
+.pub/
+pubspec.lock
+
+build/
+.idea/*
+!.idea/runConfigurations
+android/bin/
+example/.flutter-plugins-dependencies
+example/ios/Flutter/flutter_export_environment.sh
diff --git a/packages/intercom_flutter/intercom_flutter/CHANGELOG.md b/packages/intercom_flutter/intercom_flutter/CHANGELOG.md
new file mode 100755
index 000000000..ab846def0
--- /dev/null
+++ b/packages/intercom_flutter/intercom_flutter/CHANGELOG.md
@@ -0,0 +1,549 @@
+# Changelog
+
+## 9.2.2
+
+* Bump Intercom iOS SDK version to 18.2.2
+
+## 9.2.1
+
+* Bump Intercom Android SDK version to 15.11.2
+
+## 9.2.0
+
+* Bump Intercom Android SDK version to 15.11.1
+* Bump Intercom iOS SDK version to 18.2.0
+* Added API `isUserLoggedIn`.
+* Added API `fetchLoggedInUserAttributes`.
+* Fixed [#479](https://github.com/v3rm0n/intercom_flutter/issues/479).
+* Fixed [#481](https://github.com/v3rm0n/intercom_flutter/issues/481).
+
+## 9.1.1
+
+* Bump Intercom iOS SDK version to 18.1.0
+
+## 9.1.0
+
+* Bump Intercom iOS SDK version to 18.0.0
+
+## 9.0.11
+
+* Removed references to v1 embedding.
+* Implemented `displayHome` for all platforms.
+* Bump Intercom Android SDK version to 15.10.3
+* Bump Intercom iOS SDK version to 17.4.0
+
+## 9.0.10
+
+* Bump `intercom_flutter_web` to `1.1.2` supporting `web` `^1.0.0`.
+
+## 9.0.9
+
+* Bump Intercom Android SDK version to 15.10.2
+* Bump Intercom iOS SDK version to 17.3.0
+
+## 9.0.8
+
+* Bump Intercom Android SDK version to 15.10.1
+* Bump Intercom iOS SDK version to 17.2.1
+
+## 9.0.7
+
+* Bump Intercom Android SDK version to 15.9.1
+* Bump Intercom iOS SDK version to 17.1.2
+
+## 9.0.6
+
+* Bump Intercom iOS SDK version to 17.1.1
+
+## 9.0.5
+
+* Bump Intercom Android SDK version to 15.9.0
+* Bump Intercom iOS SDK version to 17.1.0
+
+## 9.0.4
+
+* Bump Intercom iOS SDK version to 17.0.4
+
+## 9.0.3
+
+* Bump Intercom Android SDK version to 15.8.3
+* Bump Intercom iOS SDK version to 17.0.3
+
+## 9.0.2
+
+* Bump Intercom Android SDK version to 15.8.2
+* Bump Intercom iOS SDK version to 17.0.2
+
+## 9.0.1
+
+* Bump Intercom Android SDK version to 15.8.1
+* Bump Intercom iOS SDK version to 17.0.1
+
+## 9.0.0
+
+* Bump Intercom Android SDK version to 15.8.0
+* Bump Intercom iOS SDK version to 17.0.0 (requires minimum iOS 15)
+
+## 8.1.4
+
+* Bump Intercom iOS SDK version to 16.6.2
+> Note: This version is not published on pub.dev. So to use this version:
+```
+dependencies:
+ intercom_flutter:
+ git:
+ url: https://github.com/v3rm0n/intercom_flutter
+ ref: v8.1.4
+ path: intercom_flutter
+```
+
+## 8.1.3
+
+* Bump Intercom Android SDK version to 15.7.1
+* Bump Intercom iOS SDK version to 16.6.1
+
+## 8.1.2
+
+* Bump Intercom Android SDK version to 15.7.0
+* Bump Intercom iOS SDK version to 16.6.0
+
+## 8.1.1
+
+* Bump Intercom Android SDK version to 15.6.3
+* Bump Intercom iOS SDK version to 16.5.9
+
+## 8.1.0
+
+* Bump Intercom iOS SDK version to 16.5.6
+* Migrated web to js_interop to be compatible with WASM
+* Updated minimum Dart version to 3.2.
+
+## 8.0.12
+
+* Fix never completing future when calling displayMessageComposer on iOS
+
+## 8.0.11
+
+* Automatically Injected Intercom Script, if it is not added.
+
+## 8.0.10
+
+* Bump Intercom iOS SDK version to 16.5.5
+* Bump Intercom Android SDK version to 15.6.2
+
+## 8.0.9
+
+* Bump Intercom iOS SDK version to 16.5.1
+* Bump Intercom Android SDK version to 15.6.0
+
+## 8.0.8
+
+* Bump Intercom iOS SDK version to 16.3.2
+* Bump Intercom Android SDK version to 15.5.1
+
+## 8.0.7
+
+* Added support of AGP 8.
+
+## 8.0.6
+
+* Bump `intercom_flutter_web` to `1.0.1` to support `uuid: ^4.2.1`.
+* Bump Intercom iOS SDK version to 16.3.1
+
+## 8.0.5
+
+* Bump Intercom iOS SDK version to 16.3.0
+* Bump Intercom Android SDK version to 15.5.0
+
+## 8.0.4
+
+* Bump Intercom iOS SDK version to 16.2.3
+* Bump Intercom Android SDK compile version to 34
+
+## 8.0.3
+
+* Bump Intercom iOS SDK version to 16.2.1
+* Bump Intercom Android SDK version to 15.4.0
+
+## 8.0.2
+
+* Bump Intercom iOS SDK version to 16.1.1
+* Bump Intercom Android SDK version to 15.3.0
+
+## 8.0.1
+
+* Bump Intercom iOS SDK version to 16.0.1
+* Bump Intercom Android SDK version to 15.2.3
+
+## 8.0.0
+
+* Bump Intercom iOS SDK version to 16.0.0. This supports Xcode 15 and iOS 17. (Note: Xcode 15 is required when using Intercom iOS SDK 16.0.0)
+* Removed deprecated methods `registerIdentifiedUser` and `registerUnidentifiedUser`.
+
+## 7.9.0
+
+* Bump Intercom iOS SDK version to [15.2.3](https://github.com/intercom/intercom-ios/releases/tag/15.2.3)
+* Bump Intercom Android SDK version to [15.2.2](https://github.com/intercom/intercom-android/releases/tag/15.2.2), requires **Android SDK 34**
+* Added documentation about using `FlutterFragmentActivity` instead of `FlutterActivity` in Android.
+
+## 7.8.5
+
+* Bump Intercom iOS SDK version to 15.2.1
+* Bump Intercom Android SDK version to 15.2.0
+* Implemented `displayTickets` for all platforms.
+
+## 7.8.4
+
+* Bump Intercom iOS SDK version to 15.1.4
+* Bump Intercom Android SDK version to 15.1.6
+* Implemented `displayConversation` for all platforms.
+
+## 7.8.3
+
+* Bump Intercom iOS SDK version to 15.1.3
+* Bump Intercom Android SDK version to 15.1.4
+
+## 7.8.2
+
+* Implemented `isIntercomPush` and `handlePush` in iOS.
+* Bump Intercom iOS SDK version to 15.0.3
+* Bump Intercom Android SDK version to 15.1.3
+* Removed **Optimistic operator (~>)** from iOS podspec to use the exact version instead of getting the next *major | minor | patch* version.
+
+## 7.8.1
+
+* Implemented method `displayHelpCenter` for web.
+* Bump Intercom iOS SDK version to 15.0.1
+* Bump Intercom Android SDK version to 15.1.1
+* Added readMe section `Using Intercom keys with --dart-define`. (Thanks [@sirTomasson](https://github.com/sirTomasson))
+
+## 7.8.0
+
+* Bump Intercom iOS SDK version to 15.0.0
+* Bump Intercom Android SDK version to 15.0.0
+
+## 7.7.0
+
+* Update minimum Dart version to Dart 3.
+
+## 7.6.9
+
+* Bump Intercom iOS SDK version to 14.1.0
+* Bump Intercom Android SDK version to 14.2.0
+
+## 7.6.8
+
+* Added way to initialize the Intercom SDK in Android application class.
+
+## 7.6.7
+
+* Bump Intercom Android SDK version to 14.1.0
+
+## 7.6.6
+
+* Bump Intercom Android SDK version to 14.0.6
+* Removed documentation of using `FlutterFragmentActivity` which was added in version 7.6.1 as it is not required now.
+
+## 7.6.5
+
+* Bump Intercom iOS SDK version to 14.0.7 ([#289](https://github.com/v3rm0n/intercom_flutter/pull/289))
+* Bump Intercom Android SDK version to 14.0.5 ([#289](https://github.com/v3rm0n/intercom_flutter/pull/289))
+
+## 7.6.4
+
+* Added method `displayHelpCenterCollections`.
+
+## 7.6.3
+
+* Added method `displayMessages`.
+
+## 7.6.2
+
+* Bump Intercom iOS SDK version to 14.0.6 ([#280](https://github.com/v3rm0n/intercom_flutter/pull/280))
+* Bump Intercom Android SDK version to 14.0.4 ([#280](https://github.com/v3rm0n/intercom_flutter/pull/280))
+
+## 7.6.1
+
+* Bump Intercom iOS SDK version to 14.0.2
+* Bump Intercom Android SDK version to 14.0.3
+* Added extra documentation to fix Android exception after background push notification is received ([#270](https://github.com/v3rm0n/intercom_flutter/issues/270#issuecomment-1330510979))
+
+## 7.6.0
+
+* Bump Intercom iOS SDK version to 14.0.0 ([#269](https://github.com/v3rm0n/intercom_flutter/pull/269))
+* Bump Intercom Android SDK version to 14.0.0 ([#269](https://github.com/v3rm0n/intercom_flutter/pull/269))
+
+## 7.5.0
+
+* Bump Intercom iOS SDK version to 13.0.0
+* Bump Android `compileSdkVersion` to 33
+
+## 7.4.1
+
+* Bump Intercom Android SDK version to 12.5.1 [(#261)](https://github.com/v3rm0n/intercom_flutter/pull/261)
+* Android 13 support
+
+## 7.4.0
+
+* Bump Intercom Android SDK version to 12.4.3 ([#259](https://github.com/v3rm0n/intercom_flutter/pull/259))
+* Bump Intercom iOS SDK version to 12.4.3 ([#259](https://github.com/v3rm0n/intercom_flutter/pull/259))
+
+## 7.3.0
+
+* Bump Intercom Android SDK version to 12.4.2 ([#248](https://github.com/v3rm0n/intercom_flutter/pull/248))
+* Bump Intercom iOS SDK version to 12.4.2 ([#248](https://github.com/v3rm0n/intercom_flutter/pull/248))
+
+## 7.2.0
+
+* Updated dependency `intercom_flutter_platform_interface: ^1.2.0`
+* Updated dependency `intercom_flutter_web: ^0.2.0`
+* Bump Intercom Android SDK version to 12.2.2
+* Bump Intercom iOS SDK version to 12.2.1
+* Implemented `displaySurvey`.
+
+## 7.1.0
+
+* Implemented `displayArticle` for web ([#231](https://github.com/v3rm0n/intercom_flutter/pull/231)).
+* Bump Intercom Android SDK version to 12.1.1
+* Bump Intercom iOS SDK version to 12.1.1
+* Updated dependency `intercom_flutter_platform_interface: ^1.1.0`
+* Updated dependency `intercom_flutter_web: ^0.1.0`
+* Added method `loginIdentifiedUser` with `IntercomStatusCallback` support.
+* Deprecated `registerIdentifiedUser` in favor of `loginIdentifiedUser`.
+* Added method `loginUnidentifiedUser` with `IntercomStatusCallback` support.
+* Deprecated `registerUnidentifiedUser` in favor of `loginUnidentifiedUser`.
+* Added parameter `statusCallback` in `updateUser` to support `IntercomStatusCallback`.
+* Renamed the following methods in the MethodChannel:
+ - `registerIdentifiedUserWithUserId` to `loginIdentifiedUserWithUserId`.
+ - `regsiterIdentifiedUserWithEmail` to `loginIdentifiedUserWithEmail`.
+ - `registerUnidentifiedUser` to `loginUnidentifiedUser`.
+
+## 7.0.0
+> Note: This release has breaking changes.
+
+* Updated `displayArticle` method documentation. ([#224](https://github.com/v3rm0n/intercom_flutter/pull/224))
+* API methods are now available at instance level instead of static. ([#226](https://github.com/v3rm0n/intercom_flutter/pull/226))
+ - Now use `Intercom.instance` instead of just `Intercom`, for e.g: `Intercom.instance.displayMessenger()`.
+
+## 6.2.0
+
+* Bump Intercom Android SDK version to 12.0.0 ([#220](https://github.com/v3rm0n/intercom_flutter/pull/220))
+* Bump Intercom iOS SDK version to 12.0.0 ([#220](https://github.com/v3rm0n/intercom_flutter/pull/220))
+
+## 6.1.0
+
+* Bump Intercom Android SDK version to 10.7.0 ([#217](https://github.com/v3rm0n/intercom_flutter/pull/217))
+* Bump Intercom iOS SDK version to 11.2.0 ([#217](https://github.com/v3rm0n/intercom_flutter/pull/217))
+
+## 6.0.0
+> Note: This release has breaking changes.
+
+* Bump Intercom Android SDK version to 10.6.1 ([#204](https://github.com/v3rm0n/intercom_flutter/pull/204))
+* Bump Intercom iOS SDK version to 11.0.1 ([#204](https://github.com/v3rm0n/intercom_flutter/pull/204))
+* Resolved issue [#151](https://github.com/v3rm0n/intercom_flutter/issues/151)
+* Changed Android push intercepting technique ([#192](https://github.com/v3rm0n/intercom_flutter/pull/192))
+* Updated README ([#205](https://github.com/v3rm0n/intercom_flutter/pull/205))
+* **BREAKING**
+ - Intercom iOS SDK v11 requires minimum deployment target version 13. So iOS minimum version is updated from 10 to 13. See https://github.com/intercom/intercom-ios/blob/master/CHANGELOG.md#1100
+ - The service `io.maido.intercom.PushInterceptService` is deleted. Now plugin itself will handle the push messages using the new added receiver `io.maido.intercom.PushInterceptReceiver`.
+ - remove the service `io.maido.intercom.PushInterceptService`, if you have, from your `AndroidManifest.xml`.
+ - remove the code to handle the background Intercom push from your `firebase_messaging` background handler. Now it is not required to handle manually.
+
+## 5.3.0
+* Added API documentation ([#194](https://github.com/v3rm0n/intercom_flutter/pull/194))
+* Bump Intercom Android SDK version to 10.6.0 ([#195](https://github.com/v3rm0n/intercom_flutter/pull/195))
+* Bump Intercom iOS SDK version to 10.4.0 ([#195](https://github.com/v3rm0n/intercom_flutter/pull/195))
+* Bump android kotlin version to 1.5.30 ([#196](https://github.com/v3rm0n/intercom_flutter/pull/196))
+* Bump android `com.android.tools.build:gradle` to 7.0.4 ([#196](https://github.com/v3rm0n/intercom_flutter/pull/196))
+* Bump android `compileSdkVersion` to 31 ([#196](https://github.com/v3rm0n/intercom_flutter/pull/196))
+* Bump android `gradle` plugin version to 7.3.3 ([#196](https://github.com/v3rm0n/intercom_flutter/pull/196))
+* Updated README ([#197](https://github.com/v3rm0n/intercom_flutter/pull/197))
+* Updated dependency `intercom_flutter_platform_interface: ^1.0.1`
+* Updated dependency `intercom_flutter_web: ^0.0.4`
+
+## 5.2.0
+* Bump Intercom Android SDK version to 10.4.2 ([#187](https://github.com/v3rm0n/intercom_flutter/pull/187))
+* Bump Intercom iOS SDK version to 10.3.4 ([#187](https://github.com/v3rm0n/intercom_flutter/pull/187))
+
+## 5.1.0+1
+* Resolved issue [#181](https://github.com/v3rm0n/intercom_flutter/issues/181)
+
+## 5.1.0
+* Bump Intercom Android SDK version to 10.4.0 ([#178](https://github.com/v3rm0n/intercom_flutter/pull/178))
+* Bump Intercom iOS SDK version to 10.3.0 ([#178](https://github.com/v3rm0n/intercom_flutter/pull/178))
+
+## 5.0.3
+* Resolved issue [#173](https://github.com/v3rm0n/intercom_flutter/issues/173)
+
+## 5.0.2
+* Updated README: Removed the `
` tag that was being shown on the pub.dev.
+* Updated intercom_flutter pod version to `5.0.0`.
+
+## 5.0.1
+* Clear warning `PushInterceptService.java uses unchecked or unsafe operations.`
+
+## 5.0.0
+* Added web support
+* Bump Intercom iOS SDK version to 10.0.2
+ - this will solve the displayArticle issue. See https://github.com/intercom/intercom-ios/blob/master/CHANGELOG.md#1002
+
+## 4.0.0
+* Bump Intercom Android SDK version to 10.0.0
+* Bump Intercom iOS SDK version to 10.0.0
+* Adjustment to encode the iOS device token with HexString.
+* Added support for displayCarousel
+* Added support for displayArticle
+ - Note: Intercom iOS SDK has an issue with displayArticle if your Intercom account does have that feature enabled. It crashes the app. The bug is already reported at https://forum.intercom.com/s/question/0D52G000050ZFNoSAO/intercom-display-article-crash-on-ios. As per the conversation with Intercom support, they are working on the issue. The fix may take some time.
+* Internal Changes:
+ - used `hideIntercom()` as `hideMessenger()` is deprecated and removed in Intercom SDK 10.0.0
+ - Android - updated gradle version and dependencies.
+
+## 3.2.1
+* Fix `application has not been initialized` crash on Android when calling from background isolate.
+
+## 3.2.0
+* Migrate to use intercom_flutter_platform_interface
+
+## 3.1.0
+* Added support for language_override
+
+## 3.0.0
+* Migrate to null-safety
+
+## 2.3.4
+* Added support for setting bottom padding
+
+## 2.3.3
+* Added signedUpAt user attribute
+
+## 2.3.2
+* Fix crash if app is closed before fully initialised
+
+## 2.3.1
+* Fix Android build issue
+* Updated Android dependencies
+
+## 2.3.0
+* Migrate Android side to Flutter's v2 Android Plugin APIs
+
+## 2.2.1
+* Implement sendTokenToIntercom method on iOS side to support push notifications
+
+## 2.2.0+1
+* Fix project dependencies
+
+## 2.2.0
+* Added unread messages count listener
+
+## 2.1.1
+* Fix incremental installation error
+
+## 2.1.0
+* Bump Intercom SDK version to 6.0.0 (thanks @marbarroso)
+* Bump minimum Android supported version to Lollipop (API 21)
+* Bump minimum iOS supported version to iOS 10.0
+
+## 2.0.7
+* Fixed background notifications being swallowed by intercom_flutter in Android (thanks @LinusU)
+
+## 2.0.6
+* Added hideMessenger (thanks @Spikes042)
+
+## 2.0.5+2
+* Fix iOS build error
+
+## 2.0.5+1
+* Fix example project dependencies
+
+## 2.0.5
+* Add displayMessageComposer (thanks @knaeckeKami)
+* Add support for Android 10
+* Add support for iOS 13
+
+## 2.0.4
+* Support for push notifications
+
+## 2.0.3
+* Upgraded Intercom SDK to 5.3
+* Upgraded Kotlin, Android Studio, Gradle and CocoaPods to latest version
+* Upgraded minimum Flutter version to `1.0.0`
+* Upgraded minimum Dart version to `2.0.0`
+* Fixed iOS warning
+
+## 2.0.2
+* Added logEvent method (thanks @MrAlek)
+* Fixed registerIdentifiedUser (thanks @Spikes042)
+
+## 2.0.1
+* Added argument validation to registerIdentifiedUser (thanks @Zazo032)
+
+## 2.0.0
+* Changed message channel name
+* Added email to user registration
+
+## 1.0.12
+* Added setUserHash (thanks @Spikes042)
+
+## 1.0.11
+* Added unreadConversationCount and setInAppMessagesVisible
+* Migrated to AndroidX (thanks @LeonidVeremchuk and @Zazo032)
+
+## 1.0.10
+* Updated author
+
+## 1.0.9
+* Added support for companies
+* Added support for custom attributes
+
+## 1.0.8
+* Fixed issues with nullability in Intercom Android SDK
+
+## 1.0.7
+* Added Help Center support
+
+## 1.0.6
+
+* Fixed null check in ObjectiveC
+
+## 1.0.5
+
+* Fixed ObjectiveC warnings
+
+## 1.0.4
+
+* Converter Swift code to ObjectiveC
+
+## 1.0.3
+
+* Updated iOS project to Swift 4.2
+
+## 1.0.2
+
+* Fixed plugin name in all places
+
+## 1.0.1
+
+* Fixed ios headers
+
+## 1.0.0
+
+* Added user attributes (name, email, phone, userId and company)
+* Renamed package to `intercom_flutter` because of the name clash with Intercom pod
+
+## 0.0.4
+
+* Fixed pod name in podspec
+
+## 0.0.3
+
+* Added example project
+* Formatted code
+* Added test
+
+## 0.0.2
+
+* Changed minimum SDK version to `2.0.0-dev.28.0`
+
+## 0.0.1
+
+* Implemented `initialize`, `registerIdentifiedUser`, `registerUnidentifiedUser`, `logout`, `setLauncherVisibility`, `displayMessenger` on both Android and iOS
diff --git a/packages/intercom_flutter/intercom_flutter/LICENSE b/packages/intercom_flutter/intercom_flutter/LICENSE
new file mode 100644
index 000000000..fface4a6c
--- /dev/null
+++ b/packages/intercom_flutter/intercom_flutter/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2018 xChange OÜ
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/packages/intercom_flutter/intercom_flutter/analysis_options.yml b/packages/intercom_flutter/intercom_flutter/analysis_options.yml
new file mode 100644
index 000000000..4135297cc
--- /dev/null
+++ b/packages/intercom_flutter/intercom_flutter/analysis_options.yml
@@ -0,0 +1,4 @@
+analyzer:
+ strong-mode:
+ implicit-casts: false
+ implicit-dynamic: false
diff --git a/packages/intercom_flutter/intercom_flutter/android/.gitignore b/packages/intercom_flutter/intercom_flutter/android/.gitignore
new file mode 100644
index 000000000..b339598d0
--- /dev/null
+++ b/packages/intercom_flutter/intercom_flutter/android/.gitignore
@@ -0,0 +1,7 @@
+*.iml
+.gradle
+/local.properties
+/.idea/*
+.DS_Store
+/build
+/captures
diff --git a/packages/intercom_flutter/intercom_flutter/android/build.gradle b/packages/intercom_flutter/intercom_flutter/android/build.gradle
new file mode 100644
index 000000000..d4cde47b8
--- /dev/null
+++ b/packages/intercom_flutter/intercom_flutter/android/build.gradle
@@ -0,0 +1,55 @@
+group 'io.maido.intercom'
+version '1.0-SNAPSHOT'
+
+buildscript {
+ ext.kotlin_version = '1.9.21'
+ repositories {
+ google()
+ mavenCentral()
+ }
+
+ dependencies {
+ classpath 'com.android.tools.build:gradle:8.1.4'
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+ }
+}
+
+rootProject.allprojects {
+ repositories {
+ google()
+ mavenCentral()
+ }
+}
+
+apply plugin: 'com.android.library'
+apply plugin: 'kotlin-android'
+
+android {
+ compileSdk 34
+ sourceSets {
+ main.java.srcDirs += 'src/main/kotlin'
+ }
+ defaultConfig {
+ minSdk 21
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+ lintOptions {
+ disable 'InvalidPackage'
+ }
+ if (project.android.hasProperty('namespace')) {
+ namespace 'io.maido.intercom'
+ }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+ kotlinOptions {
+ jvmTarget = '1.8'
+ }
+}
+
+dependencies {
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
+ implementation 'io.intercom.android:intercom-sdk:15.11.2'
+ implementation 'com.google.firebase:firebase-messaging:23.3.1'
+}
diff --git a/packages/intercom_flutter/intercom_flutter/android/gradle.properties b/packages/intercom_flutter/intercom_flutter/android/gradle.properties
new file mode 100644
index 000000000..678cd6244
--- /dev/null
+++ b/packages/intercom_flutter/intercom_flutter/android/gradle.properties
@@ -0,0 +1,3 @@
+org.gradle.jvmargs=-Xmx1536M
+android.enableJetifier=true
+android.useAndroidX=true
\ No newline at end of file
diff --git a/packages/intercom_flutter/intercom_flutter/android/settings.gradle b/packages/intercom_flutter/intercom_flutter/android/settings.gradle
new file mode 100644
index 000000000..f21b7e7f7
--- /dev/null
+++ b/packages/intercom_flutter/intercom_flutter/android/settings.gradle
@@ -0,0 +1 @@
+rootProject.name = 'intercom_flutter'
diff --git a/packages/intercom_flutter/intercom_flutter/android/src/main/AndroidManifest.xml b/packages/intercom_flutter/intercom_flutter/android/src/main/AndroidManifest.xml
new file mode 100644
index 000000000..1d0ecaf55
--- /dev/null
+++ b/packages/intercom_flutter/intercom_flutter/android/src/main/AndroidManifest.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/intercom_flutter/intercom_flutter/android/src/main/java/io/maido/intercom/PushInterceptReceiver.kt b/packages/intercom_flutter/intercom_flutter/android/src/main/java/io/maido/intercom/PushInterceptReceiver.kt
new file mode 100644
index 000000000..75ff55e98
--- /dev/null
+++ b/packages/intercom_flutter/intercom_flutter/android/src/main/java/io/maido/intercom/PushInterceptReceiver.kt
@@ -0,0 +1,36 @@
+package io.maido.intercom
+
+import android.app.Application
+import android.content.BroadcastReceiver
+import android.content.Context
+import android.content.Intent
+import android.util.Log
+import com.google.firebase.messaging.RemoteMessage
+import io.intercom.android.sdk.push.IntercomPushClient
+
+class PushInterceptReceiver : BroadcastReceiver() {
+
+ private val intercomPushClient = IntercomPushClient()
+
+ override fun onReceive(context: Context?, intent: Intent?) {
+ if (context == null) return
+
+ val application = context.applicationContext as Application
+
+ val dataBundle = intent?.extras ?: return
+
+ val remoteMessage = RemoteMessage(dataBundle)
+ val message = remoteMessage.data
+
+ if (intercomPushClient.isIntercomPush(message)) {
+ Log.d(TAG, "Intercom message received")
+ intercomPushClient.handlePush(application, message)
+ } else {
+ Log.d(TAG, "Push message received, not for Intercom")
+ }
+ }
+
+ companion object {
+ private const val TAG = "PushInterceptReceiver"
+ }
+}
diff --git a/packages/intercom_flutter/intercom_flutter/android/src/main/kotlin/io/maido/intercom/IntercomFlutterPlugin.kt b/packages/intercom_flutter/intercom_flutter/android/src/main/kotlin/io/maido/intercom/IntercomFlutterPlugin.kt
new file mode 100644
index 000000000..187b7afe5
--- /dev/null
+++ b/packages/intercom_flutter/intercom_flutter/android/src/main/kotlin/io/maido/intercom/IntercomFlutterPlugin.kt
@@ -0,0 +1,366 @@
+package io.maido.intercom
+
+import android.app.Application
+import io.flutter.embedding.engine.plugins.FlutterPlugin
+import io.flutter.embedding.engine.plugins.activity.ActivityAware
+import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding
+import io.flutter.plugin.common.EventChannel
+import io.flutter.plugin.common.MethodCall
+import io.flutter.plugin.common.MethodChannel
+import io.flutter.plugin.common.MethodChannel.MethodCallHandler
+import io.flutter.plugin.common.MethodChannel.Result
+import io.intercom.android.sdk.*
+import io.intercom.android.sdk.identity.Registration
+import io.intercom.android.sdk.push.IntercomPushClient
+
+class IntercomFlutterPlugin : FlutterPlugin, MethodCallHandler, EventChannel.StreamHandler, ActivityAware {
+ companion object {
+ @JvmStatic
+ lateinit var application: Application
+
+ @JvmStatic
+ fun initSdk(application: Application, appId: String, androidApiKey: String) {
+ Intercom.initialize(application, apiKey = androidApiKey, appId = appId)
+ }
+ }
+
+ private val intercomPushClient = IntercomPushClient()
+ private var unreadConversationCountListener: UnreadConversationCountListener? = null
+
+ override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
+ val channel = MethodChannel(flutterPluginBinding.binaryMessenger, "maido.io/intercom")
+ channel.setMethodCallHandler(IntercomFlutterPlugin())
+ val unreadEventChannel = EventChannel(flutterPluginBinding.binaryMessenger, "maido.io/intercom/unread")
+ unreadEventChannel.setStreamHandler(IntercomFlutterPlugin())
+ application = flutterPluginBinding.applicationContext as Application
+ }
+
+ // https://stackoverflow.com/a/62206235
+ override fun onAttachedToActivity(binding: ActivityPluginBinding) {
+ application = binding.activity.application
+ }
+
+ override fun onMethodCall(call: MethodCall, result: Result) {
+ when (call.method) {
+ "initialize" -> {
+ val apiKey = call.argument("androidApiKey")
+ val appId = call.argument("appId")
+ Intercom.initialize(application, apiKey, appId)
+ result.success("Intercom initialized")
+ }
+ "setBottomPadding" -> {
+ val padding = call.argument("bottomPadding")
+ if (padding != null) {
+ Intercom.client().setBottomPadding(padding)
+ result.success("Bottom padding set")
+ }
+ }
+ "setUserHash" -> {
+ val userHash = call.argument("userHash")
+ if (userHash != null) {
+ Intercom.client().setUserHash(userHash)
+ result.success("User hash added")
+ }
+ }
+ "loginIdentifiedUserWithUserId" -> {
+ val userId = call.argument("userId")
+ if (userId != null) {
+ var registration = Registration.create()
+ registration = registration.withUserId(userId)
+ Intercom.client().loginIdentifiedUser(registration, intercomStatusCallback = object : IntercomStatusCallback {
+ override fun onFailure(intercomError: IntercomError) {
+ // Handle failure
+ result.error(intercomError.errorCode.toString(), intercomError.errorMessage, getIntercomError(
+ errorCode = intercomError.errorCode,
+ errorMessage = intercomError.errorMessage,
+ ))
+ }
+
+ override fun onSuccess() {
+ // Handle success
+ result.success("User created")
+ }
+ })
+ }
+ }
+ "loginIdentifiedUserWithEmail" -> {
+ val email = call.argument("email")
+ if (email != null) {
+ var registration = Registration.create()
+ registration = registration.withEmail(email)
+ Intercom.client().loginIdentifiedUser(registration, intercomStatusCallback = object : IntercomStatusCallback {
+ override fun onFailure(intercomError: IntercomError) {
+ // Handle failure
+ result.error(intercomError.errorCode.toString(), intercomError.errorMessage, getIntercomError(
+ errorCode = intercomError.errorCode,
+ errorMessage = intercomError.errorMessage,
+ ))
+ }
+
+ override fun onSuccess() {
+ // Handle success
+ result.success("User created")
+ }
+ })
+ }
+ }
+ "loginUnidentifiedUser" -> {
+ Intercom.client().loginUnidentifiedUser(intercomStatusCallback = object : IntercomStatusCallback {
+ override fun onFailure(intercomError: IntercomError) {
+ // Handle failure
+ result.error(intercomError.errorCode.toString(), intercomError.errorMessage, getIntercomError(
+ errorCode = intercomError.errorCode,
+ errorMessage = intercomError.errorMessage,
+ ))
+ }
+
+ override fun onSuccess() {
+ // Handle success
+ result.success("User created")
+ }
+ })
+ }
+ "logout" -> {
+ Intercom.client().logout()
+ result.success("logout")
+ }
+ "setLauncherVisibility" -> {
+ val visibility = call.argument("visibility")
+ if (visibility != null) {
+ Intercom.client().setLauncherVisibility(Intercom.Visibility.valueOf(visibility))
+ result.success("Showing launcher: $visibility")
+ }
+ }
+ "displayMessenger" -> {
+ Intercom.client().present()
+ result.success("Launched")
+ }
+ "hideMessenger" -> {
+ Intercom.client().hideIntercom()
+ result.success("Hidden")
+ }
+ "displayHelpCenter" -> {
+ Intercom.client().present(IntercomSpace.HelpCenter)
+ result.success("Launched")
+ }
+ "displayHelpCenterCollections" -> {
+ val collectionIds = call.argument>("collectionIds")
+ Intercom.client().presentContent(
+ content = IntercomContent.HelpCenterCollections(
+ ids = collectionIds ?: emptyList()
+ )
+ )
+ result.success("Launched")
+ }
+ "displayMessages" -> {
+ Intercom.client().present(IntercomSpace.Messages)
+ result.success("Launched")
+ }
+ "setInAppMessagesVisibility" -> {
+ val visibility = call.argument("visibility")
+ if (visibility != null) {
+ Intercom.client().setInAppMessageVisibility(Intercom.Visibility.valueOf(visibility))
+ result.success("Showing in app messages: $visibility")
+ } else {
+ result.success("Launched")
+ }
+ }
+ "unreadConversationCount" -> {
+ val count = Intercom.client().unreadConversationCount
+ result.success(count)
+ }
+ "updateUser" -> {
+ Intercom.client().updateUser(getUserAttributes(call), intercomStatusCallback = object : IntercomStatusCallback {
+ override fun onFailure(intercomError: IntercomError) {
+ // Handle failure
+ result.error(intercomError.errorCode.toString(), intercomError.errorMessage, getIntercomError(
+ errorCode = intercomError.errorCode,
+ errorMessage = intercomError.errorMessage,
+ ))
+ }
+
+ override fun onSuccess() {
+ // Handle success
+ result.success("User updated")
+ }
+ })
+ }
+ "logEvent" -> {
+ val name = call.argument("name")
+ val metaData = call.argument