fix: gradle

This commit is contained in:
amel
2025-06-24 11:28:35 +08:00
parent ef24663437
commit ac54bcd9fa
26 changed files with 43 additions and 35 deletions

View File

@@ -177,3 +177,5 @@ dependencies {
implementation jscFlavor
}
}
apply plugin: 'com.google.gms.google-services'

View File

@@ -28,6 +28,7 @@
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="myapp"/>
<data android:scheme="mobiledarmasaba.app"/>
<data android:scheme="exp+mobile-darmasaba"/>
</intent-filter>
</activity>
</application>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 221 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 57 KiB

View File

@@ -15,6 +15,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')

View File

@@ -3,6 +3,7 @@ import ButtonBackHeader from "@/components/buttonBackHeader";
import HeaderDiscussionGeneral from "@/components/discussion_general/headerDiscussionGeneral";
import HeaderRightDivisionList from "@/components/division/headerDivisionList";
import HeaderRightGroupList from "@/components/group/headerGroupList";
import { HeaderRightHome } from "@/components/home/headerRightHome";
import HeaderMemberList from "@/components/member/headerMemberList";
import HeaderRightPositionList from "@/components/position/headerRightPositionList";
import HeaderRightProjectList from "@/components/project/headerProjectList";
@@ -46,8 +47,18 @@ export default function RootLayout() {
return (
<Provider store={store}>
<Stack screenOptions={Headers.shadow}>
<Stack.Screen name="home" options={{ title: 'Home' }} />
<Stack screenOptions={Headers.shadow} >
<Stack.Screen name="home" options={{
title: 'Home',
headerLeft: () => <></>,
headerTitle: 'Darmasaba',
headerRight: () => <HeaderRightHome />,
headerTitleAlign: 'left',
headerBackVisible: false,
contentStyle:{
}
}} />
<Stack.Screen name="feature" options={{ title: 'Fitur' }} />
<Stack.Screen name="search" options={{ title: 'Pencarian' }} />
<Stack.Screen name="notification" options={{ title: 'Notifikasi' }} />

View File

@@ -5,24 +5,13 @@ import DisccussionHome from "@/components/home/discussionHome";
import DivisionHome from "@/components/home/divisionHome";
import EventHome from "@/components/home/eventHome";
import FiturHome from "@/components/home/fiturHome";
import { HeaderRightHome } from "@/components/home/headerRightHome";
import ProjectHome from "@/components/home/projectHome";
import Styles from "@/constants/Styles";
import { Stack } from "expo-router";
import { SafeAreaView, ScrollView, View } from "react-native";
export default function Home() {
return (
<SafeAreaView>
<Stack.Screen
options={{
title: 'Home',
headerLeft: () => <></>,
headerTitle: 'Darmasaba',
headerRight: () => <HeaderRightHome />,
headerTitleAlign: 'left',
}}
/>
<ScrollView>
<CaraouselHome />
<View style={[Styles.ph15]}>

BIN
bun.lockb

Binary file not shown.

View File

@@ -6,7 +6,7 @@ export const Headers = {
backgroundColor: bgColorDefault,
},
headerTintColor: '#fff',
headerShadowVisible: true
headerShadowVisible: true,
},
noShadow: {
headerStyle: {

View File

@@ -31,9 +31,17 @@
<string>mobiledarmasaba.app</string>
</array>
</dict>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>exp+mobile-darmasaba</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>1</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSMinimumSystemVersion</key>
<string>12.0</string>
<key>LSRequiresIPhoneOS</key>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
<dict>
<key>aps-environment</key>
<string>development</string>
</dict>
</plist>

View File

@@ -2,7 +2,7 @@ import axios from 'axios';
const api = axios.create({
// baseURL: 'http://10.0.2.2:3000/api',
baseURL: 'http://192.168.1.243:3000/api',
baseURL: 'https://stg-darmasaba.wibudev.com/api',
});
export const apiCheckPhoneLogin = async (body: { phone: string }) => {

View File

@@ -1,5 +1,5 @@
import firebase from '@react-native-firebase/app';
import messaging from '@react-native-firebase/messaging';
import { getApp, getApps, initializeApp } from '@react-native-firebase/app';
import { getMessaging } from '@react-native-firebase/messaging';
import { useEffect } from 'react';
import { PermissionsAndroid } from 'react-native';
@@ -14,24 +14,21 @@ const RNfirebaseConfig = {
databaseURL: "https://mobile-darmasaba-default-rtdb.asia-southeast1.firebasedatabase.app/"
};
let initialized = false;
const initializeFirebase = async () => {
if (initialized) return;
try {
if(!firebase.apps.length){
firebase.initializeApp(RNfirebaseConfig)
}
const app = getApps().length ? getApp() : initializeApp(RNfirebaseConfig);
const mess = getMessaging(app);
// Set auto initialization and background message handler
messaging().setAutoInitEnabled(true);
messaging().setBackgroundMessageHandler(async remoteMessage => {
mess.setAutoInitEnabled(true);
mess.setBackgroundMessageHandler(async remoteMessage => {
console.log('Message handled in the background!', remoteMessage);
});
return mess
} catch (error) {
console.error('Failed to initialize Firebase:', error);
throw error;
}
};
@@ -40,11 +37,7 @@ const requestPermission = async () => {
const granted = await PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS
);
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
console.log('Notification permission granted');
} else {
console.log('Notification permission denied');
}
return granted;
} catch (err) {
console.warn('Error requesting notification permissions:', err);
}
@@ -52,12 +45,12 @@ const requestPermission = async () => {
const getToken = async () => {
try {
const token = await messaging().getToken();
const mess = await initializeFirebase();
const token = await mess?.getToken();
console.log('Token:', token);
return token;
} catch (error) {
console.error("Error getting token:", error);
throw error;
}
};
@@ -65,7 +58,7 @@ export const useNotification = () => {
useEffect(() => {
const initializeAndSetup = async () => {
try {
await initializeFirebase();
// await initializeFirebase();
await requestPermission();
await getToken();
} catch (error) {