Skip to content

Commit

Permalink
fix incoming call for lolipop
Browse files Browse the repository at this point in the history
  • Loading branch information
aldhosutra committed Oct 31, 2022
1 parent ef21bf9 commit 9d8e055
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/service/firebase/fcm/startVideoCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,16 @@ import {
setupAndroidVideoCallHandler,
setupAndroidVideoCallHandlerWithAwait,
} from 'enevti-app/service/call/device/android';
import OverlayPermissionModule from 'rn-android-overlay-permission';
import { showNotification } from 'enevti-app/utils/notification';
import sleep from 'enevti-app/utils/dummy/sleep';
import { isOverlayPermissionGranted } from 'enevti-app/utils/permission';

export default async function startVideoCallFCMHandler(remoteMessage: FirebaseMessagingTypes.RemoteMessage) {
await runInBackground(async () => {
const payload = JSON.parse(remoteMessage.data!.payload) as StartVideoCallPayload;

if (Platform.OS === 'android') {
const overlayAvailable = await new Promise<boolean>(res => {
OverlayPermissionModule.isRequestOverlayPermissionGranted((status: any) => {
if (status) {
res(false);
} else {
res(true);
}
});
});
const overlayAvailable = await isOverlayPermissionGranted();
if (!overlayAvailable) {
await showNotification({
id: 'VCFailNoOverlay',
Expand Down

0 comments on commit 9d8e055

Please sign in to comment.