Skip to content

Commit 0fe94df

Browse files
throw warning in native side
1 parent b490d5e commit 0fe94df

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

android/src/main/java/io/branch/rnbranch/RNBranchModule.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,14 @@ public static BranchEvent createBranchEvent(String eventName, ReadableMap params
773773
ReadableMapKeySetIterator it = customData.keySetIterator();
774774
while (it.hasNextKey()) {
775775
String key = it.nextKey();
776-
event.addCustomDataProperty(key, customData.getString(key));
776+
777+
ReadableType readableType = customData.getType(key);
778+
if(readableType == ReadableType.String) {
779+
event.addCustomDataProperty(key, customData.getString(key));
780+
}
781+
else{
782+
Log.w(REACT_CLASS, "customData values must be strings. Value for property " + key + " is not a string type.");
783+
}
777784
}
778785
}
779786

0 commit comments

Comments
 (0)