Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.WAKE_LOCK" />

<!-- Required for Android 13+ notification permission -->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

<!-- https://developer.android.com/about/versions/14/changes/fgs-types-required -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />

<application
android:name=".MainApplication"
android:label="@string/app_name"
Expand All @@ -39,12 +45,12 @@
/>
<meta-data
android:name="com.supersami.foregroundservice.notification_channel_description"
android:value=""
android:value="Description"
/>
<service android:name="com.supersami.foregroundservice.ForegroundService"
android:foregroundServiceType="camera|microphone|mediaPlayback" />
<service android:name="com.supersami.foregroundservice.ForegroundServiceTask" />
<service android:name="com.voximplant.foregroundservice.VIForegroundService" />
<service android:name="com.supersami.foregroundservice.ForegroundServiceTask"
android:foregroundServiceType="camera|microphone|mediaPlayback" />
</application>

</manifest>
</manifest>
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@react-native-async-storage/async-storage": "^1.17.10",
"@react-navigation/native": "^6.0.8",
"@react-navigation/native-stack": "^6.5.0",
"@supersami/rn-foreground-service": "^2.1.1",
"@supersami/rn-foreground-service": "^2.2.5",
"livekit-client": "^2.9.8",
"react": "18.2.0",
"react-native": "0.74.2",
Expand Down
12 changes: 0 additions & 12 deletions example/patches/@supersami+rn-foreground-service+2.1.0.patch

This file was deleted.

1 change: 1 addition & 0 deletions example/src/RoomPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ interface RoomViewProps {
const RoomView = ({ navigation, e2ee }: RoomViewProps) => {
const [isCameraFrontFacing, setCameraFrontFacing] = useState(true);
const room = useRoomContext();

useEffect(() => {
let setup = async () => {
if (e2ee) {
Expand Down
12 changes: 11 additions & 1 deletion example/src/callservice/CallService.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,22 @@ export async function startCallService() {
importance: 'none',
vibration: false,
icon: 'ic_launcher',
// @ts-ignore
ServiceType: 'microphone',
});
}

export async function stopCallService() {
await ReactNativeForegroundService.stop();
}

export function setupCallService() {
ReactNativeForegroundService.register();
ReactNativeForegroundService.register({
config: {
alert: false,
onServiceErrorCallBack: () => {
console.error('Foreground service error occurred');
},
},
});
}
12 changes: 12 additions & 0 deletions example/src/callservice/CallService.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import RNCallKeep, {
AudioSessionCategoryOption,
AudioSessionMode,
CONSTANTS as CK_CONSTANTS,
} from 'react-native-callkeep';

import { RTCAudioSession } from '@livekit/react-native-webrtc';
Expand All @@ -14,10 +15,21 @@ export async function startCallService() {
let handle = '1234567';
let contactIdentifier = 'Caller Contact';
RNCallKeep.startCall(uuid, handle, contactIdentifier, 'number', true);

RNCallKeep.reportConnectingOutgoingCallWithUUID(uuid);

// Small delay to ensure proper state transition
setTimeout(() => {
RNCallKeep.reportConnectedOutgoingCallWithUUID(uuid);
}, 100);
}

export async function stopCallService() {
RNCallKeep.endCall(uuid);
RNCallKeep.reportEndCallWithUUID(
uuid,
CK_CONSTANTS.END_CALL_REASONS.REMOTE_ENDED
);
}

export function setupCallService() {
Expand Down
10 changes: 5 additions & 5 deletions example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2807,12 +2807,12 @@ __metadata:
languageName: node
linkType: hard

"@supersami/rn-foreground-service@npm:^2.1.1":
version: 2.1.1
resolution: "@supersami/rn-foreground-service@npm:2.1.1"
"@supersami/rn-foreground-service@npm:^2.2.5":
version: 2.2.5
resolution: "@supersami/rn-foreground-service@npm:2.2.5"
peerDependencies:
react-native: ">=0.59.0"
checksum: 733d9449e0e95566449306656a8465207bb45d6ecbc5cce9694a64779e4128677de06a5aa7a55e6cc7a929ad32de751cbf0e465ad8f663229705780cd1b7c161
checksum: a817ad18d722b977fd9e51f86af9ebae321c3533c8957ad9017562ab946ce1e6f6bbafe5b3cf5e0b4e0be01ffc0d191104b9013b892013a791b51a32c36f5210
languageName: node
linkType: hard

Expand Down Expand Up @@ -6134,7 +6134,7 @@ __metadata:
"@react-native/typescript-config": 0.74.84
"@react-navigation/native": ^6.0.8
"@react-navigation/native-stack": ^6.5.0
"@supersami/rn-foreground-service": ^2.1.1
"@supersami/rn-foreground-service": ^2.2.5
"@types/fastestsmallesttextencoderdecoder": ^1.0.0
"@types/react": ^18.2.6
babel-plugin-module-resolver: ^4.1.0
Expand Down