Merge pull request 'Fix rejected apple delete account & start for notification' (#12) from qc/18-nov-25 into staging
Reviewed-on: http://wibugit.wibudev.com/wibu/hipmi-mobile/pulls/12
This commit is contained in:
@@ -92,8 +92,8 @@ android {
|
||||
applicationId 'com.bip.hipmimobileapp'
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 1
|
||||
versionName "1.0.0"
|
||||
versionCode 2
|
||||
versionName "1.0.1"
|
||||
|
||||
buildConfigField "String", "REACT_NATIVE_RELEASE_LEVEL", "\"${findProperty('reactNativeReleaseLevel') ?: 'stable'}\""
|
||||
}
|
||||
@@ -180,3 +180,5 @@ dependencies {
|
||||
implementation jscFlavor
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
29
android/app/google-services.json
Normal file
29
android/app/google-services.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "608461535079",
|
||||
"project_id": "hipmi-badung-connect",
|
||||
"storage_bucket": "hipmi-badung-connect.firebasestorage.app"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:608461535079:android:4ff12ddc283fb3746761c2",
|
||||
"android_client_info": {
|
||||
"package_name": "com.bip.hipmimobileapp"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyBiDtIk3Q9zffFwIdJ5cjqY7e4390JGSkM"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
||||
@@ -29,6 +29,12 @@
|
||||
<data android:scheme="hipmimobile"/>
|
||||
<data android:scheme="exp+hipmi-mobile"/>
|
||||
</intent-filter>
|
||||
<intent-filter android:autoVerify="true" data-generated="true">
|
||||
<action android:name="android.intent.action.VIEW"/>
|
||||
<data android:scheme="https" android:host="cld-dkr-staging-hipmi.wibudev.com" android:pathPrefix="/"/>
|
||||
<category android:name="android.intent.category.BROWSABLE"/>
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -6,6 +6,7 @@ buildscript {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.google.gms:google-services:4.4.1'
|
||||
classpath('com.android.tools.build:gradle')
|
||||
classpath('com.facebook.react:react-native-gradle-plugin')
|
||||
classpath('org.jetbrains.kotlin:kotlin-gradle-plugin')
|
||||
|
||||
@@ -18,7 +18,7 @@ export default {
|
||||
ITSAppUsesNonExemptEncryption: false,
|
||||
},
|
||||
associatedDomains: ["applinks:cld-dkr-staging-hipmi.wibudev.com"],
|
||||
buildNumber: "5",
|
||||
buildNumber: "7",
|
||||
},
|
||||
|
||||
android: {
|
||||
@@ -55,6 +55,7 @@ export default {
|
||||
|
||||
plugins: [
|
||||
"expo-router",
|
||||
"expo-notifications",
|
||||
"expo-web-browser",
|
||||
[
|
||||
"expo-splash-screen",
|
||||
|
||||
@@ -1,27 +1,10 @@
|
||||
import { AuthProvider } from "@/context/AuthContext";
|
||||
import AppRoot from "@/screens/RootLayout/AppRoot";
|
||||
import { registerForPushNotificationsAsync } from "@/utils/notifications";
|
||||
import { useEffect } from "react";
|
||||
import "react-native-gesture-handler";
|
||||
import { SafeAreaProvider } from "react-native-safe-area-context";
|
||||
import Toast from "react-native-toast-message";
|
||||
|
||||
export default function RootLayout() {
|
||||
useEffect(() => {
|
||||
// Jalankan sekali saat app pertama kali dibuka
|
||||
registerForPushNotificationsAsync().then((token) => {
|
||||
if (token) {
|
||||
// TODO: Kirim token ke backend kamu
|
||||
// Contoh:
|
||||
// fetch('https://api.hipmibadung.id/save-token', {
|
||||
// method: 'POST',
|
||||
// headers: { 'Content-Type': 'application/json' },
|
||||
// body: JSON.stringify({ token })
|
||||
// });
|
||||
}
|
||||
});
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
<SafeAreaProvider>
|
||||
|
||||
8
bun.lock
8
bun.lock
@@ -29,13 +29,13 @@
|
||||
"expo-image": "~3.0.8",
|
||||
"expo-image-picker": "~17.0.8",
|
||||
"expo-linking": "~8.0.8",
|
||||
"expo-notifications": "~0.32.12",
|
||||
"expo-notifications": "~0.32.13",
|
||||
"expo-router": "~6.0.1",
|
||||
"expo-splash-screen": "~31.0.9",
|
||||
"expo-status-bar": "~3.0.8",
|
||||
"expo-symbols": "~1.0.7",
|
||||
"expo-system-ui": "~6.0.7",
|
||||
"expo-web-browser": "~15.0.7",
|
||||
"expo-web-browser": "~15.0.9",
|
||||
"lodash": "^4.17.21",
|
||||
"react": "19.1.0",
|
||||
"react-dom": "19.1.0",
|
||||
@@ -1206,7 +1206,7 @@
|
||||
|
||||
"expo-modules-core": ["expo-modules-core@3.0.15", "", { "dependencies": { "invariant": "^2.2.4" }, "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-vGI7osd0/IjprldD08k4bckWSu7ID4HhZNP68l/UtilONQ8XZig8mWJd/Fm7i7KGvE3HyuF+HOXE9l671no42Q=="],
|
||||
|
||||
"expo-notifications": ["expo-notifications@0.32.12", "", { "dependencies": { "@expo/image-utils": "^0.8.7", "@ide/backoff": "^1.0.0", "abort-controller": "^3.0.0", "assert": "^2.0.0", "badgin": "^1.1.5", "expo-application": "~7.0.7", "expo-constants": "~18.0.9" }, "peerDependencies": { "expo": "*", "react": "*", "react-native": "*" } }, "sha512-FVJ5W4rOpKvmrLJ1Sd5pxiVTV4a7ApgTlKro+E5X8M2TBbXmEVOjs09klzdalXTjlzmU/Gu8aRw9xr7Ea/gZdw=="],
|
||||
"expo-notifications": ["expo-notifications@0.32.13", "", { "dependencies": { "@expo/image-utils": "^0.8.7", "@ide/backoff": "^1.0.0", "abort-controller": "^3.0.0", "assert": "^2.0.0", "badgin": "^1.1.5", "expo-application": "~7.0.7", "expo-constants": "~18.0.10" }, "peerDependencies": { "expo": "*", "react": "*", "react-native": "*" } }, "sha512-PL0R1ulLVUgAswlXtRDKxBlcipNM3YA6+P5nB5JIhXbsjLJ7y+EKVaEhHhbaGzuK1QVsRQSJNm/4oISX+vsmFQ=="],
|
||||
|
||||
"expo-router": ["expo-router@6.0.1", "", { "dependencies": { "@expo/metro-runtime": "6.1.1", "@expo/schema-utils": "^0.1.7", "@expo/server": "^0.7.4", "@radix-ui/react-slot": "1.2.0", "@radix-ui/react-tabs": "^1.1.12", "@react-navigation/bottom-tabs": "^7.4.0", "@react-navigation/native": "^7.1.8", "@react-navigation/native-stack": "^7.3.16", "client-only": "^0.0.1", "debug": "^4.3.4", "escape-string-regexp": "^4.0.0", "fast-deep-equal": "^3.1.3", "invariant": "^2.2.4", "nanoid": "^3.3.8", "query-string": "^7.1.3", "react-fast-compare": "^3.2.2", "react-native-is-edge-to-edge": "^1.1.6", "semver": "~7.6.3", "server-only": "^0.0.1", "sf-symbols-typescript": "^2.1.0", "shallowequal": "^1.1.0", "use-latest-callback": "^0.2.1", "vaul": "^1.1.2" }, "peerDependencies": { "@react-navigation/drawer": "^7.5.0", "@testing-library/react-native": ">= 12.0.0", "expo": "*", "expo-constants": "^18.0.8", "expo-linking": "^8.0.8", "react": "*", "react-dom": "*", "react-native": "*", "react-native-gesture-handler": "*", "react-native-reanimated": "*", "react-native-safe-area-context": ">= 5.4.0", "react-native-screens": "*", "react-native-web": "*", "react-server-dom-webpack": ">= 19.0.0" }, "optionalPeers": ["@react-navigation/drawer", "@testing-library/react-native", "react-dom", "react-native-gesture-handler", "react-native-reanimated", "react-native-web", "react-server-dom-webpack"] }, "sha512-5wXkWyNMqUbjCWH0PRkOM0P6UsgLVdgchDkiLz5FY7HfU00ToBcxij965bqtlaATBgoaIo4DuLu6EgxewrKJ8Q=="],
|
||||
|
||||
@@ -1220,7 +1220,7 @@
|
||||
|
||||
"expo-updates-interface": ["expo-updates-interface@2.0.0", "", { "peerDependencies": { "expo": "*" } }, "sha512-pTzAIufEZdVPKql6iMi5ylVSPqV1qbEopz9G6TSECQmnNde2nwq42PxdFBaUEd8IZJ/fdJLQnOT3m6+XJ5s7jg=="],
|
||||
|
||||
"expo-web-browser": ["expo-web-browser@15.0.7", "", { "peerDependencies": { "expo": "*", "react-native": "*" } }, "sha512-eXnfO3FQ2WthTA8uEPNJ7SDRfPaLIU/P2k082HGEYIHAFZMwh2o9Wo+SDVytO3E95TAv1qwhggUjOrczYzxteQ=="],
|
||||
"expo-web-browser": ["expo-web-browser@15.0.9", "", { "peerDependencies": { "expo": "*", "react-native": "*" } }, "sha512-Dj8kNFO+oXsxqCDNlUT/GhOrJnm10kAElH++3RplLydogFm5jTzXYWDEeNIDmV+F+BzGYs+sIhxiBf7RyaxXZg=="],
|
||||
|
||||
"exponential-backoff": ["exponential-backoff@3.1.2", "", {}, "sha512-8QxYTVXUkuy7fIIoitQkPwGonB8F3Zj8eEO8Sqg9Zv/bkI7RJAzowee4gr81Hak/dUTpA2Z7VfQgoijjPNlUZA=="],
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>aps-environment</key>
|
||||
<string>development</string>
|
||||
<key>com.apple.developer.associated-domains</key>
|
||||
<array>
|
||||
<string>applinks:cld-dkr-staging-hipmi.wibudev.com</string>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>5</string>
|
||||
<string>7</string>
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<false/>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
|
||||
@@ -36,13 +36,13 @@
|
||||
"expo-image": "~3.0.8",
|
||||
"expo-image-picker": "~17.0.8",
|
||||
"expo-linking": "~8.0.8",
|
||||
"expo-notifications": "~0.32.12",
|
||||
"expo-notifications": "~0.32.13",
|
||||
"expo-router": "~6.0.1",
|
||||
"expo-splash-screen": "~31.0.9",
|
||||
"expo-status-bar": "~3.0.8",
|
||||
"expo-symbols": "~1.0.7",
|
||||
"expo-system-ui": "~6.0.7",
|
||||
"expo-web-browser": "~15.0.7",
|
||||
"expo-web-browser": "~15.0.9",
|
||||
"lodash": "^4.17.21",
|
||||
"react": "19.1.0",
|
||||
"react-dom": "19.1.0",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||
import { AccentColor, MainColor } from "@/constants/color-palet";
|
||||
import { ICON_SIZE_MEDIUM } from "@/constants/constans-value";
|
||||
import { useAuth } from "@/hooks/use-auth";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
|
||||
export const drawerItemsProfile = ({
|
||||
@@ -10,6 +11,8 @@ export const drawerItemsProfile = ({
|
||||
id: string;
|
||||
isAdmin: boolean;
|
||||
}) => {
|
||||
const { user } = useAuth();
|
||||
|
||||
const adminItems: IMenuDrawerItem[] = [
|
||||
{
|
||||
icon: (
|
||||
@@ -21,6 +24,7 @@ export const drawerItemsProfile = ({
|
||||
),
|
||||
label: "Edit profile",
|
||||
path: `/(application)/profile/${id}/edit`,
|
||||
value: "edit-profile",
|
||||
},
|
||||
{
|
||||
icon: (
|
||||
@@ -32,6 +36,7 @@ export const drawerItemsProfile = ({
|
||||
),
|
||||
label: "Ubah foto profile",
|
||||
path: `/(application)/profile/${id}/update-photo`,
|
||||
value: "update-photo",
|
||||
},
|
||||
{
|
||||
icon: (
|
||||
@@ -43,6 +48,7 @@ export const drawerItemsProfile = ({
|
||||
),
|
||||
label: "Ubah latar belakang",
|
||||
path: `/(application)/profile/${id}/update-background`,
|
||||
value: "update-background",
|
||||
},
|
||||
{
|
||||
icon: (
|
||||
@@ -54,6 +60,7 @@ export const drawerItemsProfile = ({
|
||||
),
|
||||
label: "Tambah portofolio",
|
||||
path: `/(application)/portofolio/${id}/create`,
|
||||
value: "create-portofolio",
|
||||
},
|
||||
{
|
||||
icon: (
|
||||
@@ -65,6 +72,20 @@ export const drawerItemsProfile = ({
|
||||
),
|
||||
label: "Dashboard Admin",
|
||||
path: `/(application)/admin/dashboard`,
|
||||
value: "dashboard-admin",
|
||||
},
|
||||
{
|
||||
icon: (
|
||||
<Ionicons
|
||||
name="trash"
|
||||
size={ICON_SIZE_MEDIUM}
|
||||
color={AccentColor.white}
|
||||
/>
|
||||
),
|
||||
label: "Hapus Akun",
|
||||
color: MainColor.red,
|
||||
path: `https://cld-dkr-staging-hipmi.wibudev.com/delete-account?phone=${user?.nomor}`,
|
||||
value: "delete-account",
|
||||
},
|
||||
{
|
||||
icon: (
|
||||
@@ -77,6 +98,7 @@ export const drawerItemsProfile = ({
|
||||
label: "Keluar",
|
||||
color: MainColor.red,
|
||||
path: "",
|
||||
value: "logout",
|
||||
},
|
||||
];
|
||||
|
||||
@@ -91,6 +113,7 @@ export const drawerItemsProfile = ({
|
||||
),
|
||||
label: "Edit profile",
|
||||
path: `/(application)/profile/${id}/edit`,
|
||||
value: "edit-profile",
|
||||
},
|
||||
{
|
||||
icon: (
|
||||
@@ -102,6 +125,7 @@ export const drawerItemsProfile = ({
|
||||
),
|
||||
label: "Ubah foto profile",
|
||||
path: `/(application)/profile/${id}/update-photo`,
|
||||
value: "update-photo",
|
||||
},
|
||||
{
|
||||
icon: (
|
||||
@@ -113,6 +137,7 @@ export const drawerItemsProfile = ({
|
||||
),
|
||||
label: "Ubah latar belakang",
|
||||
path: `/(application)/profile/${id}/update-background`,
|
||||
value: "update-background",
|
||||
},
|
||||
{
|
||||
icon: (
|
||||
@@ -124,6 +149,20 @@ export const drawerItemsProfile = ({
|
||||
),
|
||||
label: "Tambah portofolio",
|
||||
path: `/(application)/portofolio/${id}/create`,
|
||||
value: "create-portofolio",
|
||||
},
|
||||
{
|
||||
icon: (
|
||||
<Ionicons
|
||||
name="trash"
|
||||
size={ICON_SIZE_MEDIUM}
|
||||
color={AccentColor.white}
|
||||
/>
|
||||
),
|
||||
label: "Hapus Akun",
|
||||
color: MainColor.red,
|
||||
path: `https://cld-dkr-staging-hipmi.wibudev.com/delete-account?phone=${user?.nomor}`,
|
||||
value: "delete-account",
|
||||
},
|
||||
{
|
||||
icon: (
|
||||
@@ -136,6 +175,7 @@ export const drawerItemsProfile = ({
|
||||
label: "Keluar",
|
||||
color: MainColor.red,
|
||||
path: "",
|
||||
value: "logout",
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { AlertDefaultSystem } from "@/components";
|
||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||
import MenuDrawerDynamicGrid from "@/components/Drawer/MenuDrawerDynamicGird";
|
||||
import { useAuth } from "@/hooks/use-auth";
|
||||
import { openBrowser } from "@/utils/openBrower";
|
||||
import { router } from "expo-router";
|
||||
|
||||
export default function Profile_MenuDrawerSection({
|
||||
@@ -13,7 +15,8 @@ export default function Profile_MenuDrawerSection({
|
||||
logout: () => Promise<void>;
|
||||
}) {
|
||||
const handlePress = (item: IMenuDrawerItem) => {
|
||||
if (item.label === "Keluar") {
|
||||
// console.log("ITEM >> ", item);
|
||||
if (item.value === "logout") {
|
||||
// console.log("Logout clicked");
|
||||
// setShowLogoutAlert(true);
|
||||
AlertDefaultSystem({
|
||||
@@ -27,6 +30,9 @@ export default function Profile_MenuDrawerSection({
|
||||
},
|
||||
onPressLeft: () => setIsDrawerOpen(false),
|
||||
});
|
||||
} else if (item.value === "delete-account") {
|
||||
console.log("PATH >> ", item.path);
|
||||
openBrowser(item.path as any);
|
||||
} else {
|
||||
console.log("PATH >> ", item.path);
|
||||
router.push(item.path as any);
|
||||
@@ -43,6 +49,7 @@ export default function Profile_MenuDrawerSection({
|
||||
label: item.label,
|
||||
path: item.path as any,
|
||||
color: item.color,
|
||||
value: item.value,
|
||||
}))}
|
||||
columns={4} // Ubah ke 2 jika ingin 2 kolom per baris
|
||||
onPressItem={(item) => handlePress(item as any)}
|
||||
|
||||
@@ -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
9
utils/openBrower.ts
Normal 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);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user