-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPackage.swift
More file actions
47 lines (45 loc) · 2.04 KB
/
Package.swift
File metadata and controls
47 lines (45 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// swift-tools-version: 5.9
import PackageDescription
let package = Package(
name: "OnesignalCapacitorPlugin",
platforms: [.iOS(.v14)],
products: [
.library(
name: "OnesignalCapacitorPlugin",
targets: ["OnesignalCapacitorPlugin"]
)
],
dependencies: [
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", "7.0.0"..<"9.0.0"),
.package(url: "https://github.com/OneSignal/OneSignal-XCFramework", from: "5.0.0")
],
targets: [
// Obj-C helper that captures the iOS launchOptions dictionary at
// process start (via +load + UIApplicationDidFinishLaunchingNotification)
// so cold-start notification taps are still available when the JS
// layer initializes the plugin later. SPM cannot mix Swift and Obj-C
// in the same target, so this lives as its own target.
.target(
name: "OSCapacitorLaunchOptions",
path: "ios/Sources/OSCapacitorLaunchOptions",
publicHeadersPath: "include"
),
.target(
name: "OnesignalCapacitorPlugin",
dependencies: [
.product(name: "Capacitor", package: "capacitor-swift-pm"),
.product(name: "Cordova", package: "capacitor-swift-pm"),
// InAppMessages and Location are separate library products in
// OneSignal-XCFramework and must be linked explicitly under SPM,
// otherwise their xcframeworks aren't loaded and the namespaces
// are silent no-ops at runtime.
.product(name: "OneSignalFramework", package: "OneSignal-XCFramework"),
.product(name: "OneSignalInAppMessages", package: "OneSignal-XCFramework"),
.product(name: "OneSignalLocation", package: "OneSignal-XCFramework"),
.product(name: "OneSignalExtension", package: "OneSignal-XCFramework"),
"OSCapacitorLaunchOptions"
],
path: "ios/Sources/OneSignalCapacitorPlugin"
)
]
)