Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 10095 [details]
When running an iOS project using Run With->iOS Simulated Background Fetch Debugger context menu, it is expected that the PerformFetch method will be called right away for debugging purposes. However this does not seem to be occurring.
## Steps to reproduce
1. Open the attached test project.
2. Right click on the project in the Solution Explorer and select Run With-> iOS Simulated Background Fetch Debugger.
Expected result: PerformFetch method will be called.
Actual result: method is not called.
Might not be a Xamarin issue, but it is also noted that PerformFetch does not seem to be called when the project is run on the simulator (after a long wait), but is called when run on device. To try to speed up when the method gets called, open and close the app a few times to make iOS think the app is used a lot which will cause PerformFetch to be called more often. The PerformFetch method was called on my device (iPhone 5s running iOS 8.1.3) after a few minutes of waiting, but not on the simulator.
After launching (using "Run -> Run With -> iOS Simulated Background Fetch Debugger"), do "Run ->Simulate iOS Background Fetch".
Thanks Rolf, sorry I missed that menu item. :-(
PerformFetch never called:
I heave tried several test projects, including the one attached in this bug report but PerformFetch is never called, not on a real device, neither on a simulator.
I have tried the "Simulate iOS Background Fetch" option and set a breakpoint in the PerformFetch method but it is never hit. I have also run the test app for a couple of days on my device but the PerformFetch is never called. The Info.plist background modes are set correctly to "Enable Background Modes" and "Background Fetch"
I am running XS 5.10.3 (build 51) on a macbook pro with osx 10.10.5.
Real devices: Iphone 6S iOS 9.3.1, iPad mini iOS 9.3.2
Simulator: iPhone 6S iOS 9.2
Am I still missing something or are there any known issues here that I should be aware of?
Simulating background fetch should work in the simulator (there was a bug where it didn't work, but we fixed that for Xamarin.iOS 9.4). Maybe you can try a sample project that is known to work to determine if there's something different with your project: https://github.com/Redth/iOS.BackgroundFetch.Sample?
Hi Rolf, I have just checked the sample project you provided. This project still uses MonoTouch so I had to migrate it to Xamarin.iOS Unified API and double checked the background modes. But the same issue occurs: I have set 2 breakpoints:
1) in FinishedLaunching
2) in PerformFetch
breakpoint #1 is hit but #2 is hollow and is never hit when running the "Simulate iOS Background Fetch" option, both on simulator and real device (iPhone 6s ios 9.3.2)
Mac OS X 10.10.5
Xamarin Studio Business
Version 5.10.3 (build 51)
Version: 126.96.36.199 (Xamarin Business)
Would you be able to check on your side if this works? Thanks!
Also, the Background.Sample uses the openweathermap api, which now requires an api key. After obtaining an api key I found out that the data scheme has changed, so this sample is outdated. Better use the attached sample because it doesn't use any third party api's.