Flutter SDK Setup
To integrate AppsOnAir AppRemark Flutter SDK into your Flutter Apps, follow the below steps
- Make sure to configure the App ID properly. For additional information Getting started
iOS Requirements and Setup
Requirements
-
Minimum deployment target: 15.0
-
Add the following photo library permission to your
Info.plist:
<key>NSPhotoLibraryUsageDescription</key>
<string>$(PRODUCT_NAME) need permission to choose image from gallery for App Remark feature.</string>
iOS Dependency Manager
This plugin supports both CocoaPods and Swift Package Manager (SPM). SPM requires Flutter 3.24.0 or higher.
- Swift Package Manager ✦ Recommended
- CocoaPods
Enable SPM globally (once per machine):
flutter config --enable-swift-package-manager
Then run:
flutter pub get
Flutter automatically resolves the native iOS dependency via SPM — no additional Xcode configuration needed.
You can also enable SPM per project by adding to pubspec.yaml:
flutter:
config:
enable-swift-package-manager: true
Run the following after flutter pub get:
cd ios && pod install
Android Requirements and Setup
Requirements
-
JAVA 11 required
-
An Android 7.0+ device or emulator.
-
Project using AndroidX.
-
compileSDKVersion set to 34 or higher.
-
Targets API level 24 (NOUGAT) or higher
-
Android Gradle Plugin (AGP): Version 8.0.2 or higher
-
Gradle version 8.0 or higher
-
Kotlin Version 1.7.10 or higher
-
Uses Jetpack (AndroidX), which includes meeting these version requirements:
compileSdkVersion34 or later
-
Set up a physical device or use an emulator to run your app.
-
Create or login to your AppsOnAir Account
-
Go to the Keys & IDs tab under App Settings, copy and use the App ID in your SDK integration.
Setup
Add AppsOnAir AppRemark in Gradle Plugin
- In
settings.gradle:
- Groovy
- Kotlin
pluginManagement {
……
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven { url 'https://jitpack.io' }
}
}
pluginManagement {
……
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven("https://jitpack.io")
}
}
- In root level
build.gradle:
- Groovy
- Kotlin
allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
allprojects {
repositories {
google()
mavenCentral()
maven("https://jitpack.io")
}
}
When creating a new project from Android Studio Arctic Fox (or newer) the allprojects{...} is no longer added in the project level gradle. Add JitPack under dependencyResolutionManagement in settings.gradle instead:
- Groovy
- Kotlin
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven("https://jitpack.io")
}
}
android.useAndroidX = true
android.enableJetifier = true
Add the below code to your Launcher activity
- Add the following code because Flutter is preventing the SDK from capturing the current screen.
import io.flutter.embedding.android.RenderMode
class MainActivity : FlutterActivity(){
override fun getRenderMode(): RenderMode {
return RenderMode.texture
}
}
Create strings.xml
- Create a string.xml file in
android/app/src/main/res/valuesand add the below code.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name"> YOUR_APP_NAME </string>
</resources>
Add the AppRemark Service in Flutter code
Add the SDK
- Run the following command to add the package:
$ flutter pub add appsonair_flutter_appremark
Import the SDK
import "package:appsonair_flutter_appremark/app_remark_service.dart";
Initialize the Service
Here’s how to initialize the service:
@override
void initState() {
super.initState();
AppRemarkService.initialize(
context,
shakeGestureEnable: true, // Set to true or false as per your need
shakeSensitivity: ShakeSensitivity.medium, // Optional — defaults to medium
onRemarkResponse: (result) {
// Handle Response Here
},
);
}
- Initialize the
AppRemarkServicewith defaultAdd Remarkscreen. - The
AppRemarkServiceinitialization allows you to integrate remark functionality. By default, the shake gesture is enabledshakeGestureEnable: true, allowing the device to capture the current screen on a shake. To disable this behavior, you can explicitly setshakeGestureEnabletofalse. - The
shakeSensitivityparameter controls how much force is required to trigger the shake gesture. If not set, it defaults toShakeSensitivity.medium. - The
onRemarkResponsemethod listens for the feedback status when feedback is submitted, such as success or failure responses.
shakeSensitivity values
| Value | Description |
|---|---|
ShakeSensitivity.veryLow | Very hard, deliberate shake required |
ShakeSensitivity.low | Firm shake required |
ShakeSensitivity.medium | Normal shake (default) |
ShakeSensitivity.high | Light shake triggers feedback |
ShakeSensitivity.veryHigh | Any motion triggers feedback |
onRemarkResponse listener response
{
"message": "Remark added successfully.",
"status": "SUCCESS"
}
| Field | Type | Description | Example |
|---|---|---|---|
message | string | A descriptive message providing details about the feedback submission status. | "Remark added successfully." |
status | "SUCCESS" | "FAILURE" | Indicates whether the feedback submission succeeded or failed in the onRemarkResponse listener. | "SUCCESS" |
Customization and Usage
Customize the Add Remark Screen
- Customize the
Add Remarkscreen theme according to your app theme by passing anoptionsmap containing key-value pairs. - Available keys of options for Customization
| Key | DataType | Value | Description |
|---|---|---|---|
pageBackgroundColor | String | "#E8F1FF" | Set page background color |
appBarBackgroundColor | String | "#E8F1FF" | Set appbar background color |
appBarTitleText | String | "Add Remark" | Set appbar title text |
appBarTitleColor | String | "#000000" | Set appbar title color |
remarkTypeLabelText | String | "Remark Type" | Set remark type label text |
descriptionLabelText | String | "Description" | Set description label text |
descriptionHintText | String | "Add description here..." | Set description hint text |
descriptionMaxLength | int | 255 | Set description max length |
buttonText | String | "Submit" | Set button text |
buttonTextColor | String | "#FFFFFF" | Set button text color |
buttonBackgroundColor | String | "#007AFF" | Set button background color |
labelColor | String | "#000000" | Set text field label color |
hintColor | String | "#B1B1B3" | Set text field hint color |
inputTextColor | String | "#000000" | Set text field input text color |
AppRemarkService.initialize(
context,
options: {
'pageBackgroundColor': '#FFC0CB',
'descriptionMaxLength': 25,
},
onRemarkResponse: (result) {
// Handle Response Here
},
);
Open the AppRemark Screen Manually
await AppRemarkService.addRemark(context);
- Use the
addRemarkmethod to open theAdd Remarkscreen manually:
Send Custom Payload
await AppRemarkService.setAdditionalMetaData(extraPayload: {
"userName": "USER_NAME",
"userId": "USER_ID",
"openUsingShake": "false",
});
- Send additional meta-data by using
setAdditionalMetaDatamethod and passextraPayloadas a map with key-value pairs:
Make sure that to call initialize() method after MaterialApp!
Run App & Verify AppRemark Services
Run your app by using code editor on Android/IOS simulators or any physical device to make sure it builds correctly.