@ringg/react-native 0.0.1-alpha.2 → 0.0.1-alpha.4
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/app.plugin.js +25 -12
- package/package.json +4 -2
package/app.plugin.js
CHANGED
|
@@ -1,36 +1,49 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Expo config plugin for @ringg/react-native.
|
|
3
3
|
*
|
|
4
|
-
* Automatically configures the native project for voice calls
|
|
5
|
-
* -
|
|
6
|
-
* - Audio
|
|
4
|
+
* Automatically configures the native project for voice calls:
|
|
5
|
+
* - Microphone permission (iOS + Android)
|
|
6
|
+
* - Audio background mode (iOS) — keeps calls alive when backgrounded
|
|
7
|
+
* - WebRTC build settings (bitcode disabled, network permissions)
|
|
8
|
+
* - LiveKit native lifecycle (auto-linked via expo-module.config.json)
|
|
7
9
|
*
|
|
8
10
|
* Usage in app.json:
|
|
9
11
|
* { "plugins": ["@ringg/react-native"] }
|
|
10
12
|
*
|
|
11
13
|
* Or with options:
|
|
12
|
-
* { "plugins": [["@ringg/react-native", { "enableCamera":
|
|
14
|
+
* { "plugins": [["@ringg/react-native", { "enableCamera": true }]] }
|
|
13
15
|
*/
|
|
14
16
|
|
|
15
|
-
const { createRunOncePlugin,
|
|
17
|
+
const { createRunOncePlugin, withInfoPlist } = require("expo/config-plugins");
|
|
16
18
|
const pkg = require("./package.json");
|
|
17
19
|
|
|
18
20
|
/**
|
|
19
21
|
* @param {import('expo/config-plugins').ExpoConfig} config
|
|
20
|
-
* @param {{ enableCamera?: boolean }} [props]
|
|
22
|
+
* @param {{ enableCamera?: boolean, microphonePermission?: string }} [props]
|
|
21
23
|
*/
|
|
22
24
|
function withRingg(config, props = {}) {
|
|
23
|
-
const { enableCamera = false } = props;
|
|
25
|
+
const { enableCamera = false, microphonePermission } = props;
|
|
24
26
|
|
|
25
|
-
// WebRTC native setup: permissions, bitcode,
|
|
26
|
-
const
|
|
27
|
+
// 1. WebRTC native setup: permissions, bitcode, Android manifest
|
|
28
|
+
const webrtcPlugin = require("@config-plugins/react-native-webrtc");
|
|
29
|
+
const withWebRTC = webrtcPlugin.default || webrtcPlugin;
|
|
27
30
|
config = withWebRTC(config, {
|
|
28
31
|
cameraPermission: enableCamera ? "This app uses the camera for video calls." : false,
|
|
32
|
+
microphonePermission: microphonePermission || "This app uses the microphone for voice calls with the AI agent.",
|
|
29
33
|
});
|
|
30
34
|
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
// 2. iOS background audio — keeps voice calls alive when app is backgrounded
|
|
36
|
+
config = withInfoPlist(config, (cfg) => {
|
|
37
|
+
const modes = cfg.modResults.UIBackgroundModes || [];
|
|
38
|
+
if (!modes.includes("audio")) {
|
|
39
|
+
cfg.modResults.UIBackgroundModes = [...modes, "audio"];
|
|
40
|
+
}
|
|
41
|
+
return cfg;
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// LiveKit native lifecycle (iOS AppDelegate subscriber, Android audio config)
|
|
45
|
+
// is auto-linked by Expo via @livekit/react-native-expo-plugin's
|
|
46
|
+
// expo-module.config.json — no manual plugin call needed.
|
|
34
47
|
|
|
35
48
|
return config;
|
|
36
49
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ringg/react-native",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Ringg AI widget for React Native — drop-in component and headless hooks for voice/text AI agents",
|
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
"types": "./lib/typescript/index.d.ts",
|
|
29
29
|
"default": "./lib/module/index.js"
|
|
30
30
|
},
|
|
31
|
+
"./app.plugin.js": "./app.plugin.js",
|
|
32
|
+
"./app.plugin": "./app.plugin.js",
|
|
31
33
|
"./package.json": "./package.json"
|
|
32
34
|
},
|
|
33
35
|
"files": [
|
|
@@ -46,7 +48,7 @@
|
|
|
46
48
|
"@config-plugins/react-native-webrtc": ">=9.0.0",
|
|
47
49
|
"livekit-client": ">=2.0.0",
|
|
48
50
|
"react-native-svg": ">=12.0.0",
|
|
49
|
-
"@ringg/core": "0.0.1-alpha.
|
|
51
|
+
"@ringg/core": "0.0.1-alpha.4"
|
|
50
52
|
},
|
|
51
53
|
"devDependencies": {
|
|
52
54
|
"@types/react": "^18.3.10",
|