Skip to content

Commit

Permalink
Added Android 14 support specififying namespace in SDK (#1452)
Browse files Browse the repository at this point in the history
# Description

- Added Android 14 support specififying namespace in SDK

### 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 Oct 17, 2024
1 parent 69ebee6 commit 9cc5a28
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 74 deletions.
1 change: 1 addition & 0 deletions packages/react-native-hms/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def safeExtGet(prop, fallback) {
}

android {
namespace 'com.reactnativehmssdk'
compileSdkVersion safeExtGet('Hmssdk_compileSdkVersion', 31)
defaultConfig {
minSdkVersion safeExtGet('Hmssdk_minSdkVersion', 21)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
Board: https://app.devrev.ai/100ms/vistas/vista-254

- Support for long-running sessions
https://app.devrev.ai/100ms/works/ISS-23133
- SugarFit: Add support for Android 14 on React Native Android SDK
https://app.devrev.ai/100ms/works/ISS-23560

- Remove Foreground Notification Service from Android app
https://app.devrev.ai/100ms/works/ISS-23562

- Native Android crash fixes
https://app.devrev.ai/100ms/works/ISS-23550

Room Kit: 1.2.3
React Native SDK: 1.11.0
Android SDK: 2.9.68
iOS SDK: 1.16.3
iOS SDK: 1.16.4
4 changes: 2 additions & 2 deletions packages/react-native-room-kit/example/android/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GEM
artifactory (3.0.17)
atomos (0.1.3)
aws-eventstream (1.3.0)
aws-partitions (1.989.0)
aws-partitions (1.991.0)
aws-sdk-core (3.209.1)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
Expand All @@ -19,7 +19,7 @@ GEM
aws-sdk-kms (1.94.0)
aws-sdk-core (~> 3, >= 3.207.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.167.0)
aws-sdk-s3 (1.168.0)
aws-sdk-core (~> 3, >= 3.207.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
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 537
versionName "2.4.87"
versionCode 538
versionName "2.4.88"
missingDimensionStrategy 'react-native-camera', 'general'
}

Expand Down
4 changes: 2 additions & 2 deletions packages/react-native-room-kit/example/ios/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GEM
artifactory (3.0.17)
atomos (0.1.3)
aws-eventstream (1.3.0)
aws-partitions (1.989.0)
aws-partitions (1.991.0)
aws-sdk-core (3.209.1)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
Expand All @@ -19,7 +19,7 @@ GEM
aws-sdk-kms (1.94.0)
aws-sdk-core (~> 3, >= 3.207.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.167.0)
aws-sdk-s3 (1.168.0)
aws-sdk-core (~> 3, >= 3.207.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
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 = 537;
CURRENT_PROJECT_VERSION = 538;
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 = 537;
CURRENT_PROJECT_VERSION = 538;
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 = 537;
CURRENT_PROJECT_VERSION = 538;
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 = 537;
CURRENT_PROJECT_VERSION = 538;
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.87</string>
<string>2.4.88</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>537</string>
<string>538</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>
Expand Down
9 changes: 0 additions & 9 deletions packages/react-native-room-kit/example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/react-native-room-kit/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"@react-navigation/native": "6.1.7",
"@react-navigation/native-stack": "6.5.0",
"@shopify/flash-list": "^1.4.3",
"@voximplant/react-native-foreground-service": "github:ygit/react-native-foreground-service",
"lottie-react-native": "^6.7.2",
"react": "18.2.0",
"react-native": "0.71.19",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useCallback, useEffect, useMemo } from 'react';
import { Platform, Text } from 'react-native';
import React, { useCallback, useMemo } from 'react';
import { Text } from 'react-native';
import {
NavigationProp,
RouteProp,
Expand All @@ -15,8 +15,6 @@ import type {

import { AppStackParamList } from '../../navigator';

import VIForegroundService from '@voximplant/react-native-foreground-service';

export const HMSPrebuiltScreen = () => {
const navigation = useNavigation<NavigationProp<AppStackParamList>>();
const screenParams =
Expand All @@ -36,9 +34,6 @@ export const HMSPrebuiltScreen = () => {
*/
const handleMeetingLeave: OnLeaveHandler = useCallback(async (reason) => {
console.log(':: reason > ', reason); // Logs the reason for leaving the meeting.
if (Platform.OS === 'android') {
await VIForegroundService.getInstance().stopService(); // Stops the foreground service on Android.
}
navigation.navigate('QRCodeScreen'); // Navigates to the QRCodeScreen.
}, []);

Expand Down Expand Up @@ -75,48 +70,6 @@ export const HMSPrebuiltScreen = () => {
[screenParams] // Recomputes the memoized value when screenParams changes.
);

useEffect(() => {
// Checks if the platform is Android before attempting to start the foreground service.
// This is necessary because the foreground service functionality is specific to Android.
if (Platform.OS === 'android') {
// Defines an asynchronous function to start the Android foreground service.
const startAndroidForegroundService = async () => {
// Configuration for the Android notification channel.
// This is required for Android O and above to show notifications.
const androidForegroundServiceChannelConfig = {
id: 'MyAppChannelID', // Unique ID for the notification channel.
name: 'My App Channel name', // Name for the notification channel.
enableVibration: true, // Enables vibration for notifications from this channel.
importance: 5, // Sets the importance level for notifications from this channel.
};
// Creates the notification channel with the specified configuration.
await VIForegroundService.getInstance().createNotificationChannel(
androidForegroundServiceChannelConfig
);

// Configuration for the notification that will be shown while the service is running.
const notificationConfig = {
channelId: 'MyAppChannelID', // Associates the notification with the created channel ID.
id: 1000, // Unique ID for the notification.
title: 'Foreground Service', // Title for the notification.
text: 'Starting Android Foreground Service now', // Text content for the notification.
icon: '../assets/100ms-logo.png', // Icon for the notification.
priority: 2, // Priority for the notification.
};
// Attempts to start the foreground service with the specified notification configuration.
try {
VIForegroundService.getInstance().startService(notificationConfig);
} catch (e) {
// Logs an error if starting the foreground service fails.
console.error(e);
}
};

// Calls the function to start the Android foreground service.
startAndroidForegroundService();
}
}, []); // The empty dependency array ensures this effect runs only once after the initial render.

// Room Code is required to join the room
if (!roomCode) {
return <Text>Room Code is Required</Text>;
Expand Down

0 comments on commit 9cc5a28

Please sign in to comment.