플레어레인 프로젝트에 기기를 새롭게 등록합니다. requestPermissionOnLaunch을 true로 설정 시 앱 실행과 동시에 알림 권한을 요청합니다.
FlareLane.initialize('INPUT_YOUR_PROJECT_ID', true);
FlareLane.setLogLevel(Log.VERBOSE)
알림 구독 여부를 조회합니다. 권한이 없는 경우에도 false를 리턴합니다.
FlareLane.isSubscribed(this)
알림을 구독합니다. 권한이 없는 경우 먼저 권한 허용을 위한 팝업을 띄우거나 시스템 설정으로 이동시킵니다.
FlareLane.subscribe(this, true, FlareLane.IsSubscribedHandler {
})
FlareLane.unsubscribe(this, FlareLane.IsSubscribedHandler {
})
일반적으로, 회원가입/로그인 성공 시 유저ID를 연동하여 회원과 비회원을 구분합니다.
FlareLane.setUserId(this, "USER_ID")
FlareLane.setUserId(this, null)
이벤트를 트리거합니다. 기기의 유저ID가 존재하는 경우 유저 대상으로, 그 외에는 단일 기기 대상으로 반영됩니다.
FlareLane.trackEvent(this, "test_event", null)
var tags = JSONObject()
tags.put("key", "value")
FlareLane.trackEvent(this, "test_event", tags)
태그를 반영합니다. 기기의 유저ID가 존재하는 경우 유저 대상으로, 그 외에는 단일 기기 대상으로 반영됩니다.
var tags = JSONObject()
tags.put("gender", "men")
tags.put("age", 24)
tags.put("removeTag", JSONObject.NULL)
FlareLane.setTags(this, tags)
FlareLane.getDeviceId(this);
.setNotificationClickedHandler
알림 클릭 후 앱 진입 시 실행할 콜백 핸들러를 등록합니다.
FlareLane.setNotificationClickedHandler((notification) => {
});
.setNotificationForegroundReceivedHandler
포그라운드 상태에서 알림 수신 시 실행할 콜백 핸들러를 등록합니다. 알림 노출 여부도 지정할 수 있습니다.
FlareLane.setNotificationForegroundReceivedHandler { event ->
Log.d("FlareLane", event.notification.toString())
event.display()
}
특정 그룹 내 현재 기기가 보여줄 수 있는 인앱메시지를 노출합니다.
FlareLane.displayInApp("home");
.setInAppMessageActionHandler