Links

React Native SDK Setup

1. Requirements

Can be used with other push solutions!

Starting from FlareLane SDK version 1.1.0, FlareLane can be used with other push solutions.
To use FlareLane with other push solutions, you must follow some additional steps. Refer to iOS: Disable Swizzling for details.

2. Install the SDK

$ yarn add @flarelane/react-native-sdk

3. Support for Android 13

To ensure a smooth process for obtaining permission for push notifications from users, please make sure that both conditions below are satisfied.
  • Using FlareLane SDK 1.2.0 or higher
  • Set compileSdkVersion to at least 33
app/build.gradle
android {
compileSdkVersion 33
...
defaultConfig {
...
targetSdkVersion 33
}
}

4. Configure for iOS

  1. 1.
    Enter cd ios in Terminal to go to the ios directory
  2. 2.
    At the top of the Podfile, enter platform :ios, '11.0' or higher than version 11
  3. 3.
    Run pod install in the terminal
  4. 4.
    Run the Xcode project by opening the <YOUR_PROJECT_NAME>.xcworkspace
  5. 5.
    Enter 11.0 or higher as Deployment Target of the PROJECT
  6. 6.
    Enter 11.0 or higher as Deployment Info of the TARGET
  7. 7.
    Go to Signing & Capabilities and click + Capability and add Push Notifications

5. Add Initialization Code

Add the following code to index.js. You can check your project ID at FlareLane console's Project.
index.js
import FlareLane from '@flarelane/react-native-sdk';
// Add the code below
FlareLane.initialize('INPUT_YOUR_PROJECT_ID');
AppRegistry.registerComponent(appName, () => App);

6. Test

After completing all the steps, build and run your app. Devices that subscribe to push notifications will be automatically added to FlareLane console's All Devices.
Before actual deployment, be sure to verify that the push notifications are being received properly on the device and that the statistics are accurately recorded when the push notifications are clicked.

7. Additional Setup

Customizing notification icons

Attaching an image to push notifications