Launch BGAppRefreshTaskRequest in simulator is not working

Hi,

I tried to launch the BGAppRefreshTaskRequest from ColorFeed sample project on simulator. It is not working. Any idea why?

Here is logging. 2022-03-16 09:59:18.133956-0400 ColorFeed[1225:23444] Simulating launch for task with identifier com.example.apple-samplecode.ColorFeed.refresh

2022-03-16 09:59:21.510051-0400 ColorFeed[1225:24949] No task request with identifier <decode: missing data> has been scheduled

The command for debugger: e -l objc -- (void)[[BGTaskScheduler sharedScheduler] _simulateLaunchForTaskWithIdentifier:@"com.example.apple-samplecode.ColorFeed.refresh"]

ColorFeed project: https://developer.apple.com/documentation/backgroundtasks/refreshing_and_maintaining_your_app_using_background_tasks

Replies

See https://developer.apple.com/forums/thread/14855, "Testing Background Session Code".

  • Not sure how it is related. Can you explain for more detail? Thank you!

  • The link explains how to test Background Session code, which is what you want to do.

Add a Comment