@fishjam-cloud/react-native-client 0.18.0 → 0.19.0
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/README.md +1 -1
- package/android/src/main/java/io/fishjam/reactnative/RNFishjamClientModule.kt +40 -0
- package/build/RNFishjamClientModule.d.ts +6 -1
- package/build/RNFishjamClientModule.d.ts.map +1 -1
- package/build/RNFishjamClientModule.js.map +1 -1
- package/build/components/FishjamRoom/index.d.ts +6 -0
- package/build/components/FishjamRoom/index.d.ts.map +1 -1
- package/build/components/FishjamRoom/index.js +6 -0
- package/build/components/FishjamRoom/index.js.map +1 -1
- package/build/components/LivestreamView.d.ts +46 -1
- package/build/components/LivestreamView.d.ts.map +1 -1
- package/build/components/LivestreamView.js +8 -1
- package/build/components/LivestreamView.js.map +1 -1
- package/build/components/VideoPreviewView.d.ts +1 -1
- package/build/components/VideoPreviewView.js +1 -0
- package/build/components/VideoPreviewView.js.map +1 -1
- package/build/components/VideoRendererView.d.ts +2 -2
- package/build/components/VideoRendererView.js +3 -2
- package/build/components/VideoRendererView.js.map +1 -1
- package/build/debug/stats/useRTCStatistics.js.map +1 -1
- package/build/hooks/useCamera.d.ts +5 -5
- package/build/hooks/useCamera.js.map +1 -1
- package/build/hooks/usePeers.js.map +1 -1
- package/build/hooks/usePermissions.d.ts +24 -0
- package/build/hooks/usePermissions.d.ts.map +1 -0
- package/build/hooks/usePermissions.js +61 -0
- package/build/hooks/usePermissions.js.map +1 -0
- package/build/hooks/useScreenShare.d.ts +1 -1
- package/build/hooks/useScreenShare.js.map +1 -1
- package/build/index.d.ts +2 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -0
- package/build/index.js.map +1 -1
- package/build/utils/errorListener.d.ts.map +1 -1
- package/build/utils/errorListener.js +1 -1
- package/build/utils/errorListener.js.map +1 -1
- package/ios/CameraPermissionsRequester.swift +117 -0
- package/ios/RNFishjamClientModule.swift +168 -119
- package/package.json +21 -15
- package/plugin/build/types.d.ts +2 -0
- package/plugin/build/withFishjamAndroid.js +16 -4
- package/plugin/build/withFishjamIos.js +58 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fishjam-cloud/react-native-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "A React Native client for Fishjam",
|
|
5
5
|
"author": "Fishjam Team",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "EXPO_NONINTERACTIVE=1 sh -c 'expo-module build && expo-module build plugin'",
|
|
11
11
|
"clean": "expo-module clean",
|
|
12
|
-
"lint": "
|
|
13
|
-
"lint:
|
|
12
|
+
"lint": "eslint . --ext .ts,.tsx",
|
|
13
|
+
"lint:fix": "yarn lint --fix",
|
|
14
14
|
"test": "expo-module test",
|
|
15
15
|
"prepare": "expo-module prepare",
|
|
16
16
|
"prepublishOnly": "expo-module prepublishOnly",
|
|
@@ -42,27 +42,33 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"promise-fs": "^2.1.1",
|
|
44
44
|
"protobufjs": "^7.4.0",
|
|
45
|
-
"react-native-whip-whep": "0.2.
|
|
46
|
-
"zod": "^3.
|
|
45
|
+
"react-native-whip-whep": "0.2.3",
|
|
46
|
+
"zod": "^3.25.71"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@testing-library/dom": "^10.4.0",
|
|
50
|
-
"@testing-library/react": "^16.0
|
|
51
|
-
"@types/lodash": "^4.17.
|
|
50
|
+
"@testing-library/react": "^16.3.0",
|
|
51
|
+
"@types/lodash": "^4.17.20",
|
|
52
52
|
"@types/promise-fs": "^2.1.2",
|
|
53
|
-
"@types/react": "
|
|
54
|
-
"
|
|
53
|
+
"@types/react": "~19.0.10",
|
|
54
|
+
"@types/react-dom": "^19",
|
|
55
|
+
"eslint": "^9.29.0",
|
|
56
|
+
"eslint-config-expo": "~9.2.0",
|
|
57
|
+
"eslint-config-prettier": "^10.1.5",
|
|
58
|
+
"eslint-plugin-prettier": "^5.5.1",
|
|
59
|
+
"expo-module-scripts": "^4.1.9",
|
|
55
60
|
"husky": "^9.1.7",
|
|
56
61
|
"jest": "^29.6.1",
|
|
57
62
|
"jest-environment-jsdom": "^29.6.1",
|
|
58
|
-
"jest-expo": "~
|
|
63
|
+
"jest-expo": "~53.0.9",
|
|
59
64
|
"jest-websocket-mock": "^2.4.0",
|
|
60
|
-
"pod-install": "^0.3.
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
65
|
+
"pod-install": "^0.3.9",
|
|
66
|
+
"prettier": "^3.6.2",
|
|
67
|
+
"react-dom": "19.0.0",
|
|
68
|
+
"ts-proto": "^2.7.5",
|
|
69
|
+
"typedoc": "^0.28.7",
|
|
64
70
|
"typedoc-plugin-mark-react-functional-components": "^0.2.2",
|
|
65
|
-
"typescript": "
|
|
71
|
+
"typescript": "~5.8.3"
|
|
66
72
|
},
|
|
67
73
|
"peerDependencies": {
|
|
68
74
|
"expo": "*",
|
package/plugin/build/types.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export type FishjamPluginOptions = {
|
|
2
2
|
android?: {
|
|
3
3
|
enableForegroundService?: boolean;
|
|
4
|
+
supportsPictureInPicture?: boolean;
|
|
4
5
|
};
|
|
5
6
|
ios?: {
|
|
6
7
|
iphoneDeploymentTarget?: string;
|
|
7
8
|
enableScreensharing?: boolean;
|
|
9
|
+
supportsPictureInPicture?: boolean;
|
|
8
10
|
};
|
|
9
11
|
} | undefined;
|
|
@@ -3,7 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.withFishjamAndroid = void 0;
|
|
4
4
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
5
5
|
const Manifest_1 = require("@expo/config-plugins/build/android/Manifest");
|
|
6
|
-
const withFishjamForegroundService = (config) => (0, config_plugins_1.withAndroidManifest)(config, async (configuration) => {
|
|
6
|
+
const withFishjamForegroundService = (config, props) => (0, config_plugins_1.withAndroidManifest)(config, async (configuration) => {
|
|
7
|
+
if (!props?.android?.enableForegroundService) {
|
|
8
|
+
return configuration;
|
|
9
|
+
}
|
|
7
10
|
const mainApplication = (0, Manifest_1.getMainApplicationOrThrow)(configuration.modResults);
|
|
8
11
|
mainApplication.service = mainApplication.service || [];
|
|
9
12
|
const newService = {
|
|
@@ -22,10 +25,19 @@ const withFishjamForegroundService = (config) => (0, config_plugins_1.withAndroi
|
|
|
22
25
|
}
|
|
23
26
|
return configuration;
|
|
24
27
|
});
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
const withFishjamPictureInPicture = (config, props) => (0, config_plugins_1.withAndroidManifest)(config, (configuration) => {
|
|
29
|
+
const activity = config_plugins_1.AndroidConfig.Manifest.getMainActivityOrThrow(configuration.modResults);
|
|
30
|
+
if (props?.android?.supportsPictureInPicture) {
|
|
31
|
+
activity.$['android:supportsPictureInPicture'] = 'true';
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
delete activity.$['android:supportsPictureInPicture'];
|
|
28
35
|
}
|
|
36
|
+
return configuration;
|
|
37
|
+
});
|
|
38
|
+
const withFishjamAndroid = (config, props) => {
|
|
39
|
+
config = withFishjamForegroundService(config, props);
|
|
40
|
+
config = withFishjamPictureInPicture(config, props);
|
|
29
41
|
return config;
|
|
30
42
|
};
|
|
31
43
|
exports.withFishjamAndroid = withFishjamAndroid;
|
|
@@ -88,18 +88,54 @@ async function updatePodfile(iosPath) {
|
|
|
88
88
|
*/
|
|
89
89
|
const withAppGroupPermissions = (config) => {
|
|
90
90
|
const APP_GROUP_KEY = 'com.apple.security.application-groups';
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
91
|
+
const bundleIdentifier = config.ios?.bundleIdentifier || '';
|
|
92
|
+
const groupIdentifier = `group.${bundleIdentifier}`;
|
|
93
|
+
config.ios ??= {};
|
|
94
|
+
config.ios.entitlements ??= {};
|
|
95
|
+
config.ios.entitlements[APP_GROUP_KEY] ??= [];
|
|
96
|
+
const entitlementsArray = config.ios.entitlements[APP_GROUP_KEY];
|
|
97
|
+
if (!entitlementsArray.includes(groupIdentifier)) {
|
|
98
|
+
entitlementsArray.push(groupIdentifier);
|
|
99
|
+
}
|
|
100
|
+
config = (0, config_plugins_1.withEntitlementsPlist)(config, (newConfig) => {
|
|
101
|
+
const modResultsArray = newConfig.modResults[APP_GROUP_KEY] || [];
|
|
102
|
+
if (!modResultsArray.includes(groupIdentifier)) {
|
|
103
|
+
modResultsArray.push(groupIdentifier);
|
|
99
104
|
}
|
|
100
|
-
modResultsArray
|
|
105
|
+
newConfig.modResults[APP_GROUP_KEY] = modResultsArray;
|
|
101
106
|
return newConfig;
|
|
102
107
|
});
|
|
108
|
+
config = (0, config_plugins_1.withXcodeProject)(config, (props) => {
|
|
109
|
+
const xcodeProject = props.modResults;
|
|
110
|
+
const targets = xcodeProject.getFirstTarget();
|
|
111
|
+
const project = xcodeProject.getFirstProject();
|
|
112
|
+
if (!targets || !project) {
|
|
113
|
+
return props;
|
|
114
|
+
}
|
|
115
|
+
const targetUuid = targets.uuid;
|
|
116
|
+
const projectUuid = project.uuid;
|
|
117
|
+
const projectObj = xcodeProject.hash.project.objects.PBXProject[projectUuid];
|
|
118
|
+
projectObj.attributes ??= {};
|
|
119
|
+
projectObj.attributes.TargetAttributes ??= {};
|
|
120
|
+
projectObj.attributes.TargetAttributes[targetUuid] ??= {};
|
|
121
|
+
projectObj.attributes.TargetAttributes[targetUuid].SystemCapabilities ??=
|
|
122
|
+
{};
|
|
123
|
+
projectObj.attributes.TargetAttributes[targetUuid].SystemCapabilities['com.apple.ApplicationGroups.iOS'] = {
|
|
124
|
+
enabled: 1,
|
|
125
|
+
};
|
|
126
|
+
const entitlementsFilePath = `${props.modRequest.projectName}/${props.modRequest.projectName}.entitlements`;
|
|
127
|
+
const configurations = xcodeProject.pbxXCBuildConfigurationSection();
|
|
128
|
+
Object.keys(configurations).forEach((key) => {
|
|
129
|
+
const config = configurations[key];
|
|
130
|
+
if (config.buildSettings?.PRODUCT_NAME?.includes(props.modRequest.projectName)) {
|
|
131
|
+
if (!config.buildSettings.CODE_SIGN_ENTITLEMENTS) {
|
|
132
|
+
config.buildSettings.CODE_SIGN_ENTITLEMENTS = entitlementsFilePath;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
return props;
|
|
137
|
+
});
|
|
138
|
+
return config;
|
|
103
139
|
};
|
|
104
140
|
/**
|
|
105
141
|
* Adds constants to Info.plist
|
|
@@ -208,21 +244,30 @@ const withFishjamSBE = (config, options) => (0, config_plugins_1.withXcodeProjec
|
|
|
208
244
|
});
|
|
209
245
|
return props;
|
|
210
246
|
});
|
|
247
|
+
const withFishjamPictureInPicture = (config, props) => (0, config_plugins_1.withInfoPlist)(config, (configuration) => {
|
|
248
|
+
if (props?.ios?.supportsPictureInPicture) {
|
|
249
|
+
const backgroundModes = new Set(configuration.modResults.UIBackgroundModes ?? []);
|
|
250
|
+
backgroundModes.add('audio');
|
|
251
|
+
configuration.modResults.UIBackgroundModes = Array.from(backgroundModes);
|
|
252
|
+
}
|
|
253
|
+
return configuration;
|
|
254
|
+
});
|
|
211
255
|
/**
|
|
212
256
|
* Applies screen sharing plugin if enabled. In order for screensharing to work, we need to copy extension files to your iOS project.
|
|
213
257
|
* Allows for dynamically changing deploymentTarget.
|
|
214
258
|
*/
|
|
215
259
|
const withFishjamIos = (config, props) => {
|
|
216
260
|
if (props?.ios?.enableScreensharing) {
|
|
217
|
-
withAppGroupPermissions(config);
|
|
218
|
-
withInfoPlistConstants(config);
|
|
219
|
-
withFishjamSBE(config, props);
|
|
261
|
+
config = withAppGroupPermissions(config);
|
|
262
|
+
config = withInfoPlistConstants(config);
|
|
263
|
+
config = withFishjamSBE(config, props);
|
|
220
264
|
}
|
|
221
|
-
(0, config_plugins_1.withPodfileProperties)(config, (configuration) => {
|
|
265
|
+
config = (0, config_plugins_1.withPodfileProperties)(config, (configuration) => {
|
|
222
266
|
configuration.modResults['ios.deploymentTarget'] =
|
|
223
267
|
props?.ios?.iphoneDeploymentTarget ?? IPHONEOS_DEPLOYMENT_TARGET;
|
|
224
268
|
return configuration;
|
|
225
269
|
});
|
|
270
|
+
config = withFishjamPictureInPicture(config, props);
|
|
226
271
|
return config;
|
|
227
272
|
};
|
|
228
273
|
exports.default = withFishjamIos;
|