Documentation
Website
  • Getting Started
  • Customer Journey
    • Creating Customer Journey
    • Understanding the Journey
    • Performance Dashboard
    • Pre-built Templates
  • Channels
    • Mobile Push
    • Web Push
    • In-App Message
    • SMS/LMS
    • Webhook
  • Audience
    • Segments
    • Device Management
  • Engagement Tools
    • Dashboard
    • Message Personalization (Liquid)
    • Template
    • Sending Test Messages
    • AI Messaging
    • API Templates
    • Rate Limiting
    • Frequency Capping
    • Tracking Events
    • Inviting Members
  • Data Integration
    • User ID
    • Events
    • Tags
    • Integrating Google Tag Manager
    • Integrating Amplitude
    • Integrating Mixpanel
  • Guide for Developers
    • Mobile SDK Setup
      • Android SDK Setup
      • iOS SDK Setup
      • React Native SDK Setup
      • Flutter SDK Setup
      • Additional Setup
        • Android: FCM Setup (v1)
        • Android: Notification Icons
        • iOS: APNS Setup
        • iOS: Disable Swizzling
    • Web SDK Setup
    • REST API Reference
    • Mobile SDK Reference
    • Web SDK Reference
Powered by GitBook
On this page
  • .initialize
  • .setLogLevel
  • Subscription
  • .getIsSubscribed
  • .setIsSubscribed
  • Data Management
  • .setUserId
  • .trackEvent
  • .setTags
  • .getDeviceId
  • Notifications Handler
  • .setConvertedHandler
  • In-App Message
  • .displayInApp
  • .setInAppMessageActionHandler
  1. Guide for Developers

Web SDK Reference

.initialize

Request the notification permission and register a subscribed device.

/*
Params
- options: InitializeOptions
  - projectId
  - serviceWorkerPath
*/

FlareLane.initialize({ projectId: "<PROJECT_ID>" });

.setLogLevel

/*
Params
- logLevel: 'none' | 'error' | 'verbose'(default)
*/

FlareLane.setLogLevel('verbose');

Subscription

.getIsSubscribed

/*
Params
- callback: (Boolean) => {}
*/

FlareLane.getIsSubscribed((isSubscribed) => {
    // Do something...
    console.log(isSubscribed);
});

.setIsSubscribed

Use if you want to manage subscriptions directly within your app.

/*
Params
- isSubscribed: Boolean
- callback: (Boolean) => {}
*/

const callback = (isSubscribed) => {
    // Do something...
    console.log(isSubscribed);
};

// SUBSCRIBE
FlareLane.setIsSubscribed(true, callback);
// UNSUBSCRIBE
FlareLane.setIsSubscribed(false, callback);

Data Management

.setUserId

When logging in, specify the user ID.

/*
Params
- userId: string | null
*/

// SET
FlareLane.setUserId("USER_ID");
// REMOVE
FlareLane.setUserId(null);

.trackEvent

/*
Params
- type: string
- data?: Record<string, string | number>
*/

FlareLane.trackEvent('test_event');
// OR
FlareLane.trackEvent('test_event', { "dataKey": "dataValue" });

.setTags

/*
Params
- tags: Record<string, string | number>
*/

// SET
FlareLane.setTags({ gender: "men", age: 24 });

.getDeviceId

/*
Params
- callback: (string | null) => {}
*/

FlareLane.getDeviceId((deviceId)) => {
  // Do something...
  console.log(deviceId);
});

Notifications Handler

.setConvertedHandler

Register a callback handler to be executed when the app enters after clicking on the notification.

/*
Params
- callback: (Notification) => {}
*/

FlareLane.setConvertedHandler((notification) => {
    // Do something...
    console.log(notification);
 });

In-App Message

.displayInApp

Displays the highest priority in-app message that can be shown in the group.

FlareLane.displayInApp("home");

.setInAppMessageActionHandler

Implement a handler for custom actions in the in-app message.

FlareLane.setInAppMessageActionHandler((iam, actionId) => {
  // Do Something...
});

PreviousMobile SDK Reference

Last updated 9 months ago