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

Uncaught TypeError: Cannot call method 'apply' of undefined at local-notification-util.js:252 #557

Closed
hagaisela opened this issue May 20, 2015 · 3 comments

Comments

@hagaisela
Copy link

I am getting this error on android 4.4 (LG G2). I am not sure when exactly it happens, it may be when I click a notification when the app is not running.

@appastair
Copy link

Without providing anything other than the error message to attempt reproduction, we can only guess as to the cause. My guesses...:

  1. You have not included some necessary JavaScript (or it has not yet been run when you're hitting this error).
  2. You have specified a callback function for your notification but failed to define the function.

@hagaisela
Copy link
Author

My bad, it was 2. The function was defined in the wrong object. Suggestion - check if the function is defined and log it's name as an error message instead of just failing to call it.

@appastair
Copy link

I don't think that callback-checking would really benefit anyone. The error told you it's undefined. A routine chock to log tyecsame thong seems overkill but adding your own wouldn't be tough. 😛

Extend the function (or callback) with something like (typeof(callback) !== 'function'){}. Outside of development/debugging, type-checking every time seems overkill.

Anyway - I'm glad you fixed it!! 🙌

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

3 participants