Skip to content

Commit a159046

Browse files
author
Quoc Khanh
committed
fix dismiss func
1 parent 49aeff2 commit a159046

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

android/src/main/java/com/incomingcall/IncomingCallModule.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,13 @@ public void display(String uuid, String name, String avatar, String info) {
5858

5959
@ReactMethod
6060
public void dismiss() {
61-
final Activity activity = reactContext.getCurrentActivity();
61+
// final Activity activity = reactContext.getCurrentActivity();
6262

63-
assert activity != null;
63+
// assert activity != null;
64+
65+
UnlockScreenActivity.onDestroy();
66+
67+
return;
6468
}
6569

6670
private Context getAppContext() {

example/App.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ export function handleRemoteMessage(remoteMessage, isHeadless) {
8989
});
9090
}
9191
// Could also persist data here for later uses
92+
} else if (remoteMessage?.notification?.title === 'Missed call') {
93+
console.log('dismiss goes here');
94+
IncomingCall.dismiss();
9295
}
9396
}
9497

0 commit comments

Comments
 (0)