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

Getting TypeError: Cannot read property 'then' of undefined when calling getNotificationSettings (on Android) #1025

Closed
clauderobi opened this issue Apr 6, 2024 · 2 comments

Comments

@clauderobi
Copy link

I am getting the " Cannot read property 'then' of undefined" error message when using getNotificationSettings

Here is the output on the console:

LOG  17:11:24.221 - Notification - Calling notifee.getNotificationSettings
 ERROR  TypeError: Cannot read property 'then' of undefined, js engine: hermes
 LOG  17:11:24.483 - Notification - Current settings are {
  "authorizationStatus": 1,
  "android": {
    "alarm": 1
  },
  "ios": {
    "alert": 1,
    "badge": 1,
    "criticalAlert": 1,
    "showPreviews": 1,
    "sound": 1,
    "carPlay": 1,
    "lockScreen": 1,
    "announcement": 1,
    "notificationCenter": 1,
    "inAppNotificationSettings": 1,
    "authorizationStatus": 1
  },
  "web": {}
}

And the relevant code:

    log('Calling notifee.getNotificationSettings')
    const settings = await notifee.getNotificationSettings();
    log('Current settings are ' + JSON.stringify(settings, null, 2))

(log is my logging function that simply prepend the output with a timestamp and a prefix))

Notifee is 7.8.2

@clauderobi
Copy link
Author

My bad....

I call calling my overall function from within a Firebase callback without properly awaiting for it.

Copy link

github-actions bot commented May 4, 2024

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant