[EN] [XPlat] Add support for iOS 12.5 #1074
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
iOS 12.5 Support
This PR adds the support for iOS 12.5 notifications. To enable this platform, no actual code needs to change. This is done by leveraging the
ScheduleFetch
method to determine which task registration method to use - either BGTask or the new way. This method is actually called byInit
, so it happens early on.IsSupported
On platforms that do not support EN, such as iOS 10 or iOS 13.2, then it will now throw. To detect these scenarios, there is a new property
IsSupported
that can be used to display messages to the user. If it istrue
, then it does not guarantee that everything is ready to be used, but if it isfalse
, then it is guaranteed that EN cannot be used.The reason for this is that it will typically return
true
, and then if the user denies permissions or (on Android) GPS is out of date, or on iOS there is some extra criteria. These will be handled by the normal exceptions (unchanged). When this returns false, it means that there is no EN support at all. Either no APIs or GPS explicitly indicated that there is no EN support on the device.If there is a case where this property is returning
true
and it can be pre-determined that it should return false, feel free to open an issue and I will try make sure we handle those extra cases.