Skip to content

Commit 64b34f0

Browse files
committed
Adds in validation for file names with the file extension.
1 parent 0b19f7c commit 64b34f0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

iterableapi/src/main/java/com/iterable/iterableapi/IterableNotification.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ public static IterableNotification createNotification(Context context, Bundle ex
6767
.setContentText(notificationBody);
6868

6969
if (soundName != null) {
70+
//Removes the file type from the name
71+
String[] soundFile = soundName.split("\\.");
72+
soundName = soundFile[0];
73+
7074
int soundID = context.getResources().getIdentifier(soundName, "raw", context.getPackageName());
7175
Uri soundUri = Uri.parse("android.resource://" + context.getPackageName() + "/" + soundID);
7276
notificationBuilder.setSound(soundUri);

0 commit comments

Comments
 (0)