You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PS E:\Friendify\web> npx cap doctor
Capacitor Doctor
Latest Dependencies:
@capacitor/cli: 7.0.1
@capacitor/core: 7.0.1
@capacitor/android: 7.0.1
@capacitor/ios: 7.0.1
Installed Dependencies:
@capacitor/android: 7.0.1
@capacitor/ios: 7.0.1
@capacitor/cli: 7.0.1
@capacitor/core: 7.0.1
[error] Main activity file (MainActivity) is missing
(MainActivity.java is not missing, can't figure out why there is such error)
Platform(s)
Current Behavior
Expected Behavior
Code Reproduction
import{PushNotifications}from'@capacitor/push-notifications';import{Capacitor}from'@capacitor/core';import{Dialog}from'@capacitor/dialog';importaxiosInstancefrom'./utils/axiosInstance';exportconstregisterPushNotifications=async()=>{// Sprawdź czy urządzenie to Android/iOS (natywna aplikacja)if(!Capacitor.isNativePlatform()){console.log('📱 Powiadomienia push są dostępne tylko w natywnej aplikacji');return;}try{// Sprawdź uprawnienialetpermStatus=awaitPushNotifications.checkPermissions();if(permStatus.receive==='prompt'){permStatus=awaitPushNotifications.requestPermissions();}if(permStatus.receive!=='granted'){thrownewError('Brak uprawnień do powiadomień');}// Zarejestruj się do powiadomieńawaitPushNotifications.register();// Dodaj listeneryawaitaddListeners();returntrue;}catch(error){console.error('❌ Błąd podczas rejestracji powiadomień:',error);throwerror;}};constaddListeners=async()=>{awaitPushNotifications.addListener('registration',(token)=>{console.log('📱 Token push:',token.value);// Tutaj możesz wysłać token do swojego API});awaitPushNotifications.addListener('registrationError',(error)=>{console.error('❌ Błąd rejestracji push:',error);});awaitPushNotifications.addListener('pushNotificationReceived',(notification)=>{console.log('📱 Otrzymano powiadomienie:',notification);});awaitPushNotifications.addListener('pushNotificationActionPerformed',(notification)=>{console.log('📱 Kliknięto powiadomienie:',notification);});};//PushNotificationPrompt.tsximport{Dialog}from'@capacitor/dialog';import{useState}from'react';import{registerPushNotifications}from'../pushNotifications';importSlideUpCardfrom'./SlideUpCard';import{Capacitor}from'@capacitor/core';import{useTranslation}from'react-i18next';exportconstPushNotificationPrompt=()=>{const[showPrompt,setShowPrompt]=useState(Capacitor.isNativePlatform());const{ t }=useTranslation();consthandleEnableNotifications=async()=>{try{awaitregisterPushNotifications();setShowPrompt(false);}catch(error){console.error('❌ Błąd podczas rejestracji powiadomień:',error);awaitDialog.alert({title: t('notifications.error.title'),message: t('notifications.error.message'),});}};if(!Capacitor.isNativePlatform())returnnull;// Passes - I can see the SlideUpCardreturn(<SlideUpCardisVisible={showPrompt}onClose={()=>setShowPrompt(false)}closeOnBackdropClick={false}><divclassName="text-white"><h3className="text-xl font-bold mb-2">{t('notifications.enable.title')}</h3><pclassName="text-gray-300 mb-4">{t('notifications.enable.description')}</p><divclassName="flex gap-3"><buttononClick={()=>setShowPrompt(false)}className="flex-1 py-3 px-4 rounded-lg border border-gray-600 text-white hover:bg-gray-800 transition-colors">{t('notifications.later')}</button><buttononClick={handleEnableNotifications}className="flex-1 py-3 px-4 rounded-lg bg-white text-black hover:bg-gray-200 transition-colors">{t('notifications.enable.now')}</button></div></div></SlideUpCard>);};
Other Technical Details
Additional Context
Capacitor/Console ok.mafineeek.hango E File: https://localhost/assets/index-CyE89Nx6.js - Line 238 - Msg: Uncaught (in promise) Error: "PushNotifications" plugin is not implemented on android
The text was updated successfully, but these errors were encountered:
Bug Report
Plugin(s)
Capacitor Version
Platform(s)
Current Behavior
Expected Behavior
Code Reproduction
Other Technical Details
Additional Context
Capacitor/Console ok.mafineeek.hango E File: https://localhost/assets/index-CyE89Nx6.js - Line 238 - Msg: Uncaught (in promise) Error: "PushNotifications" plugin is not implemented on android
The text was updated successfully, but these errors were encountered: