rns-nativecall 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/react-native.config.js +12 -0
- package/withRaiidrVoip.js +46 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rns-nativecall",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Raiidr nativecall component with native Android/iOS for handling native call ui, when app is not open or open.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"index.d.ts",
|
|
34
34
|
"index.js",
|
|
35
35
|
"package.json",
|
|
36
|
-
"react-native.config",
|
|
36
|
+
"react-native.config.js",
|
|
37
37
|
"README.md",
|
|
38
38
|
"rns-nativecall.podspec",
|
|
39
|
-
"withRaiidrVoip"
|
|
39
|
+
"withRaiidrVoip.js"
|
|
40
40
|
],
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"react-native": "*",
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///Users/bush/Desktop/Apps/Raiidr/package/withRaiidrVoip.js
|
|
2
|
+
const { withAndroidManifest, AndroidConfig } = require('@expo/config-plugins');
|
|
3
|
+
|
|
4
|
+
function withRaiidrVoip(config) {
|
|
5
|
+
return withAndroidManifest(config, (config) => {
|
|
6
|
+
const manifest = config.modResults;
|
|
7
|
+
|
|
8
|
+
// 1. Add required permissions
|
|
9
|
+
const permissions = [
|
|
10
|
+
'android.permission.READ_PHONE_NUMBERS',
|
|
11
|
+
'android.permission.CALL_PHONE'
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
permissions.forEach((perm) => {
|
|
15
|
+
if (!manifest.manifest['uses-permission'].some((p) => p.$['android:name'] === perm)) {
|
|
16
|
+
manifest.manifest['uses-permission'].push({ $: { 'android:name': perm } });
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// 2. Add MyConnectionService service
|
|
21
|
+
const application = manifest.manifest.application[0];
|
|
22
|
+
const existingService = application.service?.find(
|
|
23
|
+
(s) => s.$['android:name'] === 'com.rnsnativecall.MyConnectionService'
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
if (!existingService) {
|
|
27
|
+
application.service = application.service || [];
|
|
28
|
+
application.service.push({
|
|
29
|
+
$: {
|
|
30
|
+
'android:name': 'com.rnsnativecall.MyConnectionService',
|
|
31
|
+
'android:permission': 'android.permission.BIND_CONNECTION_SERVICE',
|
|
32
|
+
'android:exported': 'true'
|
|
33
|
+
},
|
|
34
|
+
'intent-filter': [
|
|
35
|
+
{
|
|
36
|
+
action: [{ $: { 'android:name': 'android.telecom.ConnectionService' } }]
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return config;
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
module.exports = withRaiidrVoip;
|