Skip to content

Commit 953f83e

Browse files
committed
ios: add audio notification and fix audio routing.
see comments in updateAudioRoute()
1 parent 82a3e70 commit 953f83e

File tree

2 files changed

+305
-33
lines changed

2 files changed

+305
-33
lines changed

index.js

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict';
22
var _InCallManager = require('react-native').NativeModules.InCallManager;
3+
import { Platform } from 'react-native';
34

45
class InCallManager {
56
constructor() {
@@ -65,15 +66,27 @@ class InCallManager {
6566
}
6667

6768
async checkRecordPermission() {
68-
let result = await _InCallManager.checkRecordPermission();
69-
this.recordPermission = result;
70-
return result;
69+
if (Platform.OS === 'android') {
70+
console.log('react-native-incall-manager: android does not support checkRecordPermission() yet.');
71+
this.recordPermission = 'unknow';
72+
return 'unknow';
73+
} else {
74+
let result = await _InCallManager.checkRecordPermission();
75+
this.recordPermission = result;
76+
return result;
77+
}
7178
}
7279

7380
async requestRecordPermission() {
74-
let result = await _InCallManager.requestRecordPermission();
75-
this.recordPermission = result;
76-
return result;
81+
if (Platform.OS === 'android') {
82+
console.log('react-native-incall-manager: android does not support requestRecordPermission() yet.');
83+
this.recordPermission = 'unknow';
84+
return 'unknow';
85+
} else {
86+
let result = await _InCallManager.requestRecordPermission();
87+
this.recordPermission = result;
88+
return result;
89+
}
7790
}
7891
}
7992

0 commit comments

Comments
 (0)