Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(rn-video): upgrade to expo ver 52 #1630

Merged
merged 8 commits into from
Jan 3, 2025
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
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
Loading