Documentation
Ask or search…
K
Links

Mobile SDK Reference

.initialize

Request the notification permission and register a subscribed device.
Swift
Objective-C
Kotlin
Java
Dart(Flutter)
JS(RN)
/*
Params
- launchOptions: [UIApplication.LaunchOptionsKey : Any]?
- projectId: String
*/
FlareLane.initWithLaunchOptions(launchOptions, projectId: "INPUT_YOUR_PROJECT_ID")
/*
Params
- launchOptions:(NSDictionary<UIApplicationLaunchOptionsKey,id> * _Nullable)
- projectId:(NSString * _Nonnull)
*/
[FlareLane initWithLaunchOptions:launchOptions projectId:@"INPUT_YOUR_PROJECT_ID"];
/*
Params
- Context context
- String projectId
*/
FlareLane.initWithContext(this, "INPUT_YOUR_PROJECT_ID")
/*
Params
- Context context
- String projectId
*/
FlareLane.initWithContext(this, "INPUT_YOUR_PROJECT_ID");
/*
Params
- String projectId
*/
FlareLane.shared.initialize("INPUT_YOUR_PROJECT_ID");
/*
Params
- projectId: string
*/
FlareLane.initialize('INPUT_YOUR_PROJECT_ID');

.setLogLevel

Swift
Objective-C
Kotlin
Java
Dart(Flutter)
JS(RN)
/*
Params
- LogLevel level
- .verbose
- .error
*/
FlareLane.setLogLevel(level: .verbose)
/*
Params
- LogLevel level
- LogLevelVerbose
- LogLevelError
*/
[FlareLane setLogLevelWithLevel:LogLevelVerbose];
/*
Params
- int logLevel
- Log.VERBOSE
- Log.ERROR
*/
FlareLane.setLogLevel(Log.VERBOSE)
/*
Params
- int logLevel
- Log.VERBOSE
- Log.ERROR
*/
FlareLane.setLogLevel(Log.VERBOSE);
/*
Params
- LogLevel logLevel
- LogLevel.verbose
- LogLevel.error
*/
FlareLane.shared.setLogLevel(LogLevel.verbose);
/*
Params
- logLevel: LogLevel
- 'verbose'
- 'error'
*/
FlareLane.setLogLevel('verbose');

Subscription

.isSubscribed()

Swift
Objective-C
Kotlin
Java
Dart(Flutter)
JS(RN)
/*
iOS SDK >= 1.4.0
Params
- completion: @escaping (Bool) -> Void
*/
FlareLane.isSubscribed { isSubscribed in
// Do Something...
}
/*
iOS SDK >= 1.4.0
Params
- (void (^)(_Bool)) completion
*/
[FlareLane isSubscribedWithCompletion: ^(BOOL isSubscribed) {
// Do Something...
}];
/*
Android SDK >= 1.4.0
Params
- Context context
Return
- boolean isSubscribed
*/
FlareLane.isSubscribed(this)
/*
Android SDK >= 1.4.0
Params
- Context context
Return
- boolean isSubscribed
*/
FlareLane.isSubscribed(this);
/*
Flutter SDK >= 1.4.0
Return
- Future<bool> isSubscribed
Return
- boolean isSubscribed
*/
await FlareLane.shared.isSubscribed();
/*
React Native SDK >= 1.4.0
Params
- callback: (isSubscribed: boolean) => void
*/
FlareLane.isSubscribed((isSubscribed) => {
// Do Something...
});

.subscribe()

