Fix rejected apple delete account & start for notification

### No issue
This commit is contained in:
2025-11-18 14:29:02 +08:00
parent 76debfd6a6
commit 059b4d053a
14 changed files with 111 additions and 30 deletions

View File

@@ -1,7 +1,8 @@
// utils/notifications.ts
import * as Device from 'expo-device';
import * as Notifications from 'expo-notifications';
import Constants from 'expo-constants';
import * as Device from 'expo-device';
Notifications.setNotificationHandler({
handleNotification: async () => ({
@@ -13,7 +14,7 @@ Notifications.setNotificationHandler({
}),
});
export async function registerForPushNotificationsAsync() {
export default async function registerForPushNotificationsAsync() {
if (!Device.isDevice) {
console.warn("Push notifications don't work on simulator");
return null;

9
utils/openBrower.ts Normal file
View File

@@ -0,0 +1,9 @@
import * as WebBrowser from "expo-web-browser";
export const openBrowser = async (url: string) => {
try {
await WebBrowser.openBrowserAsync(url);
} catch (error) {
console.error("Gagal membuka browser:", error);
}
};