Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/expo-background-task/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

### 🐛 Bug fixes

- [iOS] Fix precompiled XCFramework builds resolving the task service helper. ([#46188](https://github.com/expo/expo/pull/46188) by [@chrfalch](https://github.com/chrfalch))

### 💡 Others

## 56.0.14 — 2026-05-23
Expand Down
11 changes: 9 additions & 2 deletions packages/expo-background-task/ios/EXTaskServiceHelper.m
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
#import "EXTaskServiceHelper.h"
#import <ExpoTaskManager/EXTaskService.h>

@implementation EXTaskServiceHelper

+ (nullable id<EXTaskServiceInterface>)sharedTaskService {
return (id<EXTaskServiceInterface>)EXTaskService.shared;
Class taskServiceClass = NSClassFromString(@"EXTaskService");
if (![taskServiceClass respondsToSelector:@selector(shared)]) {
return nil;
}
id instance = [taskServiceClass performSelector:@selector(shared)];
if (![instance conformsToProtocol:@protocol(EXTaskServiceInterface)]) {
return nil;
}
return (id<EXTaskServiceInterface>)instance;
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ final class BackgroundTaskSchedulerTests: XCTestCase {
try await super.tearDown()
}

func testTaskServiceHelperResolvesSharedTaskService() {
XCTAssertNotNil(EXTaskServiceHelper.sharedTaskService())
}

func testConcurrentScheduleWorkerCallsDoNotOverlapCancel() async throws {
let scheduler = OverlapDetectingScheduler()

Expand Down
23 changes: 22 additions & 1 deletion packages/expo-background-task/spm.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,26 @@
"expo-modules-core/ExpoModulesCore"
],
"targets": [
{
"type": "objc",
"name": "ExpoBackgroundTask_ios_objc",
"moduleName": "ExpoBackgroundTask",
"path": "ios",
"pattern": "**/*.m",
"headerPattern": "**/*.h",
"dependencies": [
"ReactNativeDependencies",
"React",
"Hermes",
"expo-modules-core/ExpoModulesCore"
],
"linkedFrameworks": [
"Foundation"
],
"includeDirectories": [
"."
]
},
{
"type": "swift",
"name": "ExpoBackgroundTask",
Expand All @@ -26,7 +46,8 @@
"Hermes",
"React",
"ReactNativeDependencies",
"expo-modules-core/ExpoModulesCore"
"expo-modules-core/ExpoModulesCore",
"ExpoBackgroundTask_ios_objc"
],
"linkedFrameworks": [
"Foundation",
Expand Down
Loading