@stream-io/video-react-native-sdk 0.0.9 → 0.0.10

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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ### [0.0.10](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-0.0.9...@stream-io/video-react-native-sdk-0.0.10) (2023-09-11)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **react-native:** add missing expo plugin in npm pack ([bfeb79d](https://github.com/GetStream/stream-video-js/commit/bfeb79d2a540f627e8fcefbe1524cf634307ce84))
11
+
5
12
  ### [0.0.9](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-native-sdk-0.0.8...@stream-io/video-react-native-sdk-0.0.9) (2023-09-11)
6
13
 
7
14
  ### Dependency Updates
package/app.plugin.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./expo-config-plugin/dist');
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "0.0.9";
1
+ export declare const version = "0.0.10";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const version = '0.0.9';
1
+ export const version = '0.0.10';
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { ConfigPlugin } from '@expo/config-plugins';
2
+ declare const withStreamVideoReactNativeSDK: ConfigPlugin;
3
+ export default withStreamVideoReactNativeSDK;
@@ -1,18 +1,17 @@
1
- import { ConfigPlugin, withPlugins } from '@expo/config-plugins';
1
+ import { withPlugins } from '@expo/config-plugins';
2
2
  import withStreamVideoReactNativeSDKAppDelegate from './withAppDelegate';
3
3
  import withStreamVideoReactNativeSDKMainApplication from './withMainApplication';
4
4
  import withStreamVideoReactNativeSDKAndroidPermissions from './withAndroidPermissions';
5
5
  import withStreamVideoReactNativeSDKManifest from './withAndroidManifest';
6
6
  import withStreamVideoReactNativeSDKiOSInfoPList from './withiOSInfoPlist';
