Closed polsust closed 4 months ago
Having the same problem, in iOS it takes well the library, in Android I have undefined unless I import it like:
import * as PushNotification from 'react-native-push-notification'
I ended up doing this:
import * as PN from 'react-native-push-notification';
const PushNotification = (PN as any) as PN.PushNotification;
to have the type done correctly.
If anyone has a better solution, be my guest.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.
Bug
TypeError: RNPushNotification is undefined
Right when launching the app
Installed RNpn for android without autolinking
Environment info
react-native info
output:Library version: ^8.1.1
Steps To Reproduce
Describe what you expected to happen:
I expected the notification send properly, but I got an error message instead
Reproducible sample code
index.ts
MainApplication.java
AndroidManifest.xml
app/build.gradle
build.gradle
settings.gradle