OneSignal / OneSignal-Flutter-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your flutter app with OneSignal
https://www.onesignal.com
Other
606 stars 204 forks source link

[Bug]: OneSignal Initialization Fails with Null AppId - "FATAL: OneSignal AppId: (null)" #852

Closed burhanaksendir closed 3 months ago

burhanaksendir commented 4 months ago

What happened?

OneSignal initialization fails with the following error message: "FATAL: OneSignal AppId: (null) - AppId is null or format is invalid, stopping initialization."

Steps to reproduce?

1. Initialize OneSignal in the Flutter application with a valid AppId.
2. Ensure that the AppId is correct and in the proper format.
3. Run the application for the first time.
4. Observe the error in the log output.

What did you expect to happen?

I expected OneSignal to initialize successfully without any errors when providing a valid AppId.

OneSignal Flutter SDK version

5.1.0

Which platform(s) are affected?

Relevant log output

FATAL: OneSignal AppId: (null) - AppId is null or format is invalid, stopping initialization.

Code of Conduct

nan-li commented 3 months ago

Hi @burhanaksendir, thanks for reporting. This is a misleading log on a new app install. Initialization did not fail.

This is logged by the native iOS SDK that the Flutter SDK calls into and the app ID has not been set YET by the developer. The Flutter SDK needs initialize the native iOS SDK in order to pass along iOS launch options very early in the app startup process.

If you turn on verbose-level logging, you should see VERBOSE: setAppId called with appId: <YOUR_APP_ID> being logged shortly after the Fatal log you reported. Sorry for any confusion this log caused.