fix: restore GoogleAuth.initialize on native to prevent startup NullPointerException crash
This commit is contained in:
Vendored
+1
-1
@@ -21,7 +21,7 @@
|
|||||||
<meta name="twitter:title" content="Travel Planner - Lên kế hoạch chuyến đi của bạn" />
|
<meta name="twitter:title" content="Travel Planner - Lên kế hoạch chuyến đi của bạn" />
|
||||||
<meta name="twitter:description" content="Khám phá những hành trình tuyệt vời và chia sẻ khoảnh khắc đẹp với cộng đồng du lịch." />
|
<meta name="twitter:description" content="Khám phá những hành trình tuyệt vời và chia sẻ khoảnh khắc đẹp với cộng đồng du lịch." />
|
||||||
<meta name="twitter:image" content="https://yotrip.labz.io.vn/background.avif" />
|
<meta name="twitter:image" content="https://yotrip.labz.io.vn/background.avif" />
|
||||||
<script type="module" crossorigin src="/assets/index-BlsmMRXS.js"></script>
|
<script type="module" crossorigin src="/assets/index-Cvd5D3ha.js"></script>
|
||||||
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-Cyuzqnbw.js">
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-Cyuzqnbw.js">
|
||||||
<link rel="modulepreload" crossorigin href="/assets/vendor-others-VIU5qAPG.js">
|
<link rel="modulepreload" crossorigin href="/assets/vendor-others-VIU5qAPG.js">
|
||||||
<link rel="modulepreload" crossorigin href="/assets/vendor-editor-DOXkNaRS.js">
|
<link rel="modulepreload" crossorigin href="/assets/vendor-editor-DOXkNaRS.js">
|
||||||
|
|||||||
@@ -26,18 +26,16 @@ function rewriteUrls(obj: any, backendUrl: string): any {
|
|||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Capacitor.isNativePlatform()) {
|
// Initialize Google Login client to prevent NullPointerException crashes on Android
|
||||||
// Initialize Web/PWA Google Login client
|
|
||||||
try {
|
try {
|
||||||
GoogleAuth.initialize({
|
GoogleAuth.initialize({
|
||||||
clientId: import.meta.env.VITE_GOOGLE_CLIENT_ID || '639044397050-7hair384u6lle941h033trut1s3q47l4.apps.googleusercontent.com',
|
clientId: import.meta.env.VITE_GOOGLE_CLIENT_ID || '639044397050-7hair384u6lle941h033trut1s3q47l4.apps.googleusercontent.com',
|
||||||
scopes: ['profile', 'email'],
|
scopes: ['profile', 'email'],
|
||||||
grantOfflineAccess: true,
|
grantOfflineAccess: true,
|
||||||
});
|
});
|
||||||
console.log('[Web OAuth] GoogleAuth initialized successfully.');
|
console.log('[OAuth] GoogleAuth initialized successfully.');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('[Web OAuth] Failed to initialize GoogleAuth client:', e);
|
console.error('[OAuth] Failed to initialize GoogleAuth client:', e);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Capacitor.isNativePlatform()) {
|
if (Capacitor.isNativePlatform()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user