Swift
Objective-C
Kotlin
Java
Dart(Flutter)
JS(RN)
/*
iOS SDK >= 1.4.0
Params
- fallbackToSettings: Bool - 알림 권한 띄울 수 없을 때 알림 설정으로 이동
- completion: ((Bool) -> Void)?
*/
FlareLane.subscribe(fallbackToSettings: true) { isSubscribed in
// Do Something...
}
/*
iOS SDK >= 1.4.0
Params
- (BOOL) fallbackToSettings - 알림 권한 띄울 수 없을 때 알림 설정으로 이동
- (void (^)(_Bool)) completion
*/
[FlareLane subscribeWithFallbackToSettings:YES completion:^(BOOL isSubscribed) {
// Do Something...
}];
/*
Android SDK >= 1.4.0
Params
- Context context
- boolean fallbackToSettings - 알림 권한 띄울 수 없을 때 알림 설정으로 이동
- @Nullable IsSubscribedHandler
*/
FlareLane.subscribe(this, true, FlareLane.IsSubscribedHandler {
// Do Something...
})
/*
Android SDK >= 1.4.0
Params
- Context context
- boolean fallbackToSettings - 알림 권한 띄울 수 없을 때 알림 설정으로 이동
- @Nullable IsSubscribedHandler
*/
FlareLane.subscribe(this, true, new FlareLane.IsSubscribedHandler() {
@Override
public void onSuccess(boolean isSubscribed) {
// Do Something...
}
});
/*
Flutter SDK >= 1.4.0
Params
- bool? fallbackToSettings - 알림 권한 띄울 수 없을 때 알림 설정으로 이동
- void Function(bool)? callback
*/
await FlareLane.shared.subscribe(true, (isSubscribed) {
// Do Something...
});
/*
React Native SDK >= 1.4.0
Params
- fallbackToSettings: boolean - 알림 권한 띄울 수 없을 때 알림 설정으로 이동
- callback?: (isSubscribed: boolean) => void
*/
FlareLane.subscribe(true, (isSubscribed) => {
// Do Something...
});

.unsubscribe()

Swift
Objective-C
Kotlin
Java
Dart(Flutter)
JS(RN)
/*
iOS SDK >= 1.4.0
Params
- completion: ((Bool) -> Void)? = nil
*/
FlareLane.unsubscribe() { isSubscribed in
// Do Something...
}
/*
iOS SDK >= 1.4.0
Params
- (void (^)(_Bool)) completion
*/
[FlareLane unsubscribeWithCompletion:^(BOOL isSubscribed) {
// Do Something...
}];
/*
Android SDK >= 1.4.0
Params
- Context context
- @Nullable IsSubscribedHandler
*/
FlareLane.unsubscribe(this, FlareLane.IsSubscribedHandler {
// Do Something...
})
/*
Android SDK >= 1.4.0
Params
- Context context
- @Nullable IsSubscribedHandler
*/
FlareLane.unsubscribe(this, new FlareLane.IsSubscribedHandler() {
@Override
public void onSuccess(boolean isSubscribed) {
// Do Something...
}
});
/*
Flutter SDK >= 1.4.0
Params
- void Function(bool)? callback
*/
await FlareLane.shared.unsubscribe((isSubscribed) {
// Do Something...
});
/*
React Native SDK >= 1.4.0
Params
- callback?: (isSubscribed: boolean) => void
*/
FlareLane.unsubscribe((isSubscribed) => {
// Do Something...
});

Data Management

.setUserID

When logging in, specify the user ID.
Swift
Objective-C
Kotlin
Java
Dart(Flutter)
JS(RN)
/*
Params
- userId: String?
*/
// SET
FlareLane.setUserId(userId: "[email protected]")
// REMOVE
FlareLane.setUserId(this, nil)
/*
Params
- userId:(NSString * _Nullable)
*/
// SET
[FlareLane setUserIdWithUserId: @"[email protected]"];
// REMOVE
[FlareLane setUserIdWithUserId: nil];
/*
Params
- Context context
- @Nullable String userId
*/
// SET
FlareLane.setUserId(this, "[email protected]")
// REMOVE
FlareLane.setUserId(this, null)
/*
Params
- Context context
- @Nullable String userId
*/
// SET
FlareLane.setUserId(this, "[email protected]");
// REMOVE
FlareLane.setUserId(this, null);
/*
Params
- String? userId
*/
// SET
FlareLane.shared.setUserId("[email protected]");
// REMOVE
FlareLane.shared.setUserId(null);
/*
Params
- userId: string | null
*/
// SET
FlareLane.setUserId("[email protected]");
// REMOVE
FlareLane.setUserId(null);

