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
TypeError: RNOneSignal.initialize is not a function (it is undefined)
Podfile
target 'OneSignalNotificationServiceExtension' do
# Pods for OneSignalNotificationServiceExtension
pod 'OneSignalXCFramework', '>= 5.0.0', '< 6.0'
end
NotificationService.swift
import UserNotifications
import OneSignalExtension
classNotificationService:UNNotificationServiceExtension{varcontentHandler:((UNNotificationContent)->Void)?varreceivedRequest:UNNotificationRequest!varbestAttemptContent:UNMutableNotificationContent?
// etc. as shown in the documentation here https://documentation.onesignal.com/docs/react-native-sdk-setup
PushNotificationProvider.tsx
// Remove this method to stop OneSignal DebuggingOneSignal.Debug.setLogLevel(LogLevel.Verbose);// OneSignal InitializationOneSignal.initialize(OneSignalAppId);// requestPermission will show the native iOS or Android notification permission prompt.// We recommend removing the following code and instead using an In-App Message to prompt for notification permissionOneSignal.Notifications.requestPermission(true).catch((e)=>{Log(LDebug,'OneSignal requestPermission',e)})
Steps to reproduce?
1. Install pod (no problem)
2. Run the application for iOS via Metro
3. Get this error
What did you expect to happen?
Just to build correctly as presented in the documentation.
React Native OneSignal SDK version
Release 5.2.7
Which platform(s) are affected?
iOS
Android
Relevant log output
TypeError: RNOneSignal.initialize is not a function(it is undefined)
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
Hello there, thank you for your patience. Are you still having this issue? If so, can you provide some more details on your setup? Are you adding OneSignal to your app for the first time? Where are you calling the initialize method in the larger scheme of your app's code? It should be called during startup of the application.
You can also try removing the plugin and adding it again.
What happened?
Podfile
NotificationService.swift
PushNotificationProvider.tsx
Steps to reproduce?
What did you expect to happen?
Just to build correctly as presented in the documentation.
React Native OneSignal SDK version
Release 5.2.7
Which platform(s) are affected?
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: