Open ashwinThomas04 opened 11 months ago
The app is working fine in android without any build errors. I'm facing this issue when I try to build app for IOS.
Hi @ashwinThomas04 thank you for your patience. Are you still having this issue? If so would you be able to share the initialization code you used?
Hi @jennantilla , I reverted back to previous react-native version as I was still facing the issue.
useEffect(( )=>{
const initializeOnesignal=( )=>{
OneSignal.Debug.setLogLevel(LogLevel.Verbose);
OneSignal.initialize(ONE_SIGNAL_ID);
}
initializeOnesignal( );
},[]);
This is the initialization code. I tried removing all instances of Onesignal from the js code and run the app in the latest version, but the error was coming up again in IOS.
@jennantilla , this error came up when I migrated from 4.4.1 to 5.0.2, as a part of updating the app. I followed the migration guides and believe I made the necessary changes. The app was working fine in android and there was no issue in receiving notifications either. But when I tried building for IOS, the app was getting stuck at the splash screen after the build succeeded message. This was the only error I could find in the metro console. I rechecked the onesignal documentation a few times, but I'm not sure if I missed out anything during the migration process.
I had exactly the same problem on version 5.0.3
. Switching back to version 4.5.2
solved it: the error disappeared
Same issue in ionic Cordova
same issue in cordova 12.0.0
source 'https://cdn.cocoapods.org/'
platform :ios, '11.0'
use_frameworks!
target 'myproject' do
project 'myproject.xcodeproj'
pod 'OneSignalXCFramework', '5.0.4'
end
target 'OneSignalNotificationServiceExtension' do
pod 'OneSignalXCFramework', '5.0.4'
end
FATAL: OneSignal AppId: (null) - AppId is null or format is invalid, stopping
Hi I have updated the whole application to Cordova 12. Added the Onesignal plugin and got the same error when I started the Iphone 15 emulator. I solved it by adding a setTimeout.
document.addEventListener('deviceready', OneSignalInit, false);
function OneSignalInit()
{
setTimeout(() =>
{
window.plugins.OneSignal.initialize("MY_ID");
const listener = (event) =>
{
const notificationData = JSON.stringify(event);
//redirect alla pagina delle notifiche;
};
window.plugins.OneSignal.Notifications.addEventListener("click", listener);
},1000);
}
in One signal Subscriptions I have the Subscription ID => Simulator Iphone 17.0.1
Same error happened today for me with latest Capacitor version. Adding a small timeout seems to fix it - can someone look into it?
Facing the same issue, while running the app in Xcode. Anyone able to resolve it?
FATAL: OneSignal AppId: (null) - AppId is null or format is invalid, stopping initialization. Example usage: 'b2f7f966-d8cc-11e4-bed1-df8f05be55ba'
Facing the same issue with a brand new installation of cordova, with only the onesignal plugin and the basic helloworld demo app. The onesignal plugin spits out this error :FATAL: OneSignal AppId: (null) even before the deviceready function is called.
Hi everyone, since you are using one of our cross-platform SDKs, this is a misleading error message that prints from the integration of our cross platform SDK with our native iOS SDK.
Please check your logs to see if the following prints after the FATAL log, that the App ID is successfully set, so you can safely ignore the error log.
VERBOSE: setAppId called with appId: abcd-1234-abcd-1234
VERBOSE: launchOptions is set and appId of abcd-1234-abcd-1234 is set, initializing OneSignal...
This is an alarming error log and misleading, we will work on suppressing or rewording the log.
I've reverted to version 3.3.1 and the error has been resolved.
I can confirm that the above is not printed after the fatal error. Heres a copy of my log before i reverted back to v3.3.1
Apache Cordova iOS platform version 7.1.1 is starting. FATAL: OneSignal AppId: (null) - AppId is null or format is invalid, stopping initialization. Example usage: 'b2f7f966-d8cc-11e4-bed1-df8f05be55ba' Warning: -[BETextInput attributedMarkedText] is unimplemented CDVWebViewEngine will reload WKWebView if required on resume Using WKWebView [CDVTimer][console] 0.059009ms [CDVTimer][handleopenurl] 0.018001ms [CDVTimer][intentandnavigationfilter] 1.026034ms [CDVTimer][gesturehandler] 0.066042ms [CDVTimer][TotalPluginStartup] 1.471996ms nw_application_id_create_self NECP_CLIENT_ACTION_GET_SIGNED_CLIENT_ID [80: Authentication error] Failed to resolve host network app id The preference key "AutoHideSplashScreen" is not defined and will default to "TRUE"
Its worth noting that onesignal is not initializing and the functions are not available to the app. for example when i try to call the log function:
window.plugins.OneSignal.setLogLevel is not a function. (In 'window.plugins.OneSignal.setLogLevel(6, 0)', 'window.plugins.OneSignal.setLogLevel' is undefined)
The error everyone is describing is occurring BEFORE the deviceready function.
Also - specifically for me I'm using onesignal-cordova-plugin rather than react-native-onesignal but the error is exactly the same which is why i posted here
What happened?
Recently updated to 5.0.2 to 4.4.1 and made the necessary migration changes. But facing this issue everytime I build the app. The app seems to be stuck with only this in the log. Its working fine for android. Is there something I missed during migration.
Steps to reproduce?
What did you expect to happen?
I expected the app to not crash.
React Native OneSignal SDK version
5.0.2
Which platform(s) are affected?
Relevant log output
Code of Conduct