From 3f9e46095c940eeccef352e04e8fc1bffdb5e347 Mon Sep 17 00:00:00 2001 From: ygit Date: Wed, 31 Jul 2024 15:38:32 +0530 Subject: [PATCH] Resolved QA reported issues (#1414) # Description - Resolved QA reported issues ### Pre-launch Checklist - [x] The [Documentation] is updated accordingly, or this PR doesn't require it. - [x] I have updated the `ExampleAppChangelog.txt` file with relevant changes. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I listed at least one issue that this PR fixes in the description above. - [x] I added new tests to check the change I am making, or this PR is test-exempt. - [x] All existing and new tests are passing. [Documentation]: https://www.100ms.live/docs --- .trunk/trunk.yaml | 5 ++--- packages/react-native-hms/README.md | 2 +- .../react-native-hms/src/classes/HMSSDK.tsx | 21 ++++++++++++------- .../example/android/Gemfile.lock | 10 ++++----- .../example/android/app/build.gradle | 4 ++-- .../example/ios/Gemfile.lock | 8 +++---- .../ios/RNExample.xcodeproj/project.pbxproj | 8 +++---- .../example/ios/RNExample/Info.plist | 4 ++-- .../src/HMSInstanceSetup.tsx | 4 ++-- .../src/HMSRoomSetup.tsx | 2 +- .../src/components/Modals.tsx | 5 ++--- packages/react-native-room-kit/src/utils.ts | 4 ++-- 12 files changed, 41 insertions(+), 36 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index edde7a9f5..41e6b49f0 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -10,14 +10,13 @@ lint: disabled: - osv-scanner enabled: - - vale@3.7.0 - dotenv-linter@3.3.0 - actionlint@1.7.1 - prettier@3.3.3 - swiftlint@0.54.0 - - checkov@3.2.198 + - checkov@3.2.213 - trivy@0.53.0 - - trufflehog@3.80.1 + - trufflehog@3.80.3 - oxipng@9.1.2 - yamllint@1.35.1 - ktlint@1.3.1 diff --git a/packages/react-native-hms/README.md b/packages/react-native-hms/README.md index 98361a809..ea20f1baf 100644 --- a/packages/react-native-hms/README.md +++ b/packages/react-native-hms/README.md @@ -1,5 +1,5 @@ - +100ms logo [![npm](https://img.shields.io/npm/v/@100mslive/react-native-hms)](https://www.npmjs.com/package/@100mslive/react-native-hms) diff --git a/packages/react-native-hms/src/classes/HMSSDK.tsx b/packages/react-native-hms/src/classes/HMSSDK.tsx index cfc1ffdbc..c026e8a5e 100644 --- a/packages/react-native-hms/src/classes/HMSSDK.tsx +++ b/packages/react-native-hms/src/classes/HMSSDK.tsx @@ -123,7 +123,7 @@ export class HMSSDK { * @param {trackSettings} params.trackSettings is an optional value only required to enable features like iOS Screen/Audio Share, Android Software Echo Cancellation, etc * @param {appGroup} params.appGroup is an optional value only required for implementing Screen & Audio Share on iOS. They are not required for Android. DO NOT USE if your app does not implements Screen or Audio Share on iOS. * @param {preferredExtension} params.preferredExtension is an optional value only required for implementing Screen & Audio Share on iOS. They are not required for Android. DO NOT USE if your app does not implements Screen or Audio Share on iOS. - * @param {boolean} params.haltPreviewJoinForPermissionsRequest - Optional flag to halt the preview/join process until permissions are explicitly granted by the user. Android only. This is particularly useful when you might want to request permissions before proceeding with the preview or join operation. + * @param {boolean} params.haltPreviewJoinForPermissionsRequestOnAndroid - Optional flag to halt the preview/join process until permissions are explicitly granted by the user. Android only. This is particularly useful when you might want to request permissions before proceeding with the preview or join operation. * @param {HMSLogSettings} params.logSettings - Optional settings for logging. * * @returns {Promise} A promise that resolves to an instance of HMSSDK. @@ -151,7 +151,7 @@ export class HMSSDK { */ static async build(params?: { trackSettings?: HMSTrackSettings; - haltPreviewJoinForPermissionsRequest?: boolean; + haltPreviewJoinForPermissionsRequestOnAndroid?: boolean; appGroup?: String; preferredExtension?: String; logSettings?: HMSLogSettings; @@ -162,7 +162,7 @@ export class HMSSDK { let id = await HMSManager.build({ trackSettings: params?.trackSettings, haltPreviewJoinForPermissionsRequest: - params?.haltPreviewJoinForPermissionsRequest, // required for Android Permissions, not required for iOS + params?.haltPreviewJoinForPermissionsRequestOnAndroid, // required for Android Permissions, not required for iOS appGroup: params?.appGroup, // required for iOS Screenshare, not required for Android preferredExtension: params?.preferredExtension, // required for iOS Screenshare, not required for Android frameworkInfo: { @@ -1859,10 +1859,17 @@ export class HMSSDK { return HMSManager.setAlwaysScreenOn({ id: this.id, enabled }); }; - setPermissionsAccepted = async () => { - if (Platform.OS === 'ios') return; - logger?.verbose('#Function setPermissionsAccepted', { id: this.id }); - return HMSManager.setPermissionsAccepted({ id: this.id }); + setPermissionsAcceptedOnAndroid = async () => { + if (Platform.OS === 'ios') { + Promise.reject( + 'setPermissionsAcceptedOnAndroid API not available for iOS' + ); + return; + } + logger?.verbose('#Function setPermissionsAcceptedOnAndroid', { + id: this.id, + }); + return await HMSManager.setPermissionsAccepted({ id: this.id }); }; /** diff --git a/packages/react-native-room-kit/example/android/Gemfile.lock b/packages/react-native-room-kit/example/android/Gemfile.lock index b1849cf43..3800ce720 100644 --- a/packages/react-native-room-kit/example/android/Gemfile.lock +++ b/packages/react-native-room-kit/example/android/Gemfile.lock @@ -10,8 +10,8 @@ GEM artifactory (3.0.17) atomos (0.1.3) aws-eventstream (1.3.0) - aws-partitions (1.957.0) - aws-sdk-core (3.201.2) + aws-partitions (1.958.0) + aws-sdk-core (3.201.3) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.8) @@ -23,7 +23,7 @@ GEM aws-sdk-core (~> 3, >= 3.201.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) - aws-sigv4 (1.8.0) + aws-sigv4 (1.9.0) aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) base64 (0.2.0) @@ -60,7 +60,7 @@ GEM faraday-httpclient (1.0.1) faraday-multipart (1.0.4) multipart-post (~> 2) - faraday-net_http (1.0.1) + faraday-net_http (1.0.2) faraday-net_http_persistent (1.2.0) faraday-patron (1.0.0) faraday-rack (1.0.0) @@ -68,7 +68,7 @@ GEM faraday_middleware (1.2.0) faraday (~> 1.0) fastimage (2.3.1) - fastlane (2.221.1) + fastlane (2.222.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) diff --git a/packages/react-native-room-kit/example/android/app/build.gradle b/packages/react-native-room-kit/example/android/app/build.gradle index ee0eb347f..fed5ca9ac 100644 --- a/packages/react-native-room-kit/example/android/app/build.gradle +++ b/packages/react-native-room-kit/example/android/app/build.gradle @@ -98,8 +98,8 @@ android { applicationId "live.hms.rn" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 528 - versionName "2.4.78" + versionCode 529 + versionName "2.4.79" missingDimensionStrategy 'react-native-camera', 'general' } diff --git a/packages/react-native-room-kit/example/ios/Gemfile.lock b/packages/react-native-room-kit/example/ios/Gemfile.lock index 186feda81..b25d74627 100644 --- a/packages/react-native-room-kit/example/ios/Gemfile.lock +++ b/packages/react-native-room-kit/example/ios/Gemfile.lock @@ -10,8 +10,8 @@ GEM artifactory (3.0.17) atomos (0.1.3) aws-eventstream (1.3.0) - aws-partitions (1.957.0) - aws-sdk-core (3.201.2) + aws-partitions (1.958.0) + aws-sdk-core (3.201.3) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.8) @@ -23,7 +23,7 @@ GEM aws-sdk-core (~> 3, >= 3.201.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) - aws-sigv4 (1.8.0) + aws-sigv4 (1.9.0) aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) base64 (0.2.0) @@ -60,7 +60,7 @@ GEM faraday-httpclient (1.0.1) faraday-multipart (1.0.4) multipart-post (~> 2) - faraday-net_http (1.0.1) + faraday-net_http (1.0.2) faraday-net_http_persistent (1.2.0) faraday-patron (1.0.0) faraday-rack (1.0.0) diff --git a/packages/react-native-room-kit/example/ios/RNExample.xcodeproj/project.pbxproj b/packages/react-native-room-kit/example/ios/RNExample.xcodeproj/project.pbxproj index bf6019ec1..346fd6ea0 100644 --- a/packages/react-native-room-kit/example/ios/RNExample.xcodeproj/project.pbxproj +++ b/packages/react-native-room-kit/example/ios/RNExample.xcodeproj/project.pbxproj @@ -496,7 +496,7 @@ CODE_SIGN_ENTITLEMENTS = RNExample/RNExample.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 528; + CURRENT_PROJECT_VERSION = 529; DEVELOPMENT_TEAM = 5N85PP82A9; ENABLE_BITCODE = NO; INFOPLIST_FILE = RNExample/Info.plist; @@ -534,7 +534,7 @@ CODE_SIGN_ENTITLEMENTS = RNExample/RNExample.entitlements; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 528; + CURRENT_PROJECT_VERSION = 529; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 5N85PP82A9; INFOPLIST_FILE = RNExample/Info.plist; @@ -706,7 +706,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_ENTITLEMENTS = RNExampleBroadcastUpload/RNExampleBroadcastUpload.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 528; + CURRENT_PROJECT_VERSION = 529; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = 5N85PP82A9; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -748,7 +748,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 528; + CURRENT_PROJECT_VERSION = 529; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 5N85PP82A9; diff --git a/packages/react-native-room-kit/example/ios/RNExample/Info.plist b/packages/react-native-room-kit/example/ios/RNExample/Info.plist index 5500ba88b..f65754cec 100644 --- a/packages/react-native-room-kit/example/ios/RNExample/Info.plist +++ b/packages/react-native-room-kit/example/ios/RNExample/Info.plist @@ -21,11 +21,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 2.4.78 + 2.4.79 CFBundleSignature ???? CFBundleVersion - 528 + 529 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/packages/react-native-room-kit/src/HMSInstanceSetup.tsx b/packages/react-native-room-kit/src/HMSInstanceSetup.tsx index edba4a49f..73c37a399 100644 --- a/packages/react-native-room-kit/src/HMSInstanceSetup.tsx +++ b/packages/react-native-room-kit/src/HMSInstanceSetup.tsx @@ -75,7 +75,7 @@ const getTrackSettings = ( ? HMSTrackSettingsInitState.MUTED : HMSTrackSettingsInitState.UNMUTED, cameraFacing: HMSCameraFacing.FRONT, - disableAutoResize: !joinConfig.autoResize, + disableAutoResize: joinConfig.autoResize, forceSoftwareDecoder: joinConfig.softwareDecoder, videoPlugin: videoPlugin || undefined, }); @@ -141,7 +141,7 @@ const getHmsInstance = async ( const hmsInstance = await HMSSDK.build({ logSettings, trackSettings, - haltPreviewJoinForPermissionsRequest: true, + haltPreviewJoinForPermissionsRequestOnAndroid: true, appGroup, preferredExtension, isPrebuilt: true, diff --git a/packages/react-native-room-kit/src/HMSRoomSetup.tsx b/packages/react-native-room-kit/src/HMSRoomSetup.tsx index 1e8653c91..80851548a 100644 --- a/packages/react-native-room-kit/src/HMSRoomSetup.tsx +++ b/packages/react-native-room-kit/src/HMSRoomSetup.tsx @@ -395,7 +395,7 @@ export const HMSRoomSetup = () => { // Requests multiple permissions using the PermissionsAndroid API. await PermissionsAndroid.requestMultiple(permissions as Permission[]); // Notifies the HMS SDK that the permissions have been accepted. - await hmsInstance.setPermissionsAccepted(); + await hmsInstance.setPermissionsAcceptedOnAndroid(); }; // Adds the permissions requested listener to the HMS SDK. diff --git a/packages/react-native-room-kit/src/components/Modals.tsx b/packages/react-native-room-kit/src/components/Modals.tsx index 04cfb1834..aa4452b2e 100644 --- a/packages/react-native-room-kit/src/components/Modals.tsx +++ b/packages/react-native-room-kit/src/components/Modals.tsx @@ -10,7 +10,6 @@ import { useWindowDimensions, } from 'react-native'; import type { ImageURISource } from 'react-native'; -import Toast from 'react-native-simple-toast'; import { useDispatch, useSelector } from 'react-redux'; import { HMSTrack, @@ -44,7 +43,7 @@ import { ModalTypes, SUPPORTED_ASPECT_RATIOS } from '../utils/types'; import { COLORS } from '../utils/theme'; import type { RootState } from '../redux'; import { SwitchRow } from './SwitchRow'; -import { useHMSConferencingScreenConfig, useHMSInstance } from '../hooks-util'; +import { useHMSInstance } from '../hooks-util'; import { ChevronIcon } from '../Icons'; import { NotificationTypes } from '../types'; @@ -110,7 +109,7 @@ export const ChangeRoleModal = ({ cancelModal }: { cancelModal: Function }) => { {newRole?.name} diff --git a/packages/react-native-room-kit/src/utils.ts b/packages/react-native-room-kit/src/utils.ts index bb2813571..b29c8c426 100644 --- a/packages/react-native-room-kit/src/utils.ts +++ b/packages/react-native-room-kit/src/utils.ts @@ -4,8 +4,8 @@ const DEFAULT_JOINING_CONFIG = { mutedAudio: true, mutedVideo: true, skipPreview: false, - audioMixer: false, // IOS only - musicMode: false, // IOS only + audioMixer: false, // iOS only + musicMode: false, // iOS only softwareDecoder: true, // Android only autoResize: false, // Android only };