Skip to main content

React Native SDK Setup AppRemark

To integrate AppsOnAir AppRemark React Native SDK to your React Native Apps, follow the below steps

apiKey Setup
  • Make sure to configure the API key properly. For additional information Getting started

Step 1. iOS Requirements and setup

1.1 Requirements​

  • Minimum deployment target: 12.0

  • This pod requires photo permissions. Add the following usage description to your Info.plist:

Info.plist
<key>NSPhotoLibraryUsageDescription</key>
<string>$(PRODUCT_NAME) need permission to choose image from gallery for App Remark feature.</string>

Step 2. Android Requirements​ and setup

2.1 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:

    • compileSdkVersion 34 or later
  • Set up a physical device or use an emulator to run your app.

  • Create or login to your AppsOnAir (AoA) Account

  • Goto the your app details page -> App services tab -> API key tab to get your AoA services API Key

Step 3. Add the AppRemark Service in React Native code and usage

3.1 Installing package

Terminal
 $ npm i appsonair-react-native-appremark
for IOS

Don't forgot to install pods! (for iOS)

3.2 Import

App.tsx
import { initialize } from "appsonair-react-native-appremark";

Step 4. Initializing the Service and Customizing Its Theme

4.1 Initialize the service:

App.tsx
useEffect(() => {
// Initialize AppRemark with custom theme configuration
initialize(
true // Set shakeGestureEnable true or false as per your need
);
}, []);
  • Initialize the AppRemarkService with default "Add Remark" screen.
  • The AppRemarkService initialization allows you to integrate remark functionality. By default, the shake gesture is enabled shakeGestureEnable: true, allowing the device to capture the current screen on a shake. To disable this behavior, you can explicitly set shakeGestureEnable to false.

4.2 Customize the "Add Remark" Screen

  • Customize the "Add Remark" screen theme according to your app theme by passing options containing key-value pairs.
  • Available keys of options for Customization
KeyDataTypeValueDescription
pageBackgroundColorString"#E8F1FF"Set page background color
appBarBackgroundColorString"#E8F1FF"Set appbar background color
appBarTitleTextString"Add Remark"Set appbar title text
appBarTitleColorString"#000000"Set appbar title color
remarkTypeLabelTextString"Remark Type"Set remark type label text
descriptionLabelTextString"Description"Set description label text
descriptionHintTextString"Add description here..."Set description hint text
descriptionMaxLengthint255Set description max length
buttonTextString"Submit"Set button text
buttonTextColorString"#FFFFFF"Set button text color
buttonBackgroundColorString"#007AFF"Set button background color
labelColorString"#000000"Set text field label color
hintColorString"#B1B1B3"Set text field hint color
inputTextColorString"#000000"Set text field input text color
App.tsx
useEffect(() => {
// Initialize AppRemark with custom theme configuration
initialize(
true, // Set shakeGestureEnable true or false as per your need
{
appBarBackgroundColor: "#1E1E2F",
appBarTitleColor: "#FFFFFF",
buttonBackgroundColor: "#0066CC",
buttonTextColor: "#FFFFFF",
pageBackgroundColor: "#F9F9F9",
buttonText: "Submit",
appBarTitleText: "Welcome",
descriptionHintText: "Enter your description here...",
descriptionLabelText: "Description",
descriptionMaxLength: 100,
hintColor: "#A9A9A9",
inputTextColor: "#000000",
labelColor: "#333333",
remarkTypeLabelText: "Remarks",
} // Optional options to pass for customizing AppRemark NativeUI Theme
);
}, []);

Step 5. Opening the AppRemark Screen Manually

5.1 Navigating to Add Remark Screen:

  • Use the addRemark method to open the "Add Remark" screen manually.
import { addRemark } from "appsonair-react-native-appremark";

// Button to navigate to Add Remark screen
<Button title="Add Remark" onPress={() => addRemark()} />;

5.2 Send Custom Payload

  • Send additional meta-data by passing extraPayload as key-value pairs.
import { addRemark } from "appsonair-react-native-appremark";

// Button to navigate to Add Remark screen
<Button title="Add Remark" onPress={() => addRemark({ key: "value" })} />;

Step 6. Run your App and Setup your app remark services

Run your app by using core editor on Android/IOS simulators or any physical device to make sure it builds correctly.

note
All submitted screenshots and feedback will be displayed on a web portal.

For more details explore the example