nanobot özel sürüm v1
This commit is contained in:
@@ -9,6 +9,16 @@ class NotificationService {
|
||||
|
||||
initializeFirebase() {
|
||||
try {
|
||||
// Firebase credentials kontrolü
|
||||
const hasCredentials = process.env.FIREBASE_PROJECT_ID &&
|
||||
process.env.FIREBASE_PRIVATE_KEY &&
|
||||
process.env.FIREBASE_CLIENT_EMAIL;
|
||||
|
||||
if (!hasCredentials) {
|
||||
console.log('⚠️ Firebase credentials not configured. Push notifications disabled.');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!admin.apps.length) {
|
||||
const serviceAccount = {
|
||||
type: process.env.FIREBASE_TYPE,
|
||||
@@ -27,10 +37,11 @@ class NotificationService {
|
||||
credential: admin.credential.cert(serviceAccount)
|
||||
});
|
||||
|
||||
console.log('Firebase Admin SDK initialized successfully');
|
||||
console.log('✅ Firebase Admin SDK initialized successfully');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Firebase initialization error:', error);
|
||||
console.error('Firebase initialization error:', error.message);
|
||||
console.warn('Push notifications will be disabled.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user