fix: gradle
@@ -177,3 +177,5 @@ dependencies {
|
|||||||
implementation jscFlavor
|
implementation jscFlavor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
apply plugin: 'com.google.gms.google-services'
|
||||||
@@ -28,6 +28,7 @@
|
|||||||
<category android:name="android.intent.category.BROWSABLE"/>
|
<category android:name="android.intent.category.BROWSABLE"/>
|
||||||
<data android:scheme="myapp"/>
|
<data android:scheme="myapp"/>
|
||||||
<data android:scheme="mobiledarmasaba.app"/>
|
<data android:scheme="mobiledarmasaba.app"/>
|
||||||
|
<data android:scheme="exp+mobile-darmasaba"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
</application>
|
</application>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 135 KiB |
|
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 221 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 57 KiB |
@@ -15,6 +15,7 @@ buildscript {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
|
classpath 'com.google.gms:google-services:4.4.1'
|
||||||
classpath('com.android.tools.build:gradle')
|
classpath('com.android.tools.build:gradle')
|
||||||
classpath('com.facebook.react:react-native-gradle-plugin')
|
classpath('com.facebook.react:react-native-gradle-plugin')
|
||||||
classpath('org.jetbrains.kotlin:kotlin-gradle-plugin')
|
classpath('org.jetbrains.kotlin:kotlin-gradle-plugin')
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import ButtonBackHeader from "@/components/buttonBackHeader";
|
|||||||
import HeaderDiscussionGeneral from "@/components/discussion_general/headerDiscussionGeneral";
|
import HeaderDiscussionGeneral from "@/components/discussion_general/headerDiscussionGeneral";
|
||||||
import HeaderRightDivisionList from "@/components/division/headerDivisionList";
|
import HeaderRightDivisionList from "@/components/division/headerDivisionList";
|
||||||
import HeaderRightGroupList from "@/components/group/headerGroupList";
|
import HeaderRightGroupList from "@/components/group/headerGroupList";
|
||||||
|
import { HeaderRightHome } from "@/components/home/headerRightHome";
|
||||||
import HeaderMemberList from "@/components/member/headerMemberList";
|
import HeaderMemberList from "@/components/member/headerMemberList";
|
||||||
import HeaderRightPositionList from "@/components/position/headerRightPositionList";
|
import HeaderRightPositionList from "@/components/position/headerRightPositionList";
|
||||||
import HeaderRightProjectList from "@/components/project/headerProjectList";
|
import HeaderRightProjectList from "@/components/project/headerProjectList";
|
||||||
@@ -46,8 +47,18 @@ export default function RootLayout() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
<Stack screenOptions={Headers.shadow}>
|
<Stack screenOptions={Headers.shadow} >
|
||||||
<Stack.Screen name="home" options={{ title: 'Home' }} />
|
<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="feature" options={{ title: 'Fitur' }} />
|
||||||
<Stack.Screen name="search" options={{ title: 'Pencarian' }} />
|
<Stack.Screen name="search" options={{ title: 'Pencarian' }} />
|
||||||
<Stack.Screen name="notification" options={{ title: 'Notifikasi' }} />
|
<Stack.Screen name="notification" options={{ title: 'Notifikasi' }} />
|
||||||
|
|||||||
@@ -5,24 +5,13 @@ import DisccussionHome from "@/components/home/discussionHome";
|
|||||||
import DivisionHome from "@/components/home/divisionHome";
|
import DivisionHome from "@/components/home/divisionHome";
|
||||||
import EventHome from "@/components/home/eventHome";
|
import EventHome from "@/components/home/eventHome";
|
||||||
import FiturHome from "@/components/home/fiturHome";
|
import FiturHome from "@/components/home/fiturHome";
|
||||||
import { HeaderRightHome } from "@/components/home/headerRightHome";
|
|
||||||
import ProjectHome from "@/components/home/projectHome";
|
import ProjectHome from "@/components/home/projectHome";
|
||||||
import Styles from "@/constants/Styles";
|
import Styles from "@/constants/Styles";
|
||||||
import { Stack } from "expo-router";
|
|
||||||
import { SafeAreaView, ScrollView, View } from "react-native";
|
import { SafeAreaView, ScrollView, View } from "react-native";
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
return (
|
return (
|
||||||
<SafeAreaView>
|
<SafeAreaView>
|
||||||
<Stack.Screen
|
|
||||||
options={{
|
|
||||||
title: 'Home',
|
|
||||||
headerLeft: () => <></>,
|
|
||||||
headerTitle: 'Darmasaba',
|
|
||||||
headerRight: () => <HeaderRightHome />,
|
|
||||||
headerTitleAlign: 'left',
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<ScrollView>
|
<ScrollView>
|
||||||
<CaraouselHome />
|
<CaraouselHome />
|
||||||
<View style={[Styles.ph15]}>
|
<View style={[Styles.ph15]}>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ export const Headers = {
|
|||||||
backgroundColor: bgColorDefault,
|
backgroundColor: bgColorDefault,
|
||||||
},
|
},
|
||||||
headerTintColor: '#fff',
|
headerTintColor: '#fff',
|
||||||
headerShadowVisible: true
|
headerShadowVisible: true,
|
||||||
},
|
},
|
||||||
noShadow: {
|
noShadow: {
|
||||||
headerStyle: {
|
headerStyle: {
|
||||||
|
|||||||
@@ -31,9 +31,17 @@
|
|||||||
<string>mobiledarmasaba.app</string>
|
<string>mobiledarmasaba.app</string>
|
||||||
</array>
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleURLSchemes</key>
|
||||||
|
<array>
|
||||||
|
<string>exp+mobile-darmasaba</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1</string>
|
<string>1</string>
|
||||||
|
<key>ITSAppUsesNonExemptEncryption</key>
|
||||||
|
<false/>
|
||||||
<key>LSMinimumSystemVersion</key>
|
<key>LSMinimumSystemVersion</key>
|
||||||
<string>12.0</string>
|
<string>12.0</string>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-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">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict/>
|
<dict>
|
||||||
|
<key>aps-environment</key>
|
||||||
|
<string>development</string>
|
||||||
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
@@ -2,7 +2,7 @@ import axios from 'axios';
|
|||||||
|
|
||||||
const api = axios.create({
|
const api = axios.create({
|
||||||
// baseURL: 'http://10.0.2.2:3000/api',
|
// 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 }) => {
|
export const apiCheckPhoneLogin = async (body: { phone: string }) => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import firebase from '@react-native-firebase/app';
|
import { getApp, getApps, initializeApp } from '@react-native-firebase/app';
|
||||||
import messaging from '@react-native-firebase/messaging';
|
import { getMessaging } from '@react-native-firebase/messaging';
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { PermissionsAndroid } from 'react-native';
|
import { PermissionsAndroid } from 'react-native';
|
||||||
|
|
||||||
@@ -14,24 +14,21 @@ const RNfirebaseConfig = {
|
|||||||
databaseURL: "https://mobile-darmasaba-default-rtdb.asia-southeast1.firebasedatabase.app/"
|
databaseURL: "https://mobile-darmasaba-default-rtdb.asia-southeast1.firebasedatabase.app/"
|
||||||
};
|
};
|
||||||
|
|
||||||
let initialized = false;
|
|
||||||
|
|
||||||
const initializeFirebase = async () => {
|
const initializeFirebase = async () => {
|
||||||
if (initialized) return;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if(!firebase.apps.length){
|
const app = getApps().length ? getApp() : initializeApp(RNfirebaseConfig);
|
||||||
firebase.initializeApp(RNfirebaseConfig)
|
const mess = getMessaging(app);
|
||||||
}
|
|
||||||
|
|
||||||
// Set auto initialization and background message handler
|
// Set auto initialization and background message handler
|
||||||
messaging().setAutoInitEnabled(true);
|
mess.setAutoInitEnabled(true);
|
||||||
messaging().setBackgroundMessageHandler(async remoteMessage => {
|
mess.setBackgroundMessageHandler(async remoteMessage => {
|
||||||
console.log('Message handled in the background!', remoteMessage);
|
console.log('Message handled in the background!', remoteMessage);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return mess
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to initialize Firebase:', error);
|
console.error('Failed to initialize Firebase:', error);
|
||||||
throw error;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -40,11 +37,7 @@ const requestPermission = async () => {
|
|||||||
const granted = await PermissionsAndroid.request(
|
const granted = await PermissionsAndroid.request(
|
||||||
PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS
|
PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS
|
||||||
);
|
);
|
||||||
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
|
return granted;
|
||||||
console.log('Notification permission granted');
|
|
||||||
} else {
|
|
||||||
console.log('Notification permission denied');
|
|
||||||
}
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.warn('Error requesting notification permissions:', err);
|
console.warn('Error requesting notification permissions:', err);
|
||||||
}
|
}
|
||||||
@@ -52,12 +45,12 @@ const requestPermission = async () => {
|
|||||||
|
|
||||||
const getToken = async () => {
|
const getToken = async () => {
|
||||||
try {
|
try {
|
||||||
const token = await messaging().getToken();
|
const mess = await initializeFirebase();
|
||||||
|
const token = await mess?.getToken();
|
||||||
console.log('Token:', token);
|
console.log('Token:', token);
|
||||||
return token;
|
return token;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error getting token:", error);
|
console.error("Error getting token:", error);
|
||||||
throw error;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -65,7 +58,7 @@ export const useNotification = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const initializeAndSetup = async () => {
|
const initializeAndSetup = async () => {
|
||||||
try {
|
try {
|
||||||
await initializeFirebase();
|
// await initializeFirebase();
|
||||||
await requestPermission();
|
await requestPermission();
|
||||||
await getToken();
|
await getToken();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||