Skip to content

Commit 0e66f3e

Browse files
authored
makeKey Add restriction for : (#37)
1 parent 29f7629 commit 0e66f3e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/main/java/com/segment/analytics/android/integrations/firebase/FirebaseIntegration.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ private static void putValue(Bundle bundle, String key, Object value) {
258258
}
259259

260260
public static String makeKey(String key) {
261-
String[] forbiddenChars = {".", "-", " "};
261+
String[] forbiddenChars = {".", "-", " ", ":"};
262262
for (String forbidden : forbiddenChars) {
263263
if (key.contains(forbidden)) {
264264
key = key.trim().replace(forbidden, "_");

src/test/java/com/segment/analytics/android/integration/firebase/FirebaseTest.java

+6
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,12 @@ public void makeKeyWithDashAndDot() {
220220
verify(firebase).logEvent(eq("test_event_dashed_and_dotted"), bundleEq(new Bundle()));
221221
}
222222

223+
@Test
224+
public void makeKeyWithColon() {
225+
integration.track(new TrackPayload.Builder().anonymousId("12345").event("test:colon").build());
226+
verify(firebase).logEvent(eq("test_colon"), bundleEq(new Bundle()));
227+
}
228+
223229
/**
224230
* Uses the string representation of the object. Useful for JSON objects.
225231
* @param expected Expected object

0 commit comments

Comments
 (0)