Skip to content

Schedule plugin compatible notifications by inserting JSON messages into the execution queue

Compare
Choose a tag to compare
@shankari shankari released this 23 Feb 07:33
· 4 commits to master since this release
d65e4f8

This is required because the AppLocalNotification class on iOS, unlike android does not have a public implementation of the schedule method and even the private method wraps runInBackground.

So we create a message that corresponds to the call we want to make and execute it through the existing command queue.

We also tried calling [AppLocalNotification schedule:command] directly, but then the commandDelegate in the schedule implementation is NULL so the actual notification is never scheduled.

TODO: Also experiment with calling it through a category, although there isn't very much code we can reuse. Alternatively, pull out the "execute via plugin" functionality into a separate module so we can potentially reuse it elsewhere.

Equivalent android change was in cd23a33