Skip to content

Commit

Permalink
Merge pull request #188 from getAlby/task-notifications
Browse files Browse the repository at this point in the history
feat: notification improvements
  • Loading branch information
im-adithya authored Jan 9, 2025
2 parents 41b4299 + c59e919 commit 50654c2
Show file tree
Hide file tree
Showing 65 changed files with 4,760 additions and 4,238 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,8 @@ yarn-error.*

# typescript
*.tsbuildinfo

ios
android

google-services.json
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

1. Update version in

- `app.json`
- `app.config.js`
- `package.json`

2. Create a git tag and push it (a new draft release will be created)
Expand Down
111 changes: 111 additions & 0 deletions app.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
import withMessagingServicePlugin from "./plugins/withMessageServicePlugin";

export default ({ config }) => {
return {
...config,
name: "Alby Go",
slug: "alby-mobile",
version: "1.8.1",
scheme: ["lightning", "bitcoin", "alby", "nostr+walletconnect"],
orientation: "portrait",
icon: "./assets/icon.png",
userInterfaceStyle: "automatic",
newArchEnabled: true,
splash: {
image: "./assets/splash.png",
resizeMode: "cover",
backgroundColor: "#0F0C40",
},
assetBundlePatterns: ["**/*"],
plugins: [
[
withMessagingServicePlugin,
{
androidFMSFilePath: "./assets/MessagingService.kt",
},
],
[
"expo-notification-service-extension-plugin",
{
mode: "production",
iosNSEFilePath: "./assets/NotificationService.m",
},
],
[
"expo-splash-screen",
{
backgroundColor: "#0B0930",
image: "./assets/icon.png",
imageWidth: "150",
},
],
[
"expo-local-authentication",
{
faceIDPermission: "Allow Alby Go to use Face ID.",
},
],
[
"expo-camera",
{
cameraPermission:
"Allow Alby Go to use the camera to scan wallet connection and payment QR codes",
recordAudioAndroid: false,
},
],
[
"expo-font",
{
fonts: [
"./assets/fonts/OpenRunde-Regular.otf",
"./assets/fonts/OpenRunde-Medium.otf",
"./assets/fonts/OpenRunde-Semibold.otf",
"./assets/fonts/OpenRunde-Bold.otf",
],
},
],
[
"expo-notifications",
{
icon: "./assets/notification.png",
},
],
"expo-router",
"expo-secure-store",
],
ios: {
supportsTablet: true,
bundleIdentifier: "com.getalby.mobile",
config: {
usesNonExemptEncryption: false,
},
infoPlist: {
LSMinimumSystemVersion: "12.0",
UIBackgroundModes: ["remote-notification"],
},
userInterfaceStyle: "automatic",
},
android: {
package: "com.getalby.mobile",
icon: "./assets/icon.png",
adaptiveIcon: {
foregroundImage: "./assets/adaptive-icon.png",
backgroundImage: "./assets/adaptive-icon-bg.png",
monochromeImage: "./assets/monochromatic.png",
},
permissions: [
"android.permission.CAMERA",
"android.permission.USE_BIOMETRIC",
"android.permission.USE_FINGERPRINT",
],
userInterfaceStyle: "automatic",
googleServicesFile: process.env.GOOGLE_SERVICES_JSON,
},
extra: {
eas: {
projectId: "294965ec-3a67-4994-8794-5cc1117ef155",
},
},
owner: "roland_alby",
};
};
67 changes: 0 additions & 67 deletions app.json

This file was deleted.

5 changes: 0 additions & 5 deletions app/(app)/notifications.js

This file was deleted.

5 changes: 5 additions & 0 deletions app/(app)/send/0-amount.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { ZeroAmount } from "../../../pages/send/ZeroAmount";

export default function Page() {
return <ZeroAmount />;
}
5 changes: 5 additions & 0 deletions app/(app)/settings/notifications.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Notifications } from "../../../pages/settings/Notifications";

