Compare commits

...

6 Commits

Author SHA1 Message Date
herrrta
587d419502 feat: new notification deep links 2025-03-21 20:52:22 -04:00
herrrta
bc081b535e chore: version bump 2025-03-21 20:22:31 -04:00
herrrta
62d2d1f7ca fix: generate expo push tokens for real device only 2025-03-19 19:17:22 -04:00
lostb1t
66aab5b771 Update README.md 2025-03-19 12:14:00 +01:00
lostb1t
5c89100afd Update README.md 2025-03-19 11:58:08 +01:00
Fredrik Burmester
f1a3b48017 chore 2025-03-19 11:33:27 +01:00
6 changed files with 52 additions and 11 deletions

View File

@@ -43,6 +43,7 @@ body:
label: Version
description: What version of Streamyfin are you running?
options:
- 0.28.0
- 0.27.0
- 0.26.1
- 0.26.0

View File

@@ -123,6 +123,10 @@ Streamyfin is developed by [Fredrik Burmester](https://github.com/fredrikburmest
## ✨ Acknowledgements
We would like to thank the Jellyfin team for their great software and awesome support on discord.
Special shoutout to the JF official clients for being an inspiration to ours.
### Core Developers
Thanks to the following contributors for their significant contributions:

View File

@@ -2,7 +2,7 @@
"expo": {
"name": "Streamyfin",
"slug": "streamyfin",
"version": "0.27.0",
"version": "0.28.0",
"orientation": "default",
"icon": "./assets/images/icon.png",
"scheme": "streamyfin",
@@ -31,7 +31,7 @@
},
"android": {
"jsEngine": "hermes",
"versionCode": 53,
"versionCode": 54,
"adaptiveIcon": {
"foregroundImage": "./assets/images/adaptive_icon.png",
"backgroundColor": "#464646"

View File

@@ -32,6 +32,7 @@ const BackgroundFetch = !Platform.isTV
? require("expo-background-fetch")
: null;
import * as FileSystem from "expo-file-system";
import * as Device from "expo-device";
const Notifications = !Platform.isTV ? require("expo-notifications") : null;
import * as ScreenOrientation from "@/packages/expo-screen-orientation";
import { Stack, router, useSegments } from "expo-router";
@@ -331,9 +332,12 @@ function Layout() {
await registerBackgroundFetchAsyncSessions();
}
Notifications?.getExpoPushTokenAsync()
.then((token: ExpoPushToken) => token && setExpoPushToken(token))
.catch((reason: any) => console.log("Failed to get token", reason));
// only create push token for real devices (pointless for emulators)
if(Device.isDevice) {
Notifications?.getExpoPushTokenAsync()
.then((token: ExpoPushToken) => token && setExpoPushToken(token))
.catch((reason: any) => console.log("Failed to get token", reason));
}
}
useEffect(() => {
@@ -352,7 +356,39 @@ function Layout() {
responseListener.current =
Notifications?.addNotificationResponseReceivedListener(
(response: NotificationResponse) => {
console.log("Notification interacted with", response);
// Currently the notifications supported by the plugin will send data for deep links.
const data = response.notification.request.content.data;
if (data && Object.keys(data).length > 0) {
const type = data["type"].toLower();
const itemId = data["id"];
switch (type) {
case "movie":
router.push(`/(auth)/(tabs)/home/items/page?id=${itemId}`)
break;
case "episode":
const episodeId = data.id;
// We just clicked a notification for an individual episode.
if (episodeId) {
router.push(`/(auth)/(tabs)/home/items/page?id=${itemId}`)
}
// summarized season notification for multiple episodes. Bring them to series season
else {
const seriesId = data.seriesId;
const seasonIndex = data.seasonIndex;
if (seasonIndex) {
router.push(`/(auth)/(tabs)/home/series/${seriesId}?seasonIndex=${seasonIndex}`)
}
else {
router.push(`/(auth)/(tabs)/home/series/${seriesId}`)
}
}
break;
}
}
},
);

View File

@@ -32,20 +32,20 @@
}
},
"production": {
"channel": "0.27.0",
"channel": "0.28.0",
"android": {
"image": "latest"
}
},
"production-apk": {
"channel": "0.27.0",
"channel": "0.28.0",
"android": {
"buildType": "apk",
"image": "latest"
}
},
"production-apk-tv": {
"channel": "0.27.0",
"channel": "0.28.0",
"android": {
"buildType": "apk",
"image": "latest"

View File

@@ -64,7 +64,7 @@ export const JellyfinProvider: React.FC<{ children: ReactNode }> = ({
setJellyfin(
() =>
new Jellyfin({
clientInfo: { name: "Streamyfin", version: "0.27.0" },
clientInfo: { name: "Streamyfin", version: "0.28.0" },
deviceInfo: {
name: deviceName,
id,
@@ -93,7 +93,7 @@ export const JellyfinProvider: React.FC<{ children: ReactNode }> = ({
return {
authorization: `MediaBrowser Client="Streamyfin", Device=${
Platform.OS === "android" ? "Android" : "iOS"
}, DeviceId="${deviceId}", Version="0.27.0"`,
}, DeviceId="${deviceId}", Version="0.28.0"`,
};
}, [deviceId]);