Pub/sub + queue pattern from mobile plugin (V2) #11058
Unanswered
gordongrech
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
We are developing an app for Android and iOS, the app will make use of VOIP and standard notifications and we are working on a plugin to work with APNS/FCM.
In terms of integration all is fine, however when it comes to receiving notifications back in Rust we are encountering some difficulties. The approach we have taken so far is to implement a loop and a "long polling" mechanism as follows:
The above more or less works but is causing timing issues as we start this loop in setup after loading the plugin.
For this to work more consistently we need to add a delay between loading the plugin and starting the loop, otherwise, sometimes the loop never starts (or starts and silently exists).
Listening for events as early as possible is important for us, especially for VOIP notifications. When a Voip notification comes into Swift, Swift needs to notify Rust to process the notification, however if the loop has not started yet, notification would get lost.
Is there a better (maybe queue / pub/sub) pattern we can adopt for mobile plugins to publish events to be processed by Rust?
Thanks,
Gordon
Beta Was this translation helpful? Give feedback.
All reactions