Your custom hook is never triggered because you are not subscribing to it the right way!
Context
Although you are calling it in your class function, it is never executed beyond that point.
Place the add_action function somewhere else like in a plugins_loaded hook. Put it outside your class where it can be seen.
Dependencies
Where are the variables $message and $deviceTokens declared? if they are not, the wp_schedule_single_event will fail! So no event is scheduled in the first place!
Related Posts:
- WP Cron Doesn’t Execute When Time Elapses
- Update a costume wp_usermeta key back to 0 every 24hours (time can be specified as needed)
- Duplicate Cron Jobs Using wp_next_scheduled / wp_schedule_event
- wp cron job fires at every second or so, if callback is wrapped with DOING_CRON check it never fires at all
- WordPress cronjob get scheduled but function does not run
- Hourly events don’t get triggered
- WooCommerce: change display order of product short description and price [closed]
- Use wp init hook to call other hooks?
- What is the difference between update_post_meta and update_postmeta hooks?
- How to remove action hook done in a plugin from functions.php in my theme?
- Hooks for trashing, deleting, saving, restoring custom post type
- Is there a WordPress core & plugins update action hook?
- trigger save_post event programmatically
- is it possible to get the hook name in add_action?
- What hook is executed just after wp_query has been executed?
- WordPress scheduled task is called but not executed
- Use $query->set multiple times with pre_get_posts?
- How to properly test a method that is called by an action hook
- How can I do customizations on login, registration and password recovery forms?
- Searching hook to set cookies before and avoid “headers already sent”
- Custom form action hook
- Hook before inserting user into database [duplicate]
- How to send an automated user ‘inactivity’ email?
- How do I successfully create a hook for an email override?
- Cast string to number
- How to debug user_register hook
- Storing state between hook functions
- Using wp_editor tinyMCE in metabox cause form alert on leaving page
- What’s the difference between “wp” and “wp_loaded”?
- WordPress capabilities and restricted categories access
- Need to check is_archive during init
- When WP_CLI runs WordPress from the command line, are hooks called?
- How to use custom form on add_meta_boxes callback
- Is it possible to switch Gutenberg’s editor styles when document settings change?
- schedule event in class oriented plugin
- How can I find the hook I need to rewrite a function?
- Displaying list of cities according to the selected state. Using the WordPress hook
- Removing parent theme action on pluggable function not working
- Removing a Filter
- Which action hook should I use to intercept a form upon submission?
- Would there be anything stopping me from removing both wp_head and wp_footer?
- Where Are Hooks?
- WordPress wp_loaded action hook
- How to get user meta fields that have just been updated?
- admin_notices action doesn’t trigger within save_post action
- When a plugin gets updated from the repo, does the “activation” hook fire again?
- Check if `do_action()` in WordPress returns any result
- How to cancel an action hooked to untrash_post? or any hook
- add_action hook for publish_post not working
- Modify Notification Message When Profile Updated
- Divi hook not working [closed]
- Add WordPress hook outside of Plugin or Theme
- WordPress plugin activation, deactivation and uninstall hook not being triggered
- How to perform action when plugin/theme editor is used?
- Hook for inserting?
- What is the proper hook to use for recording a post view?
- How to stop WordPress from updating the post meta
- Woocommerce single_product_summary hook not working
- No result update a custom field using wp_schedule_event
- Where is publish_post hook fired?
- A good hook to check authorization and redirect?
- Bloginfo hook – can it be more precise?
- Custom posts and get_post_meta in {$post_status}_{$post_type}
- Hooking custom PHP output into WP: how to do it, parse_request almost works but not quite
- How to set Media Box form elements default value?
- Print on screen during shutdown hook – error during saving in theme-editor.php
- How to stop execution of a function via add_action hook?
- changing genesis_before_while in new theme framework
- Moving Javascript from footer to header
- Adding a new hidden field based on a condition in Ninja Forms
- Forcing WooCommerce customers to create account before checking out
- Store user ID on wp_term_taxonomy when new term inserted
- ‘user_register’ hook – need to distinguish if created from wp admin panel
- Make multiple URLs behave as home page
- Debug a WP install: how to find which functions write post updates during a process (a woocommerce checkout in my case)
- Transition_Post_Status hook not working properly
- Wodpress XML Import hooks
- profile_update hook does not fire from front-end
- wp_update_post not getting triggered by hook
- How to get user profile information before update?
- Problem with call_user_func_array front end
- Why is pre_get_posts hook invoked multiple times?
- Undefined fieldId in gform.addFilter for limiting dates in datepicker – Gravity Forms
- How to override get_avatar() function?
- Get First Post content and edit it using pre_get_posts (or similar?!)
- Are there Hooks for featured image popup?
- WordPress sending data with add_action
- How to hide / remove attachment “alt” or “caption” field in Admin?
- Why does get_post() not return anything?
- WordPress save_post hook not firing when checking if _GET[‘post’] is set
- Access post meta just after publishing
- Which hook runs first(init,… or ???) [duplicate]
- Which hook should I use for this scenario regarding the registration process and account/profile update?
- Redirect back to origin page after using get_delete_post_link()
- Is there any Reference of WordPress hook and hacks? [closed]
- Thesis Theme -> hooks not working for custom function
- Can I display text that’s generated by a hook in another place in the HTML?
- Get post ID before add_theme_support
- Is there a way to assign a default Category to a Post when the user creates a new Post?
- is_user_logged_in() doesn’t work after custom login and redirect