Skip to content

Commit 9e6bf5b

Browse files
authored
add user id param (#205)
1 parent 109e071 commit 9e6bf5b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

AndroidSDKCore/src/main/java/com/leanplum/Leanplum.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,6 +1106,19 @@ public static boolean hasStarted() {
11061106
return LeanplumInternal.hasStarted();
11071107
}
11081108

1109+
/**
1110+
* Returns the userId in the current Leanplum session. This should only be called after
1111+
* Leanplum.start().
1112+
*/
1113+
public static String getUserId() {
1114+
if (hasStarted()) {
1115+
return Request.userId();
1116+
} else {
1117+
Log.e("Leanplum.start() must be called before calling getUserId()");
1118+
}
1119+
return null;
1120+
}
1121+
11091122
/**
11101123
* Returns an instance to the singleton LeanplumInbox object.
11111124
*/

0 commit comments

Comments
 (0)