The Gleap SDK for Flutter is the easiest way to integrate Gleap into your apps. Communicate with your users directly and build better software by discovering their everyday pain points. Gleap is your all-in-one customer feedback tool for apps and websites.
For the SDK to work, you need an API key, which you can get for free at app.gleap.ai.
Supported platforms
✅ iOS | ✅ Android | ✅ Web |
|---|
🏗 Installation
Open a terminal window and navigate to the root folder of your iOS project.
Install the Gleap SDK
Run this command to add Gleap to your dependencies:
flutter pub add gleap_sdkRequirements
gleap_sdk 19 needs Dart 3.3 / Flutter 3.19 or newer, iOS 15 or newer and Android minSdkVersion 21 or higher.
iOS installation
gleap_sdk needs an iOS deployment target of 15.0 or higher. On iOS it is a Swift package (ios/gleap_sdk/Package.swift) that pulls the native Gleap iOS SDK from GitHub; it still ships a podspec for apps that use CocoaPods. Flutter picks one of the two for you.
Needs Flutter 3.41 or newer (the plugin's package depends on the FlutterFramework package that Flutter generates since 3.41) and Xcode 15 or newer. From Flutter 3.44 Swift Package Manager is on by default: run flutter run or flutter build ios and Flutter adds the integration to your Xcode project. On Flutter 3.41 to 3.43 turn it on first:
flutter config --enable-swift-package-managerOr turn it on for the project in your app's pubspec.yaml:
flutter:
config:
enable-swift-package-manager: trueSet the Runner target's Minimum Deployments to 15.0 in Xcode, otherwise Xcode reports that gleap-sdk requires iOS 15.0. See Swift Package Manager for app developers for details.
flutter config --no-enable-swift-package-manager) or upgrade Flutter to 3.41+.Used on Flutter older than 3.41 and whenever Swift Package Manager is turned off. Set platform :ios, '15.0' in ios/Podfile and run flutter run / flutter build ios (or pod install in ios/). When upgrading from an older gleap_sdk, run this once in ios/:
pod update Gleap gleap_sdkpod install fails with None of your spec sources contain Gleap (= X.Y.Z). Add the SDK from GitHub to the Runner target in your Podfile, with the version the plugin requires (s.dependency 'Gleap', 'X.Y.Z' in the plugin's ios/gleap_sdk.podspec):target 'Runner' do flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) pod 'Gleap', :git => 'https://github.com/GleapSDK/Gleap-iOS-SDK.git', :tag => 'X.Y.Z'endOnly add this line with CocoaPods: if
gleap_sdk comes through Swift Package Manager, a pod 'Gleap' in the Podfile links the Gleap iOS SDK a second time.Android installation
Android should be already good to go. If theres a version conflict pls add the following to your android manifest:
<manifest ... xmlns:tools="http://schemas.android.com/tools">
<uses-sdk android:minSdkVersion="21"
tools:overrideLibrary="io.gleap.gleap_sdk"/>
<application .... tools:overrideLibrary="io.gleap.gleap_sdk">
...Important: Always have a look at your minSdkVersion on android and your minimum target version on iOS to keep them on the same minimum version gleap needs.
android:hardwareAccelerated="false" at the application level in your AndroidManifest.xml. This can cause issues with the Gleap SDK on Android. If you need to disable hardware acceleration, consider applying it only to specific activities instead.Web installation
Navigate to your web project folder and insert the following snippet as first element within the head tag of your index.html
<script>
!function(){if(!(window.Gleap=window.Gleap||[]).invoked){window.GleapActions=[];var e=new Proxy({invoked:!0},{get:function(e,n){return"invoked"===n?e.invoked:function(){var e=Array.prototype.slice.call(arguments);window.GleapActions.push({e:n,a:e})}},set:function(e,n,t){return e[n]=t,!0}});window.Gleap=e;var n=document.getElementsByTagName("head")[0],t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src="https://sdk.gleap.io/latest/index.js",n.appendChild(t)}}();
</script>Please note that you must need to run flutter clean and flutter pub get after adding the Gleap script to your index.html file.
Configure the SDK
The last step is to initialize & configure the Gleap SDK by adding the following code. If you want to add the Gleap SDK in your main.dart make sure to call WidgetsFlutterBinding.ensureInitialized(); before you initialize the Gleap SDK.
Gleap.initialize(token: 'YOUR_API_KEY');Congratulations 🎉 You are all set 👋
🌍 Data region
Gleap stores and processes your data in the region you selected at signup: EU (default) or US. If your project lives in the US region, select the region before initializing the SDK (requires SDK v18.0.0 or newer). EU projects don't need this call.
await Gleap.setRegion(region: 'us');
Gleap.initialize(token: 'YOUR_API_KEY');See Data regions for all hosts and details.
Required permissions (Android)
In order to use the image picker for attachments, add the following permissions to your AndroidManifest.xml.
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VISUAL_USER_SELECTED"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />The following permissions are needed to enable audio recordings.
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-feature android:name="android.hardware.audio.pro" android:required="false" />
<uses-feature android:name="android.hardware.microphone" android:required="false" />Required permissions (iOS)
In order to use the image picker for attachments, add the following permissions to your Info.plist.
<key>NSPhotoLibraryUsageDescription</key> <string>We need access to your photo library to allow you to select an image.</string>
<key>NSCameraUsageDescription</key> <string>We need access to your camera to take photos.</string> The following permissions are needed to enable audio recordings.
<key>NSMicrophoneUsageDescription</key> <string>We need access to your microphone to record audio with videos.</string>🤝 Need help?
We are here to help! [email protected]