export default function Page() {
return <Notifications />;
}
4 changes: 2 additions & 2 deletions app/(app)/settings/wallets/[id]/lightning-address.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { LightningAddress } from "../../../../../pages/settings/wallets/LightningAddress";
import { SetLightningAddress } from "../../../../../pages/settings/wallets/LightningAddress";

export default function Page() {
return <LightningAddress />;
return <SetLightningAddress />;
}
68 changes: 41 additions & 27 deletions app/_layout.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import { Theme, ThemeProvider } from "@react-navigation/native";
import {
DarkTheme,
DefaultTheme,
Theme,
ThemeProvider,
} from "@react-navigation/native";
import { PortalHost } from "@rn-primitives/portal";
import * as Font from "expo-font";
import { Slot, SplashScreen } from "expo-router";
import { Slot } from "expo-router";
import * as SplashScreen from "expo-splash-screen";
import { StatusBar } from "expo-status-bar";
import { swrConfiguration } from "lib/swr";
import * as React from "react";
import { SafeAreaView } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import Toast from "react-native-toast-message";
import PolyfillCrypto from "react-native-webview-crypto";
import { SWRConfig } from "swr";
import { toastConfig } from "~/components/ToastConfig";
import { NotificationProvider } from "~/context/Notification";
import { UserInactivityProvider } from "~/context/UserInactivity";
import "~/global.css";
import { useInfo } from "~/hooks/useInfo";
Expand All @@ -20,11 +26,11 @@ import { useAppStore } from "~/lib/state/appStore";
import { useColorScheme } from "~/lib/useColorScheme";

const LIGHT_THEME: Theme = {
dark: false,
...DefaultTheme,
colors: NAV_THEME.light,
};
const DARK_THEME: Theme = {
dark: true,
...DarkTheme,
colors: NAV_THEME.dark,
};

Expand Down Expand Up @@ -65,18 +71,22 @@ export default function RootLayout() {
const loadTheme = React.useCallback((): Promise<void> => {
return new Promise((resolve) => {
const theme = useAppStore.getState().theme;
setColorScheme(theme);
if (theme) {
setColorScheme(theme);
} else {
useAppStore.getState().setTheme(isDarkColorScheme ? "dark" : "light");
}
resolve();
});
}, [setColorScheme]);
}, [isDarkColorScheme, setColorScheme]);

React.useEffect(() => {
const init = async () => {
try {
await Promise.all([loadTheme(), loadFonts(), checkBiometricStatus()]);
} finally {
setResourcesLoaded(true);
SplashScreen.hideAsync();
SplashScreen.hide();
}
};

Expand All @@ -89,24 +99,28 @@ export default function RootLayout() {

return (
<SWRConfig value={swrConfiguration}>
<ThemeProvider value={isDarkColorScheme ? DARK_THEME : LIGHT_THEME}>
<StatusBar style={isDarkColorScheme ? "light" : "dark"} />
<PolyfillCrypto />
<SafeAreaView className="w-full h-full bg-background">
<UserInactivityProvider>
<SessionProvider>
<Slot />
</SessionProvider>
</UserInactivityProvider>
<Toast
config={toastConfig}
position="bottom"
bottomOffset={140}
topOffset={140}
/>
<PortalHost />
</SafeAreaView>
</ThemeProvider>
<NotificationProvider>
<ThemeProvider value={isDarkColorScheme ? DARK_THEME : LIGHT_THEME}>
<StatusBar style={isDarkColorScheme ? "light" : "dark"} />
<SafeAreaView
className="w-full h-full bg-background"
edges={["left", "right", "bottom"]}
>
<UserInactivityProvider>
<SessionProvider>
<Slot />
</SessionProvider>
</UserInactivityProvider>
<Toast
config={toastConfig}
position="bottom"
bottomOffset={140}
topOffset={140}
/>
<PortalHost />
</SafeAreaView>
</ThemeProvider>
</NotificationProvider>
</SWRConfig>
);
}
Expand Down
Loading

0 comments on commit 50654c2

Please sign in to comment.