Roku (Brighscript)
리포지토리에 연결
GitHub
앱스플라이어의 Roku SDK 연동
앱스플라이어는 크로스 플랫폼 어트리뷰션, 모바일 및 웹 분석, 딥링킹, 사기 탐지, 개인 정보 관리 및 보존 등을 포함하여 실제 문제를 해결하는 강력한 도구를 제공하여 게임 마케터가 더 나은 결정을 내릴 수 있도록 지원합니다.
게임 어트리뷰션을 위해서는 게임이 HTTPS를 통해 앱스플라이어 API와 통신하고 첫 번째 열기, 연속 세션 및 인앱이벤트와 같은 사용자 활동을 리포트해야 합니다. 예를 들어 구매 이벤트입니다.
앱스플라이어를 Roku 채널에 연동하기 위한 참고 자료로 이 샘플 앱을 사용하는 것이 좋습니다
AppsFlyerRokuSDK - 인터페이스
AppsFlyerRokuSDK.brs
는 source/appsflyer-integration-files
폴더에 있으며 앱스플라이어 서버에 연결하고 이벤트를 리포트하는 데 필요한 코드 및 논리가 포함되어 있습니다.
Start
이 메서드는 API 키와 앱 ID를 수신하고 앱스플라이어에 first open 및 session 요청을 보내는 앱스플라이어 모듈을 초기화합니다.
Method signature
AppsFlyer().start(<< DEV_KEY >>, << APP_ID >>)
Usage:
' Initialize the AppsFlyer integration (send first-open/session event)
AppsFlyer().start(<< DEV_KEY >>, << APP_ID >>)
Arguments:
LogEvent
이 메서드는 이벤트 이름과 JSON 객체를 수신하고 앱스플라이어에 인앱이벤트를 보냅니다.
Method signature
AppsFlyer().logEvent(eventName, trackEventValues)
Usage:
trackEventValues = CreateObject("roAssociativeArray")
trackEventValues = {"af_revenue": 24.22, "af_currency":"ILS", "freeHandParam": "freeHandValue"}
AppsFlyer().logEvent("af_purchase", trackEventValues)
샘플 앱 실행
- 이
appsflyer-sample-app
폴더(VSCode 안)를 엽니다. - In
source/main.brs
에서 다음 파라미터를 자신의 것으로 교체합니다:
devkey = << DEV_KEY >>
appid = << APP_ID >>
-
채널을 배포합니다. (이 플러그인을 사용하면 더 쉬워집니다)
-
앱이 로드된 후:
Roku 채널에서 앱스플라이어 구현하기
Setup
- 이
appsflyer-integration-files
폴더의 파일을 프로젝트로 복사합니다. - 다음 코드를
main.brs
파일에 추가하고 앱스플이어 연동을 초기화합니다:
Function Main(args as Dynamic) as Void
...
showAppsflyerChannelSGScreen(args)
...
End Function
sub showAppsflyerChannelSGScreen(args as Dynamic)
screen = CreateObject("roSGScreen")
m.port = CreateObject("roMessagePort")
screen.setMessagePort(m.port)
scene = screen.CreateScene("AppsFlyerScene")
screen.show()
' Initialize the AppsFlyer integration (send first-open/session event)
AppsFlyer().start(DEV_KEY, APP_ID)
' Enable debugging if necessary
AppsFlyer().enableDebugLogs(true) ' same as AppsFlyer().setLogLevel("debug")
if args.Lookup("contentId") <> invalid then
AppsFlyer().trackDeeplink(args)
else
AppsFlyer().trackAppLaunch()
endif
' ConversionData response arrives here
while true
msg = Wait(0, m.port)
?"MESSAGE RECEIVED: "msg.GetData()
msgType = Type(msg)
if msgType = "roSGScreenEvent"
if msg.isScreenClosed() then
return
end if
end if
end while
end sub
- 인앱 이벤트를 리포트합니다.
최신 데이터 3개월 전