-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS AppDelegate - Override for PerformFetch is not available #7957
Comments
From what I can tell this maybe wasn't ported. Opened a PR with what I think is the fix, but needs some feedback as I'm not really sure. Also, if this is the case, this will be added to .NET 7 at the earliest. I think you can still implement it yourself by adding something like that method in my PR with the attribute above it. It doesn't need to be virtual then :) |
Perfect, thank you @jfversluis |
I believe this might be a candidate to be in the ConfigureLifecycleEvents as well? Basically,
|
@jfversluis |
Any updates? Or any workarounds? |
@g0dpain Can you try something like this? Notice the Export tag and the lack of override. I'm able to call PerformFetch from an iOS 6 15.4 app. Works on Asp.net 7 and iOS 16 as well. Added this to FinishedLaunching. UIApplication.SharedApplication.SetMinimumBackgroundFetchInterval(UIApplication.BackgroundFetchIntervalMinimum); [Export("application:performFetchWithCompletionHandler:")]
public void PerformFetch(UIApplication application, Action<UIBackgroundFetchResult> completionHandler)
{
// Perform task
// Inform system of fetch results
completionHandler(UIBackgroundFetchResult.NewData);
} |
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
It is a large amount of work for a workaround, but I've been able to somewhat work around this by using Shiny.net's background jobs You have to use the latest alpha packages for shiny, and the documentation is lacking; however, if you use their .NET template builder , you can get something that works in both platforms. It is kind of a philosophy change, once you start using 1 or 2 things from Shiny, you start consuming all their things. I've now converted my Json Config reader, background jobs, and local notifications to Shiny's implementation. |
Description
I'm currently migrating my Xamarin.Forms app to .NET MAUI.
Now I stuck on the
BackgroundFetch
on iOS.In Xamarin I was able to override the
PerformFetch
methodIn the .NET MAUI AppDelegate, this method is not available for now.
I searched the docs, but the only thing I found was for Xamarin.Forms.
https://docs.microsoft.com/en-us/dotnet/api/uikit.uiapplicationdelegate.performfetch?view=xamarin-ios-sdk-12
Steps to Reproduce
PerformFetch
method on iOS (AppDelegate)Version with bug
6.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
Any
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: