My problem is that when someone installs the app, logs in and then goes to copy-paste their device key, it doesn’t work, Discourse yields “required plugin ‘discourse_app_notifications’ not found” for the POST /app_notifications/subscribe action (and same for the unsubscribe action). However, when the same person force-quits the app and then does the same step again, there is no error message and the push notifications do work.
What could possibly cause Discourse to recognize the plugin in one case and not recognize it in the other case, when the same call is made from within the app? No changes have been made on the Discourse installation in the meantime and this behaviour is consistent and reproducible.
I do have requires_plugin DiscourseAppNotifications::PLUGIN_NAME, so I’m not sure which change you’re suggesting, if any?
The reason the plugin is structured like this is because I used the Pushover Notifications plugin as a foundation rather than coding from scratch. It’s my first plugin and due to the interaction with the app it’s notoriously difficult to debug, so I was hoping to avoid some bugs this way…