fix: sửa lỗi notification và giao diện chat trên android
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { Capacitor } from '@capacitor/core';
|
||||
import { GoogleAuth } from '@codetrix-studio/capacitor-google-auth';
|
||||
import { LocalNotifications } from '@capacitor/local-notifications';
|
||||
|
||||
function rewriteUrls(obj: any, backendUrl: string): any {
|
||||
if (obj === null || obj === undefined) return obj;
|
||||
@@ -37,6 +38,15 @@ if (Capacitor.isNativePlatform()) {
|
||||
console.error('[Native OAuth] Failed to initialize GoogleAuth client:', e);
|
||||
}
|
||||
|
||||
// Request native local notification permission on startup
|
||||
try {
|
||||
LocalNotifications.requestPermissions().then(result => {
|
||||
console.log('[LocalNotifications] Permissions requested:', result);
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('[LocalNotifications] Failed to request permissions:', e);
|
||||
}
|
||||
|
||||
const backendUrl = import.meta.env.VITE_BACKEND_URL || 'https://yotrip.labz.io.vn';
|
||||
|
||||
const originalFetch = window.fetch;
|
||||
|
||||
Reference in New Issue
Block a user