Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add SPM support #16

Merged
merged 7 commits into from
Jan 19, 2024
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: 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