Skip to content

Commit

Permalink
feat: Add SPM support (mparticle-integrations#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
einsteinx2 committed Jan 19, 2024
1 parent f6f5ad2 commit 7773708
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "Iterable/swift-sdk" ~> 6.2.0
github "Iterable/swift-sdk" ~> 6.4.0
github "mparticle/mparticle-apple-sdk" ~> 8.0
34 changes: 34 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "mParticle-Iterable",
platforms: [ .iOS(.v11) ],
products: [
.library(
name: "mParticle-Iterable",
targets: ["mParticle-Iterable"]),
],
dependencies: [
.package(name: "mParticle-Apple-SDK",
url: "https://github.com/mParticle/mparticle-apple-sdk",
.upToNextMajor(from: "8.0.0")),
.package(name: "IterableSDK",
url: "https://github.com/Iterable/swift-sdk",
.upToNextMajor(from: "6.4.0")),
],
targets: [
.target(
name: "mParticle-Iterable",
dependencies: [
.product(name: "mParticle-Apple-SDK", package: "mParticle-Apple-SDK"),
.product(name: "IterableSDK", package: "IterableSDK"),
],
path: "mParticle-Iterable",
exclude: ["Info.plist"],
publicHeadersPath: "."
),
]
)
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This repository contains the [Iterable](https://iterable.com) integration for th

### Adding the integration

1. Add the kit dependency to your app's Podfile or Cartfile:
1. Add the kit dependency to your app's Podfile or Cartfile, or add using SPM:

```
pod 'mParticle-Iterable', '~> 8'
Expand All @@ -18,6 +18,14 @@ This repository contains the [Iterable](https://iterable.com) integration for th

Carthage Note: Due to Carthage limitations with the Iterable SDK project, make sure to use the `--use-xcframeworks --no-use-binaries` flags when running `carthage update`.

OR

```
https://github.com/mparticle-integrations/mparticle-apple-integration-iterable
```

Add as a standard SPM package.

2. Follow the mParticle iOS SDK [quick-start](https://github.com/mParticle/mparticle-apple-sdk), then rebuild and launch your app, and verify that you see `"Included kits: { Iterable }"` in your Xcode console

> (This requires your mParticle log level to be at least Debug)
Expand Down
2 changes: 1 addition & 1 deletion mParticle-Iterable.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ Pod::Spec.new do |s|
s.ios.deployment_target = "11.0"
s.ios.source_files = 'mParticle-Iterable/*.{h,m,mm}'
s.ios.dependency 'mParticle-Apple-SDK/mParticle', '~> 8.0'
s.ios.dependency 'Iterable-iOS-SDK', '~> 6.2'
s.ios.dependency 'Iterable-iOS-SDK', '~> 6.4'
end
4 changes: 4 additions & 0 deletions mParticle-iterable/mParticle_Iterable.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ FOUNDATION_EXPORT const unsigned char mParticle_IterableVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <mParticle_Iterable/PublicHeader.h>

#if defined(__has_include) && __has_include(<mParticle_Iterable/MPKitIterable.h>)
#import <mParticle_Iterable/MPKitIterable.h>
#else
#import "MPKitIterable.h"
#endif

0 comments on commit 7773708

Please sign in to comment.