7
-
8
- const withStreamVideoReactNativeSDK: ConfigPlugin = (config) => {
9
- return withPlugins(config, [
10
- withStreamVideoReactNativeSDKAppDelegate,
11
- withStreamVideoReactNativeSDKMainApplication,
12
- withStreamVideoReactNativeSDKAndroidPermissions,
13
- withStreamVideoReactNativeSDKManifest,
14
- withStreamVideoReactNativeSDKiOSInfoPList,
15
- ]);
7
+ const withStreamVideoReactNativeSDK = (config) => {
8
+ return withPlugins(config, [
9
+ withStreamVideoReactNativeSDKAppDelegate,
10
+ withStreamVideoReactNativeSDKMainApplication,
11
+ withStreamVideoReactNativeSDKAndroidPermissions,
12
+ withStreamVideoReactNativeSDKManifest,
13
+ withStreamVideoReactNativeSDKiOSInfoPList,
14
+ ]);
16
15
  };
17
-
18
16
  export default withStreamVideoReactNativeSDK;
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,wCAAwC,MAAM,mBAAmB,CAAC;AACzE,OAAO,4CAA4C,MAAM,uBAAuB,CAAC;AACjF,OAAO,+CAA+C,MAAM,0BAA0B,CAAC;AACvF,OAAO,qCAAqC,MAAM,uBAAuB,CAAC;AAC1E,OAAO,yCAAyC,MAAM,oBAAoB,CAAC;AAE3E,MAAM,6BAA6B,GAAiB,CAAC,MAAM,EAAE,EAAE;IAC7D,OAAO,WAAW,CAAC,MAAM,EAAE;QACzB,wCAAwC;QACxC,4CAA4C;QAC5C,+CAA+C;QAC/C,qCAAqC;QACrC,yCAAyC;KAC1C,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,6BAA6B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { ConfigPlugin } from '@expo/config-plugins';
2
+ declare const withStreamVideoReactNativeSDKManifest: ConfigPlugin;
3
+ export default withStreamVideoReactNativeSDKManifest;
@@ -0,0 +1,38 @@
1
+ import { AndroidConfig, withAndroidManifest, } from '@expo/config-plugins';
2
+ const { prefixAndroidKeys, getMainApplicationOrThrow } = AndroidConfig.Manifest;
3
+ function getNotifeeService() {
4
+ /*
5
+ <service
6
+ android:name="app.notifee.core.ForegroundService"
7
+ android:stopWithTask="true"
8
+ android:foregroundServiceType="microphone" />
9
+ */
10
+ const head = prefixAndroidKeys({
11
+ name: 'app.notifee.core.ForegroundService',
12
+ stopWithTask: 'true',
13
+ foregroundServiceType: 'microphone',
14
+ });
15
+ return {
16
+ $: head,
17
+ };
18
+ }
19
+ const withStreamVideoReactNativeSDKManifest = (configuration) => {
20
+ return withAndroidManifest(configuration, (config) => {
21
+ try {
22
+ const androidManifest = config.modResults;
23
+ const mainApplication = getMainApplicationOrThrow(androidManifest);
24
+ let services = mainApplication.service ?? [];
25
+ // we filter out the existing notifee service (if any) so that we can override it
26
+ services = services.filter((service) => service.$['android:name'] !== 'app.notifee.core.ForegroundService');
27
+ services.push(getNotifeeService());
28
+ mainApplication.service = services;
29
+ config.modResults = androidManifest;
30
+ }
31
+ catch (error) {
32
+ throw new Error('Cannot setup StreamVideoReactNativeSDK because the AndroidManifest is malformed');
33
+ }
34
+ return config;
35
+ });
36
+ };
37
+ export default withStreamVideoReactNativeSDKManifest;
38
+ //# sourceMappingURL=withAndroidManifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withAndroidManifest.js","sourceRoot":"","sources":["../src/withAndroidManifest.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAEb,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,MAAM,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,GAAG,aAAa,CAAC,QAAQ,CAAC;AAahF,SAAS,iBAAiB;IACxB;;;;;KAKC;IACD,MAAM,IAAI,GAAG,iBAAiB,CAAC;QAC7B,IAAI,EAAE,oCAAoC;QAC1C,YAAY,EAAE,MAAM;QACpB,qBAAqB,EAAE,YAAY;KACpC,CAAC,CAAC;IACH,OAAO;QACL,CAAC,EAAE,IAAI;KACW,CAAC;AACvB,CAAC;AAED,MAAM,qCAAqC,GAAiB,CAAC,aAAa,EAAE,EAAE;IAC5E,OAAO,mBAAmB,CAAC,aAAa,EAAE,CAAC,MAAM,EAAE,EAAE;QACnD,IAAI;YACF,MAAM,eAAe,GAAG,MAAM,CAAC,UAAU,CAAC;YAC1C,MAAM,eAAe,GAAG,yBAAyB,CAAC,eAAe,CAAC,CAAC;YACnE,IAAI,QAAQ,GAAG,eAAe,CAAC,OAAO,IAAI,EAAE,CAAC;YAC7C,iFAAiF;YACjF,QAAQ,GAAG,QAAQ,CAAC,MAAM,CACxB,CAAC,OAAO,EAAE,EAAE,CACV,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,oCAAoC,CACrE,CAAC;YACF,QAAQ,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;YACnC,eAAe,CAAC,OAAO,GAAG,QAAQ,CAAC;YACnC,MAAM,CAAC,UAAU,GAAG,eAAe,CAAC;SACrC;QAAC,OAAO,KAAU,EAAE;YACnB,MAAM,IAAI,KAAK,CACb,iFAAiF,CAClF,CAAC;SACH;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,qCAAqC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { ConfigPlugin } from '@expo/config-plugins';
2
+ declare const withStreamVideoReactNativeSDKAndroidPermissions: ConfigPlugin;
3
+ export default withStreamVideoReactNativeSDKAndroidPermissions;
@@ -0,0 +1,14 @@
1
+ import { AndroidConfig } from '@expo/config-plugins';
2
+ const withStreamVideoReactNativeSDKAndroidPermissions = (config) => {
3
+ config = AndroidConfig.Permissions.withPermissions(config, [
4
+ 'android.permission.POST_NOTIFICATIONS',
5
+ 'android.permission.FOREGROUND_SERVICE',
6
+ 'android.permission.FOREGROUND_SERVICE_MICROPHONE',
7
+ 'android.permission.BLUETOOTH',
8
+ 'android.permission.BLUETOOTH_CONNECT',
9
+ 'android.permission.BLUETOOTH_ADMIN',
10
+ ]);
11
+ return config;
12
+ };
13
+ export default withStreamVideoReactNativeSDKAndroidPermissions;
14
+ //# sourceMappingURL=withAndroidPermissions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withAndroidPermissions.js","sourceRoot":"","sources":["../src/withAndroidPermissions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAgB,MAAM,sBAAsB,CAAC;AAEnE,MAAM,+CAA+C,GAAiB,CACpE,MAAM,EACN,EAAE;IACF,MAAM,GAAG,aAAa,CAAC,WAAW,CAAC,eAAe,CAAC,MAAM,EAAE;QACzD,uCAAuC;QACvC,uCAAuC;QACvC,kDAAkD;QAClD,8BAA8B;QAC9B,sCAAsC;QACtC,oCAAoC;KACrC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,eAAe,+CAA+C,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { ConfigPlugin } from '@expo/config-plugins';
2
+ declare const withStreamVideoReactNativeSDKAppDelegate: ConfigPlugin;
3
+ export default withStreamVideoReactNativeSDKAppDelegate;
@@ -0,0 +1,21 @@
1
+ import { withAppDelegate } from '@expo/config-plugins';
2
+ import { addObjcImports, insertContentsInsideObjcFunctionBlock, } from '@expo/config-plugins/build/ios/codeMod';
3
+ const withStreamVideoReactNativeSDKAppDelegate = (configuration) => {
4
+ return withAppDelegate(configuration, (config) => {
5
+ if (['objc', 'objcpp'].includes(config.modResults.language)) {
6
+ config.modResults.contents = addObjcImports(config.modResults.contents, [
7
+ '"StreamVideoReactNative.h"',
8
+ ]);
9
+ const setupMethod = '[StreamVideoReactNative setup];';
10
+ if (!config.modResults.contents.includes(setupMethod)) {
11
+ config.modResults.contents = insertContentsInsideObjcFunctionBlock(config.modResults.contents, 'application:didFinishLaunchingWithOptions:', setupMethod, { position: 'head' });
12
+ }
13
+ }
14
+ else {
15
+ throw new Error('Cannot setup StreamVideoReactNativeSDK because the AppDelegate is not Objective C');
16
+ }
17
+ return config;
18
+ });
19
+ };
20
+ export default withStreamVideoReactNativeSDKAppDelegate;
21
+ //# sourceMappingURL=withAppDelegate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withAppDelegate.js","sourceRoot":"","sources":["../src/withAppDelegate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EACL,cAAc,EACd,qCAAqC,GACtC,MAAM,wCAAwC,CAAC;AAEhD,MAAM,wCAAwC,GAAiB,CAC7D,aAAa,EACb,EAAE;IACF,OAAO,eAAe,CAAC,aAAa,EAAE,CAAC,MAAM,EAAE,EAAE;QAC/C,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;YAC3D,MAAM,CAAC,UAAU,CAAC,QAAQ,GAAG,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE;gBACtE,4BAA4B;aAC7B,CAAC,CAAC;YACH,MAAM,WAAW,GAAG,iCAAiC,CAAC;YACtD,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE;gBACrD,MAAM,CAAC,UAAU,CAAC,QAAQ,GAAG,qCAAqC,CAChE,MAAM,CAAC,UAAU,CAAC,QAAQ,EAC1B,4CAA4C,EAC5C,WAAW,EACX,EAAE,QAAQ,EAAE,MAAM,EAAE,CACrB,CAAC;aACH;SACF;aAAM;YACL,MAAM,IAAI,KAAK,CACb,mFAAmF,CACpF,CAAC;SACH;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,wCAAwC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { ConfigPlugin } from '@expo/config-plugins';
2
+ declare const withStreamVideoReactNativeSDKMainApplication: ConfigPlugin;
3
+ export default withStreamVideoReactNativeSDKMainApplication;
@@ -0,0 +1,24 @@
1
+ import { withMainApplication } from '@expo/config-plugins';
2
+ import { addImports, appendContentsInsideDeclarationBlock, } from '@expo/config-plugins/build/android/codeMod';
3
+ const withStreamVideoReactNativeSDKMainApplication = (configuration) => {
4
+ return withMainApplication(configuration, (config) => {
5
+ if (['java', 'kt'].includes(config.modResults.language)) {
6
+ try {
7
+ config.modResults.contents = addImports(config.modResults.contents, ['com.streamvideo.reactnative.StreamVideoReactNative'], config.modResults.language === 'java');
8
+ const statementToInsert = 'StreamVideoReactNative.setup();\n';
9
+ if (!config.modResults.contents.includes(statementToInsert)) {
10
+ config.modResults.contents = appendContentsInsideDeclarationBlock(config.modResults.contents, 'onCreate', statementToInsert);
11
+ }
12
+ }
13
+ catch (error) {
14
+ throw new Error("Cannot add StreamVideoReactNativeSDK to the project's MainApplication because it's malformed.");
15
+ }
16
+ }
17
+ else {
18
+ throw new Error('Cannot setup StreamVideoReactNativeSDK because the MainApplication is not in Java/Kotlin');
19
+ }
20
+ return config;
21
+ });
22
+ };
23
+ export default withStreamVideoReactNativeSDKMainApplication;
24
+ //# sourceMappingURL=withMainApplication.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withMainApplication.js","sourceRoot":"","sources":["../src/withMainApplication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EACL,UAAU,EACV,oCAAoC,GACrC,MAAM,4CAA4C,CAAC;AAEpD,MAAM,4CAA4C,GAAiB,CACjE,aAAa,EACb,EAAE;IACF,OAAO,mBAAmB,CAAC,aAAa,EAAE,CAAC,MAAM,EAAE,EAAE;QACnD,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;YACvD,IAAI;gBACF,MAAM,CAAC,UAAU,CAAC,QAAQ,GAAG,UAAU,CACrC,MAAM,CAAC,UAAU,CAAC,QAAQ,EAC1B,CAAC,oDAAoD,CAAC,EACtD,MAAM,CAAC,UAAU,CAAC,QAAQ,KAAK,MAAM,CACtC,CAAC;gBACF,MAAM,iBAAiB,GAAG,mCAAmC,CAAC;gBAC9D,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE;oBAC3D,MAAM,CAAC,UAAU,CAAC,QAAQ,GAAG,oCAAoC,CAC/D,MAAM,CAAC,UAAU,CAAC,QAAQ,EAC1B,UAAU,EACV,iBAAiB,CAClB,CAAC;iBACH;aACF;YAAC,OAAO,KAAU,EAAE;gBACnB,MAAM,IAAI,KAAK,CACb,+FAA+F,CAChG,CAAC;aACH;SACF;aAAM;YACL,MAAM,IAAI,KAAK,CACb,0FAA0F,CAC3F,CAAC;SACH;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,4CAA4C,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { ConfigPlugin } from '@expo/config-plugins';
2
+ declare const withStreamVideoReactNativeSDKiOSInfoPList: ConfigPlugin;
3
+ export default withStreamVideoReactNativeSDKiOSInfoPList;
@@ -0,0 +1,14 @@
1
+ import { withInfoPlist } from '@expo/config-plugins';
2
+ const withStreamVideoReactNativeSDKiOSInfoPList = (configuration) => {
3
+ return withInfoPlist(configuration, (config) => {
4
+ if (!Array.isArray(config.modResults.UIBackgroundModes)) {
5
+ config.modResults.UIBackgroundModes = [];
6
+ }
7
+ if (!config.modResults.UIBackgroundModes.includes('audio')) {
8
+ config.modResults.UIBackgroundModes.push('audio');
9
+ }
10
+ return config;
11
+ });
12
+ };
13
+ export default withStreamVideoReactNativeSDKiOSInfoPList;
14
+ //# sourceMappingURL=withiOSInfoPlist.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withiOSInfoPlist.js","sourceRoot":"","sources":["../src/withiOSInfoPlist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAEnE,MAAM,yCAAyC,GAAiB,CAC9D,aAAa,EACb,EAAE;IACF,OAAO,aAAa,CAAC,aAAa,EAAE,CAAC,MAAM,EAAE,EAAE;QAC7C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE;YACvD,MAAM,CAAC,UAAU,CAAC,iBAAiB,GAAG,EAAE,CAAC;SAC1C;QACD,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,iBAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;YAC1D,MAAM,CAAC,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SACnD;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,yCAAyC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-react-native-sdk",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "packageManager": "yarn@3.2.4",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -10,9 +10,9 @@
10
10
  "license": "See license in LICENSE",
11
11
  "scripts": {
12
12
  "postinstall": "yarn copy-version",
13
- "clean": "rimraf dist",
13
+ "clean": "rimraf dist && rimraf expo-config-plugin/dist",
14
14
  "start": "yarn copy-version && tsc --project tsconfig.json --watch",
15
- "build:expo-plugin": "rimraf plugin/build && tsc --build expo-config-plugin",
15
+ "build:expo-plugin": "rimraf plugin/dist && tsc --project expo-config-plugin/tsconfig.json",
16
16
  "build": "yarn clean && yarn copy-version && tsc --project tsconfig.json && yarn build:expo-plugin",
17
17
  "test:expo-plugin": "jest expo-config-plugin --coverage",
18
18
  "test": "jest --coverage && yarn test:expo-plugin",
@@ -27,9 +27,11 @@
27
27
  "index.ts",
28
28
  "stream-video-react-native.podspec",
29
29
  "package.json",
30
- "README.md",
31
- "LICENSE",
32
- "CHANGELOG.md",
30
+ "app.plugin.js",
31
+ "expo-config-plugin/README.md",
32
+ "expo-config-plugin/dist/*",
33
+ "!expo-config-plugin/src/*",
34
+ "!expo-config-plugin/fixtures/*",
33
35
  "!ios/build",
34
36
  "!android/build",
35
37
  "!android/gradle",
@@ -1,15 +0,0 @@
1
- import path from 'path';
2
- import fs from 'fs';
3
-
4
- export function getFixture(
5
- name: 'AppDelegate.mm' | 'MainApplication.java' | 'AndroidManifest.xml',
6
- ): string {
7
- const filepath = path.join(__dirname, name);
8
- return fs.readFileSync(filepath, 'utf8');
9
- }
10
-
11
- export function getFixturePath(
12
- name: 'AppDelegate.mm' | 'MainApplication.java' | 'AndroidManifest.xml',
13
- ): string {
14
- return path.join(__dirname, name);
15
- }