react-native-background-fetch: Build fails on Mac Catalyst

Your Environment

  • Plugin version: 3.1.0
  • Platform: macOS
  • OS version: Catalina
  • React Native version (react-native -v): 0.63.0

Expected Behavior

Be able to successfully build and use the library when building an iOS app for Mac Catalyst. The BGTaskScheduler which this library uses is available for Mac Catalyst so I’m guessing it should be possible: https://developer.apple.com/documentation/backgroundtasks/bgtaskscheduler?language=objc If it’s not possible to make it work, at least the build should not fail.

Actual Behavior

Build fails in the linking step with the following error: In ../node_modules/react-native-background-fetch/ios/RNBackgroundFetch/TSBackgroundFetch.framework/TSBackgroundFetch(TSBGTask.o), building for Mac Catalyst, but linking in object file built for iOS Simulator, file '../node_modules/react-native-background-fetch/ios/RNBackgroundFetch/TSBackgroundFetch.framework/TSBackgroundFetch' for architecture x86_64

Steps to Reproduce

  1. Turn on Mac Catalyst for your iOS app: https://developer.apple.com/tutorials/mac-catalyst/turning-on-mac-catalyst
  2. Change the XCode target to “My Mac” and build the app.

Context

The library works perfectly when building for iOS.

Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (14 by maintainers)

Most upvoted comments

I just checked it and it appears you still have the “bushy” file structure

Done.

This is going to be a few more days yet. I’m going to package this update with another feature that’s been waiting to get out the door for months but was delayed due to Android 11 / iOS 14BackgroundFetch will now support a new “timeout callback”, called when the OS reports your task is about to expire.

But everything is under control wrt the TSBackgroundFetch.xcframework and Catalyst support.

@mikehardy Ok, I’ve got TSBackgroundFetch.xcframework building and working in the example app. Thanks for the recipe.