Skip to content

Commit

Permalink
Merge branch 'main' into codec-negotiation
Browse files Browse the repository at this point in the history
# Conflicts:
#	yarn.lock
  • Loading branch information
oliverlaz committed Jan 3, 2025
2 parents 26abd69 + 7eec9b0 commit 8862b71
Show file tree
Hide file tree
Showing 93 changed files with 1,218 additions and 6,269 deletions.
2 changes: 1 addition & 1 deletion packages/react-native-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
"expo": "50.0.19",
"expo-build-properties": "^0.12.3",
"expo-modules-core": "1.12.16",
"expo-notifications": "~0.28.18",
"expo-notifications": "~0.29.11",
"jest": "^29.7.0",
"react-native": "0.71.8",
"react-native-builder-bob": "^0.23.2",
Expand Down
12 changes: 9 additions & 3 deletions packages/react-native-sdk/src/utils/push/ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,15 @@ function processNonRingingNotificationStreamPayload(
export const oniOSExpoNotificationEvent = (event: ExpoNotification) => {
const pushConfig = StreamVideoRN.getConfig().push;
if (pushConfig) {
if (event.request.trigger.type === 'push') {
const streamPayload = event.request.trigger.payload
?.stream as StreamPushPayload;
const trigger = event.request.trigger;
if (
trigger &&
typeof trigger === 'object' &&
'type' in trigger &&
trigger.type === 'push' &&
trigger.payload?.stream
) {
const streamPayload = trigger.payload.stream as StreamPushPayload;
processNonRingingNotificationStreamPayload(streamPayload);
}
}
Expand Down
14 changes: 10 additions & 4 deletions packages/react-native-sdk/src/utils/push/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,23 @@ export function isNotifeeStreamVideoEvent(event: Event) {
}

export function isExpoNotificationStreamVideoEvent(event: ExpoNotification) {
if (event.request.trigger.type === 'push') {
const trigger = event.request.trigger;
if (
trigger &&
typeof trigger === 'object' &&
'type' in trigger &&
trigger.type === 'push'
) {
// iOS
const streamPayload = event.request.trigger.payload
?.stream as StreamPushPayload;
const streamPayload = trigger.payload?.stream as StreamPushPayload;
// Android
const remoteMessageData = event.request.trigger.remoteMessage?.data;
const remoteMessageData = trigger.remoteMessage?.data;
return (
streamPayload?.sender === 'stream.video' ||
remoteMessageData?.sender === 'stream.video'
);
}
return false;
}

export function isPushNotificationiOSStreamVideoEvent(
Expand Down
11 changes: 10 additions & 1 deletion sample-apps/react-native/expo-video-sample/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,13 @@ yarn-error.*
.env*.local

# typescript
*.tsbuildinfo
*.tsbuildinfo

# managed prebuild - https://docs.expo.dev/guides/local-app-development/#local-app-compilation
ios
android
# @generated expo-cli sync-2b81b286409207a5da26e14c78851eb30d8ccbdb
# The following patterns were generated by expo-cli

expo-env.d.ts
# @end expo-cli
2 changes: 1 addition & 1 deletion sample-apps/react-native/expo-video-sample/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ cd sample-apps/react-native/expo-video-sample

4. Run the app

You can run the app either with [EAS Build](https://docs.expo.dev/build/introduction/) or [locally on your computer](https://docs.expo.dev/develop/development-builds/development-workflows/#build-locally-with-android-studio-and-xcode).
You can run the app either with [EAS Build](https://docs.expo.dev/build/introduction/) or [locally on your computer](https://docs.expo.dev/guides/local-app-development/).
16 changes: 0 additions & 16 deletions sample-apps/react-native/expo-video-sample/android/.gitignore

This file was deleted.

208 changes: 0 additions & 208 deletions sample-apps/react-native/expo-video-sample/android/app/build.gradle

This file was deleted.

Binary file not shown.
Loading

0 comments on commit 8862b71

Please sign in to comment.