Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
bsneed committed Nov 2, 2023
1 parent 6dde3bf commit 467b7d5
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 100 deletions.
40 changes: 28 additions & 12 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,37 @@ jobs:
with:
workflow_id: ${{ github.event.workflow.id }}

build_and_test_examples:
build_and_test_spm_mac:
needs: cancel_previous
runs-on: macos-11
runs-on: macos-latest
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.2.1'
xcode-version: latest-stable
- uses: actions/checkout@v2
- uses: actions/cache@v2
- name: Build
run: swift build
- name: Run tests
run: swift test

build_and_test_ios:
needs: cancel_previous
runs-on: macos-latest
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
path: /Users/runner/Library/Developer/Xcode/DerivedData
key: ${{ runner.os }}-spm-examples-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-examples
- name: build for ios simulator
run: |
cd Example/BasicExample
xcodebuild -project "BasicExample.xcodeproj" -scheme "BasicExample" -sdk iphonesimulator
xcode-version: latest-stable
- uses: actions/checkout@v2
- run: xcodebuild -scheme SegmentConsent test -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 13'

build_and_test_tvos:
needs: cancel_previous
runs-on: macos-latest
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- uses: actions/checkout@v2
- run: xcodebuild -scheme SegmentConsent test -sdk appletvsimulator -destination 'platform=tvOS Simulator,name=Apple TV'


4 changes: 2 additions & 2 deletions Example/BasicExample/BasicExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/segmentio/analytics-swift";
requirement = {
branch = bsneed/fixups;
kind = branch;
kind = upToNextMajorVersion;
minimumVersion = 1.4.8;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,43 +1,41 @@
{
"object": {
"pins": [
{
"package": "Segment",
"repositoryURL": "https://github.com/segmentio/analytics-swift",
"state": {
"branch": "bsneed/fixups",
"revision": "44d7054066ca5d55e8bde10762a109e042c93331",
"version": null
}
},
{
"package": "OTPublishersHeadlessSDK",
"repositoryURL": "https://github.com/Zentrust/OTPublishersHeadlessSDK",
"state": {
"branch": null,
"revision": "e318c893a790e6f58bd0c67e64d0ef204c482c31",
"version": "202309.1.0"
}
},
{
"package": "OTPublishersHeadlessSDKtvOS",
"repositoryURL": "https://github.com/Zentrust/OTPublishersHeadlessSDKtvOS",
"state": {
"branch": null,
"revision": "13e371adfcce89dff5d1c22f1160d5c213a9ccdb",
"version": "202309.1.0"
}
},
{
"package": "Sovran",
"repositoryURL": "https://github.com/segmentio/Sovran-Swift.git",
"state": {
"branch": null,
"revision": "64f3b5150c282a34af4578188dce2fd597e600e3",
"version": "1.1.0"
}
"pins" : [
{
"identity" : "analytics-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/segmentio/analytics-swift",
"state" : {
"revision" : "efc111b5fccaebd1063ef0db6d206c252da387ec",
"version" : "1.4.8"
}
]
},
"version": 1
},
{
"identity" : "otpublishersheadlesssdk",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Zentrust/OTPublishersHeadlessSDK",
"state" : {
"revision" : "e318c893a790e6f58bd0c67e64d0ef204c482c31",
"version" : "202309.1.0"
}
},
{
"identity" : "otpublishersheadlesssdktvos",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Zentrust/OTPublishersHeadlessSDKtvOS",
"state" : {
"revision" : "13e371adfcce89dff5d1c22f1160d5c213a9ccdb",
"version" : "202309.1.0"
}
},
{
"identity" : "sovran-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/segmentio/Sovran-Swift.git",
"state" : {
"revision" : "64f3b5150c282a34af4578188dce2fd597e600e3",
"version" : "1.1.0"
}
}
],
"version" : 2
}
38 changes: 8 additions & 30 deletions Example/BasicExample/BasicExample/BasicExampleApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,42 +37,18 @@ extension UIApplication {
}
}

/*
let consentManager = ConsentManager(provider: OneTrustProvider())
analytics.add(plugin: MyBrazePlugin())
analytics.add(plugin: Taplytics())
analytics.add(plugin: Adjust())
analytics.add(plugin: Firebase())
...
let consentManager = ConsentManager(provider: OneTrustProvider())
let brazePlugin = MyBrazePlugin()
analytics.add(plugin: braze)
let taplytics = MyTaplyticsPlugin()
analytics.add(plugin: taplytics)
let adjust = Adjust()
analytics.add(plugin: adjust)
let firebase = Firebase()
analytics.add(plugin: firebase)
braze.add(plugin: ConsentManagerBlocker(key: braze.key))
braze.add(plugin: ConsentManagerBlocker(key: taplytics.key))
braze.add(plugin: ConsentManagerBlocker(key: adjust.key))
braze.add(plugin: ConsentManagerBlocker(key: firebase.key))
*/

extension Analytics {
static var main: Analytics = {
Analytics.debugLogsEnabled = true

let analytics = Analytics(configuration: Configuration(writeKey: "EGCcsy2aeYnDBfJewFOzcy91SUHg2QTF")
let analytics = Analytics(configuration: Configuration(writeKey: "<your write key>")
.flushAt(1)
.trackApplicationLifecycleEvents(true))
let consentManager = ConsentManager(provider: OneTrustProvider())

let consentManager = ConsentManager(provider: OneTrustProvider()) {
// we were notified (optionally) that consent changed.
print("Consent Changed")
}
analytics.add(plugin: consentManager)

// add dummy destinations to represent our consent settings on segment.com
Expand All @@ -94,6 +70,8 @@ extension Analytics {
domainIdentifier: "aaa2b4b9-3a9c-450c-b82b-60bc3bfc8e19-test",
languageCode: "en"
) { response in
// Tell the consent manager to start. Until this happens,
// all events are queued so they can get the proper stamps and treatment.
consentManager.start()
}

Expand Down
11 changes: 0 additions & 11 deletions MyPlayground.playground/Contents.swift

This file was deleted.

4 changes: 0 additions & 4 deletions MyPlayground.playground/contents.xcplayground

This file was deleted.

2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.9
// swift-tools-version:5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand Down

0 comments on commit 467b7d5

Please sign in to comment.