Skip to content

Commit

Permalink
Resolved QA reported issues (#1414)
Browse files Browse the repository at this point in the history
# 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.

<!-- Links -->

[Documentation]: https://www.100ms.live/docs
  • Loading branch information
ygit authored Jul 31, 2024
1 parent 376c1f9 commit 3f9e460
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 36 deletions.
5 changes: 2 additions & 3 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ lint:
disabled:
- osv-scanner
enabled:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected].198
- [email protected].213
- [email protected]
- [email protected].1
- [email protected].3
- [email protected]
- [email protected]
- [email protected]
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-hms/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<a href="https://100ms.live/">
<img src="https://raw.githubusercontent.com/100mslive/react-native-hms/main/100ms.svg" title="100ms logo" float=center height=256>
<img src="https://raw.githubusercontent.com/100mslive/react-native-hms/main/100ms.svg" title="100ms logo" float=center height=256 alt="100ms logo">
</a>

[![npm](https://img.shields.io/npm/v/@100mslive/react-native-hms)](https://www.npmjs.com/package/@100mslive/react-native-hms)
Expand Down
21 changes: 14 additions & 7 deletions packages/react-native-hms/src/classes/HMSSDK.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<HMSSDK>} A promise that resolves to an instance of HMSSDK.
Expand Down Expand Up @@ -151,7 +151,7 @@ export class HMSSDK {
*/
static async build(params?: {
trackSettings?: HMSTrackSettings;
haltPreviewJoinForPermissionsRequest?: boolean;
haltPreviewJoinForPermissionsRequestOnAndroid?: boolean;
appGroup?: String;
preferredExtension?: String;
logSettings?: HMSLogSettings;
Expand All @@ -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: {
Expand Down Expand Up @@ -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 });
};

/**
Expand Down
10 changes: 5 additions & 5 deletions packages/react-native-room-kit/example/android/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -60,15 +60,15 @@ 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)
faraday-retry (1.0.3)
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

Expand Down
8 changes: 4 additions & 4 deletions packages/react-native-room-kit/example/ios/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.4.78</string>
<string>2.4.79</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>528</string>
<string>529</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>
Expand Down
4 changes: 2 additions & 2 deletions packages/react-native-room-kit/src/HMSInstanceSetup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down Expand Up @@ -141,7 +141,7 @@ const getHmsInstance = async (
const hmsInstance = await HMSSDK.build({
logSettings,
trackSettings,
haltPreviewJoinForPermissionsRequest: true,
haltPreviewJoinForPermissionsRequestOnAndroid: true,
appGroup,
preferredExtension,
isPrebuilt: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-room-kit/src/HMSRoomSetup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 2 additions & 3 deletions packages/react-native-room-kit/src/components/Modals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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';

Expand Down Expand Up @@ -110,7 +109,7 @@ export const ChangeRoleModal = ({ cancelModal }: { cancelModal: Function }) => {
<TouchableOpacity
style={styles.participantChangeRoleContainer}
onPress={showMenu}
disabled={validRoles?.length <= 1}
disabled={validRoles && validRoles?.length <= 1}
>
<Text style={styles.participantFilterText} numberOfLines={1}>
{newRole?.name}
Expand Down
4 changes: 2 additions & 2 deletions packages/react-native-room-kit/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down

0 comments on commit 3f9e460

Please sign in to comment.