.trackEvent

Swift
Objective-C
Kotlin
Java
Dart(Flutter)
JS(RN)
/*
Params
- type: String
- data: [String: Any]?
*/
FlareLane.trackEvent("test_event")
// OR
FlareLane.trackEvent("test_event", data: ["test":"value"])
/*
Params
- type: NSString
- data: NSDictionary *Nullable
*/
[FlareLane trackEvent:@"test_event" data:nil];
// OR
[FlareLane trackEvent:@"test_event" data:@{ @"key": @"value" }];
/*
Params
- Context context
- String type
- @Nullable JSONObject data
*/
FlareLane.trackEvent(this, "test_event", null)
// OR
var tags = JSONObject()
tags.put("key", "value")
FlareLane.trackEvent(this, "test_event", tags)
/*
Params
- Context context
- String type
- @Nullable JSONObject data
*/
FlareLane.trackEvent(this, "test_event", null)
// OR
JSONObject tags = new JSONObject();
tags.put("key", "value")
FlareLane.trackEvent(this, "test_event", tags)
/*
Params
- type: String
- data: Map<String, Object>?
*/
FlareLane.shared.trackEvent("test_event");
// OR
FlareLane.shared.trackEvent("test_event", {"key": "value"});
/*
Params
- type: string
- data?: Record<string, string | number>
*/
FlareLane.trackEvent('test_event');
// OR
FlareLane.trackEvent("test_event", {"key": "value"});

.setTags

Swift
Objective-C
Kotlin
Java
Dart(Flutter)
JS(RN)
/*
Params
- tags: [String : Any]
*/
FlareLane.setTags(tags: ["gender": "men", "age": 24])
/*
Params
- tags:(NSDictionary<NSString *,id> * _Nonnull)
*/
[FlareLane setTagsWithTags:@{@"gender": @"men", @"age": @24}];
/*
Params
- Context context
- JSONObject tags
*/
var tags = JSONObject()
tags.put("gender", "men")
tags.put("age", 24)
FlareLane.setTags(this, tags)
/*
Params
- Context context
- JSONObject tags
*/
try {
JSONObject tags = new JSONObject();
tags.put("gender", "men");
tags.put("age", 24);
FlareLane.setTags(this, tags);
} catch (JSONException e) {
e.printStackTrace();
}
/*
Params
- Map<String, Object> tags
*/
FlareLane.shared.setTags({
"gender": "men",
"age": 24
});
/*
Params
- tags: Record<string, any>
*/
FlareLane.setTags({ gender: 'men', age: 27 });

.getDeviceId

Swift
Objective-C
Kotlin
Java
Dart(Flutter)
JS(RN)
FlareLane.getDeviceId()
[FlareLane getDeviceId];
/*
Params
- Context context
*/
FlareLane.getDeviceId(this);
/*
Params
- Context context
*/
FlareLane.getDeviceId(this);
await FlareLane.shared.getDeviceId())
await FlareLane.getDeviceId()

Notifications Handler

.setNotificationClickedHandler

