-
Notifications
You must be signed in to change notification settings - Fork 23
Init() is not working on iOS due to Xamarin.iOS bug in current stable release. #44
Comments
@mandel-macaque Do you know which version of Xamarin.iOS does/will include the bug fix for |
Hello @pavshr and @brminnick the fix you are looking for is included in our vNext builds of Xamarin.iOS at the moment you would need a build from our d16-7 the following come from today's HEAD in order to unblock you: |
Thank you, much appreciated 👍 |
Hello @pavshr and @brminnick, we have new candidate builds based on our current stable d16-6 + the needed fix and you can find them here Please let us know if these works for you. |
Closing this as we have a workaround, and a plan. Thanks all! |
FYI - this fix is now available in the current Preview Channel in Xamarin.iOS v13.20.0.22 |
@brminnick The fix is also included in the current released stable channel Xamarin.iOS 13.18.2.1 in both windows and Mac |
Yes, thank you again, we are now using stable release 13.18.2.1 to build and iOS 13 BGScheduling is not an issue anymore. |
Hello,
I was investigating the functionality of
Init()
API on iOS using cross-platform Xamarin.ExposureNotification library, and see that it does not work as it is intended to.During my tests, I discovered that the background task is not scheduled at all and in fact is never called from the background. It basically means that
UpdateKeysFromServer()
, which is perhaps one of the most important APIs that allows to detect exposures regularly, is not called from background. In our project, we callXamarin.ExposureNotifications.ExposureNotification.Init()
from the AppDelegate'sFinishedLaunching()
method.So I implemented the scheduling task myself, the same way it is done by you guys in the
Init()
API but withoutPlatformIsEnabled()
check and with hardcoded task ID for our project (bundle id + ".exposure-notification"). I did it to secure that the task would be registered by BGTaskScheduler and executed by iOS not depending on any conditions.By doing this, finally, I spotted in VS debug console the execution of the task from the background. However, it failed with an exception with the following error message:
Further search led me to this issue in Xamarin.iOS project: xamarin/xamarin-macios#7456
As I see it, the way I implemented the task by reflecting how it is done in the cross-platform Xamarin.ExposureNotification library will not work due to the bug in current Xamarin.iOS release. Which means that until the fix xamarin/xamarin-macios@c2a220d appears in the stable, or at least the next preview release, the task will not be properly scheduled and executed in the background using the new iOS 13 BGTaskScheduler.
I would really like to hear some thoughts about this issue from Xamarin.ExposureNotification dev team. The way I see it at the moment, it is not possible to release Xamarin.ExposureNotification library without coordination with the Xamarin.iOS release that will include the fix xamarin/xamarin-macios@c2a220d. It looks also that it is not possible to implement a workaround using deprecated API as proposed in xamarin/xamarin-macios#7456 (comment) by @brminnick since we need to do it iOS 13 way via BGTaskScheduler in order to specify the id of the task. And this is the desired way to schedule the task in the background because only this way iOS ensures priority and more time for execution when executing this task:
src: https://developer.apple.com/documentation/exposurenotification/building_an_app_to_notify_users_of_covid-19_exposure
Thank you!
The text was updated successfully, but these errors were encountered: