Skip to content

Commit

Permalink
feat: add spm support for customerio integration (#10)
Browse files Browse the repository at this point in the history
* chore: add package.swift file

* chore: add package resolved file

* chore: update README.md
  • Loading branch information
SKannaniOS authored Sep 9, 2024
1 parent ee01b60 commit cc4687c
Show file tree
Hide file tree
Showing 5 changed files with 255 additions and 1 deletion.
196 changes: 196 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
{
"object": {
"pins": [
{
"package": "abseil",
"repositoryURL": "https://github.com/google/abseil-cpp-binary.git",
"state": {
"branch": null,
"revision": "194a6706acbd25e4ef639bcaddea16e8758a3e27",
"version": "1.2024011602.0"
}
},
{
"package": "AppCheck",
"repositoryURL": "https://github.com/google/app-check.git",
"state": {
"branch": null,
"revision": "3b62f154d00019ae29a71e9738800bb6f18b236d",
"version": "10.19.2"
}
},
{
"package": "CioAnalytics",
"repositoryURL": "https://github.com/customerio/cdp-analytics-swift.git",
"state": {
"branch": null,
"revision": "516475daea9ef1914eab09a5af8b7cf07253b71f",
"version": "1.5.13+cio.1"
}
},
{
"package": "RSCrashReporter",
"repositoryURL": "https://github.com/rudderlabs/crash-reporter-ios",
"state": {
"branch": null,
"revision": "ee563535b64d9d5feacd0fa243663b2658033a19",
"version": "1.0.1"
}
},
{
"package": "Customer.io",
"repositoryURL": "https://github.com/customerio/customerio-ios",
"state": {
"branch": null,
"revision": "c15e7a14d952728bf32fd5a4ab8419713244fec9",
"version": "3.2.2"
}
},
{
"package": "Firebase",
"repositoryURL": "https://github.com/firebase/firebase-ios-sdk.git",
"state": {
"branch": null,
"revision": "eca84fd638116dd6adb633b5a3f31cc7befcbb7d",
"version": "10.29.0"
}
},
{
"package": "GoogleAppMeasurement",
"repositoryURL": "https://github.com/google/GoogleAppMeasurement.git",
"state": {
"branch": null,
"revision": "fe727587518729046fc1465625b9afd80b5ab361",
"version": "10.28.0"
}
},
{
"package": "GoogleDataTransport",
"repositoryURL": "https://github.com/google/GoogleDataTransport.git",
"state": {
"branch": null,
"revision": "a637d318ae7ae246b02d7305121275bc75ed5565",
"version": "9.4.0"
}
},
{
"package": "GoogleUtilities",
"repositoryURL": "https://github.com/google/GoogleUtilities.git",
"state": {
"branch": null,
"revision": "57a1d307f42df690fdef2637f3e5b776da02aad6",
"version": "7.13.3"
}
},
{
"package": "gRPC",
"repositoryURL": "https://github.com/google/grpc-binary.git",
"state": {
"branch": null,
"revision": "e9fad491d0673bdda7063a0341fb6b47a30c5359",
"version": "1.62.2"
}
},
{
"package": "GTMSessionFetcher",
"repositoryURL": "https://github.com/google/gtm-session-fetcher.git",
"state": {
"branch": null,
"revision": "a2ab612cb980066ee56d90d60d8462992c07f24b",
"version": "3.5.0"
}
},
{
"package": "InteropForGoogle",
"repositoryURL": "https://github.com/google/interop-ios-for-google-sdks.git",
"state": {
"branch": null,
"revision": "2d12673670417654f08f5f90fdd62926dc3a2648",
"version": "100.0.0"
}
},
{
"package": "JSONSafeEncoding",
"repositoryURL": "https://github.com/segmentio/jsonsafeencoding-swift.git",
"state": {
"branch": null,
"revision": "af6a8b360984085e36c6341b21ecb35c12f47ebd",
"version": "2.0.0"
}
},
{
"package": "leveldb",
"repositoryURL": "https://github.com/firebase/leveldb.git",
"state": {
"branch": null,
"revision": "a0bc79961d7be727d258d33d5a6b2f1023270ba1",
"version": "1.22.5"
}
},
{
"package": "MetricsReporter",
"repositoryURL": "https://github.com/rudderlabs/metrics-reporter-ios",
"state": {
"branch": null,
"revision": "e307fa37c6c2d2cccf787d73b5b4b5bc3f650435",
"version": "2.0.0"
}
},
{
"package": "nanopb",
"repositoryURL": "https://github.com/firebase/nanopb.git",
"state": {
"branch": null,
"revision": "b7e1104502eca3a213b46303391ca4d3bc8ddec1",
"version": "2.30910.0"
}
},
{
"package": "Promises",
"repositoryURL": "https://github.com/google/promises.git",
"state": {
"branch": null,
"revision": "540318ecedd63d883069ae7f1ed811a2df00b6ac",
"version": "2.4.0"
}
},
{
"package": "RudderKit",
"repositoryURL": "https://github.com/rudderlabs/rudder-ios-kit",
"state": {
"branch": null,
"revision": "8a557a80cc1b0e0bc948c2b17fe0fd3809bcfd61",
"version": "1.4.0"
}
},
{
"package": "Rudder",
"repositoryURL": "https://github.com/rudderlabs/rudder-sdk-ios",
"state": {
"branch": null,
"revision": "28fdbdebf170c685e6100f593557b9d2a77278d6",
"version": "1.29.0"
}
},
{
"package": "Sovran",
"repositoryURL": "https://github.com/segmentio/sovran-swift.git",
"state": {
"branch": null,
"revision": "a342b905f6baa64499cabdf61ccc185ec476b7b2",
"version": "1.1.1"
}
},
{
"package": "SwiftProtobuf",
"repositoryURL": "https://github.com/apple/swift-protobuf.git",
"state": {
"branch": null,
"revision": "edb6ed4919f7756157fe02f2552b7e3850a538e5",
"version": "1.28.1"
}
}
]
},
"version": 1
}
35 changes: 35 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// swift-tools-version: 5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "Rudder-CustomerIO",
platforms: [
.iOS("13.0")
],
products: [
.library(
name: "Rudder-CustomerIO",
targets: ["Rudder-CustomerIO"]),
],
dependencies: [
.package(name: "Customer.io", url: "https://github.com/customerio/customerio-ios", .exact("3.2.2")),
.package(name: "Rudder", url: "https://github.com/rudderlabs/rudder-sdk-ios", "1.29.0"..<"2.0.0")
],
targets: [
.target(
name: "Rudder-CustomerIO",
dependencies: [
.product(name: "DataPipelines", package: "Customer.io"),
.product(name: "Rudder", package: "Rudder"),
],
path: "Rudder-CustomerIO",
sources: ["Classes/"],
publicHeadersPath: "Classes/",
cSettings: [
.headerSearchPath("Classes/")
]
)
]
)
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,35 @@ Questions? Please join our [Slack channel](https://resources.rudderstack.com/joi
1. Add [CustomerIO](https://customer.io/) as a destination in the [RudderStack dashboard](https://app.rudderstack.com/).

2. Rudder-CustomerIO is available through [CocoaPods](https://cocoapods.org). To install it, add the following line to your Podfile and followed by `pod install`:
2. Rudder-CustomerIO is available through [CocoaPods](https://cocoapods.org) and [Swift Package Manager (SPM)](https://www.swift.org/package-manager/).

### CocoaPods
Add the following line to your Podfile and followed by `pod install`:

```ruby
pod 'Rudder-CustomerIO', '~> 1.1.0'
```

### Swift Package Manager (SPM)

You can also add the RudderStack iOS SDK via Swift Package Mangaer.

* Go to **File** -> **Add Package**, as shown:

![add_package](screenshots/add_package.png)

* Enter the package repository (`https://github.com/rudderlabs/rudder-integration-customerio-ios`) in the search bar.

* In **Dependency Rule**, select **Exact Version** and enter latest as the value, as shown:

![add_package](screenshots/set_dependency.png)

* Select the project to which you want to add the package.

* Finally, click on **Add Package**.

#### Swift

## Initializing ```RudderClient```

Put this code in your ```AppDelegate.swift``` file under the method ```didFinishLaunchingWithOptions```
Expand Down
Binary file added screenshots/add_package.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/set_dependency.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cc4687c

Please sign in to comment.