Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FATAL: OneSignal AppId: (null) - AppId is null or format is invalid, stopping #946

Closed
2 of 3 tasks
v12cicd opened this issue Dec 6, 2023 · 6 comments
Closed
2 of 3 tasks

Comments

@v12cicd
Copy link

v12cicd commented Dec 6, 2023

What happened?

app stuck juste after the lunch screen

Steps to reproduce?

I followed exactly the steps described at the wiki page https://documentation.onesignal.com/docs/cordova-sdk-setup

What did you expect to happen?

at the minimum the app works

OneSignal Cordova SDK version

5.0.4

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

2023-12-06 19:35:41.522750+0100 gpsfleet[14810:3659793] Apache Cordova iOS platform version 7.0.1 is starting.
2023-12-06 19:35:41.531322+0100 gpsfleet[14810:3659793] FATAL: OneSignal AppId: (null) - AppId is null or format is invalid, stopping initialization.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@TobiTobsn007
Copy link

I'm using v5.0.5 and have the same problem. Is there any update regarding this issue?

@TobiTobsn007
Copy link

@v12cicd I solved my problem. It seems, that the error message FATAL: OneSignal AppId: (null) - AppId is null or format is invalid, stopping initialization. has no negative effects. My problem was the buildOptimizer when building on prod configuration. Setting it to false in angular.json solved the problem.

After changing
OneSignal.Debug.setLogLevel(LogLevel.Verbose);
to
OneSignal.Debug.setLogLevel(6);
I could activate the buildOptimizer and everything works fine. Try it and let me know!

@EinfachHans
Copy link

Happens for me in Capacitor with 5.1.0 as well. As mentioned here, a small timeout seems to fix it.

Anyways it has negative effects, because the subscription id is null in the sdk if this happens.

@mariusbolik
Copy link

On Ionic / Angular you can add the following line before the OneSignal Plugin Initialization:

await this.platform.ready();

This also seems to fix the error!

@leemind
Copy link

leemind commented Jul 27, 2024

For anyone coming to this thread who uses Meteor (Cordova under the hood) I found this worked:

// Accounts.onLogin()
if (Meteor.isCordova) {
    console.log("isCordova - setting up push notifications");
    // This only runs when the device is ready - jQuery .ready() function shorthand (recommended)
    $(setupNotifications)
  }

function setupNotifications() {
  console.log("In setupNotifications")
  OneSignal.Debug.setLogLevel(6)
  OneSignal.initialize(oneSignalAppID)
  
  console.log("Logging into OneSignal with userID",Meteor.userId())
  OneSignal.login(Meteor.userId())

  OneSignal.Notifications.requestPermission(true).then((accepted) => {
    console.log("User accepted notifications: ",accepted);
});
}

@nan-li
Copy link
Contributor

nan-li commented Aug 6, 2024

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.

If you are seeing other issues or side-effects, please open a new issue with your description.

@nan-li nan-li closed this as completed Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants