-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHandler.js
More file actions
28 lines (24 loc) · 831 Bytes
/
Handler.js
File metadata and controls
28 lines (24 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* eslint-disable semi */
/* eslint-disable prettier/prettier */
/* eslint-disable no-unused-vars */
import CallDetectorManager from 'react-native-call-detection'
import { NativeModules } from 'react-native';
module.exports = async (taskData) => {
console.log("RUNNNINGG0-------------------------------------");
NativeModules.CallHandler.endCall();
const callDetector = new CallDetectorManager((event, number) => {
if (event === 'Incoming') {
NativeModules.CallHandler.show('Haris is blocked ', 500);
}
else if (event === 'Offhook') {
console.log('numnber', number)
}
},
true,
(e) => { console.log('test', e) },
{
title: 'Phone State Permission',
message: 'This appp needs access to your phone state in order to react and/or to adapt to incoming calls.'
}
)
};