upd: redesign
Deskripsi: - login dan konfirmasi kode otp - firebase code env No Issues
This commit is contained in:
@@ -8,23 +8,28 @@ import * as Notifications from 'expo-notifications';
|
||||
import { useEffect } from 'react';
|
||||
import { PermissionsAndroid, Platform } from 'react-native';
|
||||
|
||||
// Firebase config
|
||||
import { ConstEnv } from '@/constants/ConstEnv';
|
||||
|
||||
const RNfirebaseConfig = {
|
||||
apiKey: "AIzaSyB2hbsW91J3oRQx4_jgrCCNY0tNt5-21e8",
|
||||
authDomain: "googleapis.com",
|
||||
projectId: "mobile-darmasaba",
|
||||
storageBucket: "mobile-darmasaba.appspot.com",
|
||||
messagingSenderId: "867439221179",
|
||||
appId: "1:867439221179:android:4509f77478c8dce99b0c9e",
|
||||
databaseURL: "https://mobile-darmasaba-default-rtdb.asia-southeast1.firebasedatabase.app/"
|
||||
apiKey: ConstEnv.firebase.apiKey,
|
||||
authDomain: ConstEnv.firebase.authDomain,
|
||||
projectId: ConstEnv.firebase.projectId,
|
||||
storageBucket: ConstEnv.firebase.storageBucket,
|
||||
messagingSenderId: ConstEnv.firebase.messagingSenderId,
|
||||
appId: ConstEnv.firebase.appId,
|
||||
databaseURL: ConstEnv.firebase.databaseURL
|
||||
};
|
||||
|
||||
const initializeFirebase = async () => {
|
||||
try {
|
||||
const app = getApps().length ? getApp() : initializeApp(RNfirebaseConfig);
|
||||
let app;
|
||||
const apps = getApps();
|
||||
if (apps.length) {
|
||||
app = getApp() as any;
|
||||
} else {
|
||||
app = initializeApp(RNfirebaseConfig) as any;
|
||||
}
|
||||
const mess = getMessaging(app);
|
||||
// await registerDeviceForRemoteMessages(mess);
|
||||
// `registerDeviceForRemoteMessages` tidak perlu lagi
|
||||
await setAutoInitEnabled(mess, true);
|
||||
|
||||
return mess;
|
||||
|
||||
Reference in New Issue
Block a user