Skip to content

Commit 4f514de

Browse files
committed
Adding back the delay to call urlHandler
Sometimes not waiting can lead to urlHandler misses. Hence this delay is needed
1 parent d7e9183 commit 4f514de

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

android/src/main/java/com/iterable/reactnative/RNIterableAPIModule.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package com.iterable.reactnative;
22

3+
import android.content.Context;
4+
import android.content.Intent;
5+
import android.content.pm.PackageManager;
36
import android.net.Uri;
47
import android.os.Bundle;
58

ts/Iterable.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,14 @@ class Iterable {
455455
const url = dict["url"]
456456
const context = IterableActionContext.fromDict(dict["context"])
457457
Iterable.wakeApp()
458-
callUrlHandler(url, context)
458+
if (Platform.OS === "android") {
459+
//Give enough time for Activity to wake up.
460+
setTimeout(() => {
461+
callUrlHandler(url, context)
462+
}, 1000)
463+
} else {
464+
callUrlHandler(url, context)
465+
}
459466
}
460467
)
461468
}

0 commit comments

Comments
 (0)