Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added customer ID #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions defappsflyer/src/DefAppsFlyer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ static int setIsDebug(lua_State* L)
return 0;
}

static int setCustomerId(lua_State* L)
{
DM_LUA_STACK_CHECK(L, 0);
const char *customerId = luaL_checkstring(L, 1);
DefAppsFlyer_setCustomerId(customerId);
return 0;
}

static int trackEvent(lua_State* L)
{
DM_LUA_STACK_CHECK(L, 0);
Expand Down Expand Up @@ -64,6 +72,7 @@ static int trackEvent(lua_State* L)

static const luaL_reg Module_methods[] =
{
{"setCustomerId", setCustomerId},
{"setIsDebug", setIsDebug},
{"trackEvent", trackEvent},
{0, 0}
Expand Down
2 changes: 2 additions & 0 deletions defappsflyer/src/DefAppsFlyer.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ struct TrackData

extern void DefAppsFlyer_setAppsFlyerKey(const char*appsFlyerKey);
extern void DefAppsFlyer_setAppID(const char*appleAppID);
extern void DefAppsFlyer_setCustomerId(const char*customerId);

extern void DefAppsFlyer_setIsDebug(bool is_debug);
extern void DefAppsFlyer_trackAppLaunch();
extern void DefAppsFlyer_trackEvent(const char*eventName, dmArray<TrackData>* trackData);
6 changes: 6 additions & 0 deletions defappsflyer/src/DefAppsFlyerIOS.mm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ void DefAppsFlyer_setAppID(const char*appleAppID)
[AppsFlyerTracker sharedTracker].appleAppID = [NSString stringWithUTF8String:appleAppID];
}

void DefAppsFlyer_setCustomerId(const char*customerId)
{
[AppsFlyerTracker sharedTracker].customerUserID = [NSString stringWithUTF8String:customerId];
}


void DefAppsFlyer_setIsDebug(bool is_debug)
{
[AppsFlyerTracker sharedTracker].isDebug = is_debug;
Expand Down
4 changes: 4 additions & 0 deletions defappsflyer/src/java/DefAppsFlyer.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ public static void DefAppsFlyer_setIsDebug(boolean debugMode) {
AppsFlyerLib.getInstance().setDebugLog(debugMode);
}

public static void DefAppsFlyer_setCustomerId(String customerId) {
AppsFlyerLib.getInstance().setCustomerUserId(customerId);
}

public static void DefAppsFlyer_trackEvent(Activity appActivity, String eventName, Map<String, Object> eventValue) {
AppsFlyerLib.getInstance().logEvent(appActivity, eventName, eventValue);
}
Expand Down