Register a callback handler to be executed when the app enters after clicking on the notification.
Swift
Objective-C
Kotlin
Java
Dart(Flutter)
JS(RN)
/*
Params
- callback: (FlareLaneNotification) -> Void
- FlareLaneNotification
- id: String
- body: String
- title: String?
- url: String?
- imageUrl: String?
*/
FlareLane.setNotificationClickedHandler() { notification in
// Do Something...
}
/*
Params
- callback: (FlareLaneNotification) -> Void
- FlareLaneNotification
- id: String
- body: String
- title: String?
- url: String?
- imageUrl: String?
*/
[FlareLane setNotificationClickedHandlerWithCallback:^(FlareLaneNotification* _Nonnull notification) {
// Do something..
}];
/*
Params
- public interface setNotificationClickedHandler
- onClicked(Notification notification)
- Notification
- @NonNull String id
- @Nullable String title
- @NonNull String body
- @Nullable String url
- @Nullable String imageUrl
*/
FlareLane.setNotificationClickedHandler(NotificationClickedHandler { notification ->
// Do Something...
})
/*
Params
- public interface NotificationClickedHandler
- onClicked(Notification notification)
- Notification
- @NonNull String id
- @Nullable String title
- @NonNull String body
- @Nullable String url
- @Nullable String imageUrl
*/
FlareLane.setNotificationClickedHandler(new NotificationClickedHandler() {
@Override
public void onConverted(Notification notification) {
// Do Something...
}
});
/*
Params
- NotificationClickedHandler handler = void Function(FlareLaneNotification notification);
- FlareLaneNotification
- String id
- String? title
- String body
- String? url
- String? imageUrl
*/
FlareLane.shared.setNotificationClickedHandler((notification) {
// Do Something...
});
/*
Params
- callback: (notification: Notification) => void
- Notification
- id: string;
- title?: string;
- body: string;
- url?: string;
*/
FlareLane.setNotificationClickedHandler((notification) => {
// Do Something...
});

.setNotificationForegroundReceivedHandler

Register a callback handler to be executed when the app enters after clicking on the notification.
Swift
Objective-C
Kotlin
Java
Dart(Flutter)
JS(RN)
/*
SDK Version >= 1.5.0
Params
- callback: (FlareLaneNotificationReceivedEvent) -> Void
- FlareLaneNotificationReceivedEvent
- notification: FlareLaneNotification
- display()
*/
FlareLane.setNotificationForegroundReceivedHandler { event in
print(event.notification)
// You can display or not
event.display()
}
/*
SDK Version >= 1.5.0
Params
- callback: (FlareLaneNotificationReceivedEvent) -> Void
- FlareLaneNotificationReceivedEvent
- notification: FlareLaneNotification
- display()
*/
[FlareLane setNotificationForegroundReceivedHandlerWithCallback:^(FlareLaneNotificationReceivedEvent * _Nonnull event) {
NSLog([event.notification description]);
// You can display or not
[event display];
}];
/*
SDK Version >= 1.5.0
Params
- public interface NotificationForegroundReceivedHandler
- onWillDisplay(NotificationReceivedEvent event);
- NotificationReceivedEvent
- Notification getNotification()
- void display()
*/
FlareLane.setNotificationForegroundReceivedHandler { event ->
Log.d("FlareLane", event.notification.toString())
// You can display or not
event.display()
}
/*
SDK Version >= 1.5.0
Params
- public interface NotificationForegroundReceivedHandler
- onWillDisplay(NotificationReceivedEvent event);
- NotificationReceivedEvent
- Notification getNotification()
- void display()
*/
FlareLane.setNotificationForegroundReceivedHandler((new NotificationForegroundReceivedHandler() {
@Override
public void onWillDisplay(NotificationReceivedEvent event) {
Log.d("FlareLane", event.getNotification().toString());
// You can display or not
event.display();
}
}));
/*
SDK Version >= 1.5.0
Params
- NotificationForegroundReceivedHandler handler = void Function(FlareLaneNotificationReceivedEvent event);
- FlareLaneNotificationReceivedEvent
- FlareLaneNotification notification
- display()
*/
FlareLane.shared.setNotificationForegroundReceivedHandler((event) {
print(event.notification);
// You can display or not
event.display();
});
/*
SDK Version >= 1.5.0
Params
- callback: (event: NotificationReceivedEvent) => void
- NotificationReceivedEvent
- notification: Notification
- display()
*/
FlareLane.setNotificationForegroundReceivedHandler((event) => {
console.log(event.notification);
// You can display or not
event.display();
});