fix(native): add podspec to sofa-widgets-support module to resolve CocoaPods module map build failure

This commit is contained in:
2026-03-22 18:40:36 -04:00
parent f2f5e823f4
commit 91ca6ab3c0
8 changed files with 36 additions and 13 deletions
@@ -0,0 +1,6 @@
{
"platforms": ["ios"],
"ios": {
"modules": ["SofaWidgetsSupportModule"]
}
}
@@ -1,7 +1,7 @@
import { Platform } from "react-native"; import { Platform } from "react-native";
function getModule() { function getModule() {
return require("./src/WidgetImagesModule").default; return require("./src/SofaWidgetsSupportModule").default;
} }
export async function downloadWidgetImage(url: string, key: string): Promise<string | null> { export async function downloadWidgetImage(url: string, key: string): Promise<string | null> {
@@ -0,0 +1,23 @@
Pod::Spec.new do |s|
s.name = 'SofaWidgetsSupport'
s.version = '1.0.0'
s.summary = 'Native helpers for Sofa iOS widgets'
s.description = 'Image downloading and caching for Sofa widget extensions'
s.author = ''
s.homepage = 'https://docs.expo.dev/modules/'
s.platforms = {
:ios => '15.1',
:tvos => '15.1'
}
s.source = { git: '' }
s.static_framework = true
s.dependency 'ExpoModulesCore'
# Swift/Objective-C compatibility
s.pod_target_xcconfig = {
'DEFINES_MODULE' => 'YES',
}
s.source_files = "**/*.{h,m,mm,swift,hpp,cpp}"
end
@@ -4,9 +4,9 @@ import UIKit
private let groupIdentifier = "group.com.jakejarvis.sofa" private let groupIdentifier = "group.com.jakejarvis.sofa"
private let imageDirectory = "widget_images" private let imageDirectory = "widget_images"
public class WidgetImagesModule: Module { public class SofaWidgetsSupportModule: Module {
public func definition() -> ModuleDefinition { public func definition() -> ModuleDefinition {
Name("WidgetImages") Name("SofaWidgetsSupport")
AsyncFunction("downloadWidgetImage") { (url: String, key: String) -> String? in AsyncFunction("downloadWidgetImage") { (url: String, key: String) -> String? in
guard let imageUrl = URL(string: url) else { guard let imageUrl = URL(string: url) else {
@@ -0,0 +1,3 @@
import { requireNativeModule } from "expo";
export default requireNativeModule("SofaWidgetsSupport");
@@ -1,6 +0,0 @@
{
"platforms": ["ios"],
"ios": {
"modules": ["WidgetImagesModule"]
}
}
@@ -1,3 +0,0 @@
import { requireNativeModule } from "expo";
export default requireNativeModule("WidgetImages");
+1 -1
View File
@@ -5,7 +5,7 @@ import { resolveUrl } from "@/lib/server";
import type { ContinueWatchingProps } from "@/widgets/continue-watching"; import type { ContinueWatchingProps } from "@/widgets/continue-watching";
import type { UpcomingProps } from "@/widgets/upcoming"; import type { UpcomingProps } from "@/widgets/upcoming";
import { copyBundledAsset, downloadWidgetImage } from "../../modules/widget-images"; import { copyBundledAsset, downloadWidgetImage } from "../../modules/sofa-widgets-support";
/** Resolve a potentially-relative image path to an absolute URL and download it. */ /** Resolve a potentially-relative image path to an absolute URL and download it. */
async function downloadImage(path: string | null, key: string): Promise<string | null> { async function downloadImage(path: string | null, key: string): Promise<string | null> {