개발자 가이드
Mobile SDK Reference
init 플레어레인 프로젝트에 기기를 새롭게 등록합니다 requestpermissiononlaunch을 true로 설정 시 앱 실행과 동시에 알림 권한을 요청합니다 / params \ context context \ string projectid \ boolean requestpermissiononlaunch / flarelane initwithcontext(this, "input your project id", true) java / params \ context context \ string projectid \ boolean requestpermissiononlaunch / flarelane initwithcontext(this, "input your project id", true);/ params \ launchoptions \[uiapplication launchoptionskey any]? \ projectid string \ requestpermissiononlaunch bool = true / flarelane initwithlaunchoptions(launchoptions, projectid "input your project id", true)/ params \ launchoptions (nsdictionary\<uiapplicationlaunchoptionskey,id> nullable) \ projectid (nsstring nonnull) \ requestpermissiononlaunch (bool) = yes / \[flarelane initwithlaunchoptions\ launchoptions projectid @"input your project id" requestpermissiononlaunch yes]; dart(flutter) / params \ string projectid \ bool? requestpermissiononlaunch = true / flarelane shared initialize("input your project id", requestpermissiononlaunch true); js(reactnative) / params \ projectid string \ requestpermissiononlaunch boolean = true / flarelane initialize('input your project id', true); setloglevel sdk의 로그레벨을 설정합니다 / params \ int loglevel \ log verbose \ log error / flarelane setloglevel(log verbose)/ params \ int loglevel \ log verbose \ log error / flarelane setloglevel(log verbose);/ params \ loglevel level \ verbose \ error / flarelane setloglevel(level verbose)/ params \ loglevel level \ loglevelverbose \ loglevelerror / \[flarelane setloglevelwithlevel\ loglevelverbose]; dart(flutter) / params \ loglevel loglevel \ loglevel verbose \ loglevel error / flarelane shared setloglevel(loglevel verbose); js(reactnative) / params \ loglevel loglevel \ 'verbose' \ 'error' / flarelane setloglevel('verbose'); 기기별 알림 구독 처리 issubscribed 알림 구독 여부를 조회합니다 권한이 없는 경우에도 false를 리턴합니다 / 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);/ 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 }]; dart(flutter) / flutter sdk >= 1 4 0 return \ future\<bool> issubscribed return \ boolean issubscribed / await flarelane shared issubscribed(); js(reactnative) / react native sdk >= 1 4 0 params \ callback (issubscribed boolean) => void / flarelane issubscribed((issubscribed) => { // do something }); subscribe 알림을 구독합니다 권한이 없는 경우 먼저 권한 허용을 위한 팝업을 띄우거나 시스템 설정으로 이동시킵니다 / 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 } });/ 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 }]; dart(flutter) / flutter sdk >= 1 4 0 params \ bool? fallbacktosettings 알림 권한 띄울 수 없을 때 알림 설정으로 이동 \ void function(bool)? callback / await flarelane shared subscribe(true, (issubscribed) { // do something }); js(reactnative) / react native sdk >= 1 4 0 params \ fallbacktosettings boolean 알림 권한 띄울 수 없을 때 알림 설정으로 이동 \ callback? (issubscribed boolean) => void / flarelane subscribe(true, (issubscribed) => { // do something }); unsubscribe 알림을 미구독합니다 / 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 } });/ 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 }]; dart(flutter) / flutter sdk >= 1 4 0 params \ void function(bool)? callback / await flarelane shared unsubscribe((issubscribed) { // do something }); js(reactnative) / react native sdk >= 1 4 0 params \ callback? (issubscribed boolean) => void / flarelane unsubscribe((issubscribed) => { // do something }); 고객 데이터 연동 setuserid 일반적으로, 회원가입/로그인 성공 시 유저id를 연동하여 회원과 비회원을 구분합니다 / params \ context context \ @nullable string userid / // set flarelane setuserid(this, "user id") // remove flarelane setuserid(this, null)/ params \ context context \ @nullable string userid / // set flarelane setuserid(this, "user id"); // remove flarelane setuserid(this, null);/ params \ userid string? / // set flarelane setuserid(userid "user id") // remove flarelane setuserid(this, nil)/ params \ userid (nsstring nullable) / // set \[flarelane setuseridwithuserid @"user id"]; // remove \[flarelane setuseridwithuserid nil]; dart(flutter) / params \ string? userid / // set flarelane shared setuserid("user id"); // remove flarelane shared setuserid(null); js(reactnative) / params \ userid string | null / // set flarelane setuserid("user id"); // remove flarelane setuserid(null); trackevent 이벤트 docid\ bffue91dld0f3kivt4wul 를 트리거합니다 기기의 유저id가 존재하는 경우 유저 대상으로, 그 외에는 단일 기기 대상으로 반영됩니다 / 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 \[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" }]; dart(flutter) / params \ type string \ data map\<string, object>? / flarelane shared trackevent("test event"); // or flarelane shared trackevent("test event", {"key" "value"}); js(reactnative) / params \ type string \ data? record\<string, string | number> / flarelane trackevent('test event'); // or flarelane trackevent("test event", {"key" "value"}); settags 유저프로필 & 태그 docid 0bvi3zqh7gd3f mr2nske 를 반영합니다 기기의 유저id가 존재하는 경우 유저 대상으로, 그 외에는 단일 기기 대상으로 반영됩니다 / params \ context context \ jsonobject tags / var tags = jsonobject() tags put("gender", "men") tags put("age", 24) tags put("removetag", jsonobject null) // remove flarelane settags(this, tags)/ params \ context context \ jsonobject tags / jsonobject tags = new jsonobject(); tags put("gender", "men"); tags put("age", 24); tags put("removetag", jsonobject null); // remove flarelane settags(this, tags);/ params \ tags \[string any] / flarelane settags(tags \["gender" "men", "age" 24])/ params \ tags (nsdictionary\<nsstring ,id> nonnull) / \[flarelane settagswithtags @{@"gender" @"men", @"age" @24}]; dart(flutter) / params \ map\<string, object> tags / flarelane shared settags({ "gender" "men", "age" 24 }); js(reactnative) / params \ tags record\<string, any> / flarelane settags({ gender 'men', age 27 }); getdeviceid / params \ context context / flarelane getdeviceid(this);/ params \ context context / flarelane getdeviceid(this);flarelane getdeviceid()\[flarelane getdeviceid]; dart(flutter) await flarelane shared getdeviceid()) js(reactnative) await flarelane getdeviceid() 알림 핸들러 setnotificationclickedhandler 알림 클릭 후 앱 진입 시 실행할 콜백 핸들러를 등록합니다 / 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 onclicked(notification notification) { // do something } });/ 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 }]; dart(flutter) / params \ notificationclickedhandler handler = void function(flarelanenotification notification); \ flarelanenotification \ string id \ string? title \ string body \ string? url \ string? imageurl / flarelane shared setnotificationclickedhandler((notification) { // do something }); js(reactnative) / params \ callback (notification notification) => void \ notification \ id string; \ title? string; \ body string; \ url? string; / flarelane setnotificationclickedhandler((notification) => { // do something }); setnotificationforegroundreceivedhandler 포그라운드 상태에서 알림 수신 시 실행할 콜백 핸들러를 등록합니다 알림 노출 여부도 지정할 수 있습니다 / 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()) // 알림 노출을 하시려면 아래 함수를 실행하세요 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()); // 알림 노출을 하시려면 아래 함수를 실행하세요 event display(); } }));/ sdk version >= 1 5 0 params \ callback (flarelanenotificationreceivedevent) > void \ flarelanenotificationreceivedevent \ notification flarelanenotification \ display() / flarelane setnotificationforegroundreceivedhandler { event in print(event notification) // 알림 노출을 하시려면 아래 함수를 실행하세요 event display() }/ sdk version >= 1 5 0 params \ callback (flarelanenotificationreceivedevent) > void \ flarelanenotificationreceivedevent \ notification flarelanenotification \ display() / \[flarelane setnotificationforegroundreceivedhandlerwithcallback ^(flarelanenotificationreceivedevent nonnull event) { nslog(\[event notification description]); // 알림 노출을 하시려면 아래 함수를 실행하세요 \[event display]; }]; dart(flutter) / sdk version >= 1 5 0 params \ notificationforegroundreceivedhandler handler = void function(flarelanenotificationreceivedevent event); \ flarelanenotificationreceivedevent \ flarelanenotification notification \ display() / flarelane shared setnotificationforegroundreceivedhandler((event) { print(event notification); // 알림 노출을 하시려면 아래 함수를 실행하세요 event display(); }); js(reactnative) / sdk version >= 1 5 0 params \ callback (event notificationreceivedevent) => void \ notificationreceivedevent \ notification notification \ display() / flarelane setnotificationforegroundreceivedhandler((event) => { console log(event notification); // 알림 노출을 하시려면 아래 함수를 실행하세요 event display(); }); 인앱메시지 displayinapp 현재 기기가 보여줄 수 있는 특정 그룹의 가장 우선순위 높은 인앱메시지를 노출합니다 / sdk version >= 1 7 0 params \ string group / flarelane displayinapp("home")/ sdk version >= 1 7 0 params \ string group / flarelane displayinapp("home");/ sdk version >= 1 7 0 params \ group string / flarelane displayinapp("home")/ sdk version >= 1 7 0 params \ group string / \[flarelane displayinapp @"home"]; dart(flutter) / sdk version >= 1 7 0 params \ string group / flarelane shared displayinapp("home"); js(reactnative) / sdk version >= 1 7 0 params \ group string / flarelane displayinapp("home"); setinappmessageactionhandler 인앱메시지 커스텀 액션을 수행하는 경우 이를 처리할 핸들러를 직접 정의합니다 / sdk version >= 1 7 0 params \ public interface inappmessageactionhandler \ onexecute(inappmessage iam, string actionid) / flarelane setinappmessageactionhandler(object inappmessageactionhandler { override fun onexecute(iam inappmessage, actionid string) { // do something } })/ sdk version >= 1 7 0 params \ public interface inappmessageactionhandler \ onexecute(inappmessage iam, string actionid) / flarelane setinappmessageactionhandler(new inappmessageactionhandler() { @override public void onexecute(@nonnull inappmessage iam, @nonnull string actionid) { // do something } });/ sdk version >= 1 7 0 params \ callback (flarelaneinappmessage, actionid string) > void / flarelane setinappmessageactionhandler { iam, actionid in // do something }/ sdk version >= 1 7 0 params \ callback (flarelaneinappmessage, actionid string) > void / flarelane setinappmessageactionhandlerwithcallback ^(flarelaneinappmessage nonnull iam, nsstring nonnull actionid) { // do something } dart(flutter) / sdk version >= 1 7 0 params \ void function(inappmessage iam, string actionid) / flarelane shared setinappmessageactionhandler((iam, actionid) { // do something }); js(reactnative) / sdk version >= 1 7 0 params \ (iam inappmessage, actionid string) => void; / flarelane setinappmessageactionhandler((iam, actionid) => { // do something });