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 sprig device mode integration #4

Closed
Show file tree
Hide file tree
Changes from 16 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
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
id: check-outdated-pods-and-create-issue
uses: rudderlabs/github-action-updated-pods-notifier@main
with:
outdated-pod-names: "<SPRIG>"
outdated-pod-names: "UserLeapKit"
directory: "Example"
title: "fix: update Sprig SDK to the latest version"
labels: "outdatedPod"
Expand Down
8 changes: 6 additions & 2 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ PODS:
- RSCrashReporter (1.0.1)
- Rudder (1.29.0):
- MetricsReporter (= 2.0.0)
- Rudder-Sprig (1.2.0):
- Rudder-Sprig (1.0.0):
- Rudder (~> 1.29)
- UserLeapKit (~> 4.22.3)
- RudderKit (1.4.0)
- UserLeapKit (4.22.3)

DEPENDENCIES:
- Rudder-Sprig (from `../`)
Expand All @@ -18,6 +20,7 @@ SPEC REPOS:
- RSCrashReporter
- Rudder
- RudderKit
- UserLeapKit

EXTERNAL SOURCES:
Rudder-Sprig:
Expand All @@ -27,8 +30,9 @@ SPEC CHECKSUMS:
MetricsReporter: 364b98791e868b10e9d512eb50af28d8c11e5cdb
RSCrashReporter: 6b8376ac729b0289ebe0908553e5f56d8171f313
Rudder: 7031e52a04312cbc7a70713cac25528a89e63408
Rudder-Sprig: b2ed94664ed4ef88a70dd124c462ade45aeafc2a
Rudder-Sprig: 8bba5342c4c3fa4e21fa3d49c2e71f88199dbfaf
RudderKit: f272f9872183946452ac94cd7bb2244a71e6ca8f
UserLeapKit: d3ef71e5fd2d7da067ae8dd99da2a1b910db25b5

PODFILE CHECKSUM: 74b1e8a1b2ec5e1434c3993b3c5a6bf86fe5e6c2

Expand Down
12 changes: 6 additions & 6 deletions Example/Rudder-Sprig.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; };
6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; };
6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; };
6003F5A7195388D20070C39A /* _ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* _ViewController.m */; };
6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; };
6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; };
6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
Expand All @@ -24,6 +23,7 @@
873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; };
8C4EC75B29C9842A00286AA1 /* SampleRudderConfig.plist in Resources */ = {isa = PBXBuildFile; fileRef = 8C4EC75A29C9842A00286AA1 /* SampleRudderConfig.plist */; };
8C4EC77229CA188D00286AA1 /* RudderConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8C4EC77129CA188D00286AA1 /* RudderConfig.swift */; };
8C5415962CC009600068F6FC /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8C5415952CC009600068F6FC /* ViewController.swift */; };
EFB86AFB208729498CC0FD7C /* Pods_Rudder_Sprig_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61440C7DD78E9D7E582BADED /* Pods_Rudder_Sprig_Tests.framework */; };
/* End PBXBuildFile section */

Expand All @@ -50,8 +50,6 @@
6003F595195388D20070C39A /* Rudder-Sprig-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Rudder-Sprig-Info.plist"; sourceTree = "<group>"; };
6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
6003F59B195388D20070C39A /* Rudder-Sprig-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Rudder-Sprig-Prefix.pch"; sourceTree = "<group>"; };
6003F5A5195388D20070C39A /* _ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _ViewController.h; sourceTree = "<group>"; };
6003F5A6195388D20070C39A /* _ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = _ViewController.m; sourceTree = "<group>"; };
6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
6003F5AE195388D20070C39A /* Rudder-Sprig_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Rudder-Sprig_Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
Expand All @@ -65,6 +63,7 @@
8C4EC75A29C9842A00286AA1 /* SampleRudderConfig.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = SampleRudderConfig.plist; sourceTree = "<group>"; };
8C4EC76C29C9A5EA00286AA1 /* Rudder-Sprig_Example-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Rudder-Sprig_Example-Bridging-Header.h"; sourceTree = "<group>"; };
8C4EC77129CA188D00286AA1 /* RudderConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RudderConfig.swift; sourceTree = "<group>"; };
8C5415952CC009600068F6FC /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
8D50BDFB9F2970C3CB7BA5ED /* Pods-Rudder-Sprig_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Rudder-Sprig_Example.debug.xcconfig"; path = "Target Support Files/Pods-Rudder-Sprig_Example/Pods-Rudder-Sprig_Example.debug.xcconfig"; sourceTree = "<group>"; };
AE113B0A0538923404EA7D4B /* Pods-Rudder-Sprig_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Rudder-Sprig_Example.release.xcconfig"; path = "Target Support Files/Pods-Rudder-Sprig_Example/Pods-Rudder-Sprig_Example.release.xcconfig"; sourceTree = "<group>"; };
C542D9CF22C78467F16A6AA7 /* Pods-Rudder-Sprig_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Rudder-Sprig_Tests.debug.xcconfig"; path = "Target Support Files/Pods-Rudder-Sprig_Tests/Pods-Rudder-Sprig_Tests.debug.xcconfig"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -153,9 +152,8 @@
8C4EC76B29C9A57F00286AA1 /* RudderConfig */,
8C4EC76C29C9A5EA00286AA1 /* Rudder-Sprig_Example-Bridging-Header.h */,
53F55EBF2C18043F00FDE4C7 /* AppDelegate.swift */,
8C5415952CC009600068F6FC /* ViewController.swift */,
873B8AEA1B1F5CCA007FD442 /* Main.storyboard */,
6003F5A5195388D20070C39A /* _ViewController.h */,
6003F5A6195388D20070C39A /* _ViewController.m */,
71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */,
6003F5A8195388D20070C39A /* Images.xcassets */,
6003F594195388D20070C39A /* Supporting Files */,
Expand Down Expand Up @@ -330,13 +328,15 @@
"${BUILT_PRODUCTS_DIR}/RSCrashReporter/RSCrashReporter.framework",
"${BUILT_PRODUCTS_DIR}/Rudder/Rudder.framework",
"${BUILT_PRODUCTS_DIR}/RudderKit/RudderKit.framework",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/UserLeapKit/UserLeapKit.framework/UserLeapKit",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MetricsReporter.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RSCrashReporter.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Rudder.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RudderKit.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/UserLeapKit.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down Expand Up @@ -394,8 +394,8 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8C5415962CC009600068F6FC /* ViewController.swift in Sources */,
8C4EC77229CA188D00286AA1 /* RudderConfig.swift in Sources */,
6003F5A7195388D20070C39A /* _ViewController.m in Sources */,
53F55EC02C18043F00FDE4C7 /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
26 changes: 17 additions & 9 deletions Example/Rudder-Sprig/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<!--View Controller-->
<scene sceneID="wQg-tq-qST">
<objects>
<viewController id="whP-gf-Uak" customClass="_ViewController" sceneMemberID="viewController">
<viewController id="whP-gf-Uak" customClass="ViewController" customModule="Rudder_Sprig_Example" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="uEw-UM-LJ8"/>
<viewControllerLayoutGuide type="bottom" id="Mvr-aV-6Um"/>
Expand All @@ -20,30 +20,38 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="67" translatesAutoresizingMaskIntoConstraints="NO" id="G2l-bR-g1g">
<rect key="frame" x="156" y="307.66666666666669" width="81" height="237.00000000000006"/>
<rect key="frame" x="90.000000000000014" y="257" width="213.33333333333337" height="338.33333333333326"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="GWi-bE-qc8">
<rect key="frame" x="0.0" y="0.0" width="81" height="34.333333333333336"/>
<rect key="frame" x="0.0" y="0.0" width="213.33333333333334" height="34.333333333333336"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Identify"/>
<connections>
<action selector="identifyAction:" destination="whP-gf-Uak" eventType="touchUpInside" id="LeM-3n-xUk"/>
<action selector="identify:" destination="whP-gf-Uak" eventType="touchUpInside" id="hhb-V7-ifP"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="K52-jD-an8">
<rect key="frame" x="0.0" y="101.33333333333331" width="81" height="34.333333333333343"/>
<rect key="frame" x="0.0" y="101.33333333333331" width="213.33333333333334" height="34.333333333333343"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Track"/>
<buttonConfiguration key="configuration" style="plain" title="Track Without Properties"/>
<connections>
<action selector="trackAction:" destination="whP-gf-Uak" eventType="touchUpInside" id="Zix-sE-rF7"/>
<action selector="trackWithoutProperties:" destination="whP-gf-Uak" eventType="touchUpInside" id="jK2-02-Lzk"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="r3S-E9-XeC">
<rect key="frame" x="0.0" y="202.66666666666669" width="213.33333333333334" height="34.333333333333343"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Track With Properties"/>
<connections>
<action selector="trackWithProperties:" destination="whP-gf-Uak" eventType="touchUpInside" id="1iF-TU-ppJ"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="2AP-OH-92g">
<rect key="frame" x="0.0" y="202.66666666666663" width="81" height="34.333333333333343"/>
<rect key="frame" x="0.0" y="304" width="213.33333333333334" height="34.333333333333314"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Reset"/>
<connections>
<action selector="resetAction:" destination="whP-gf-Uak" eventType="touchUpInside" id="BIm-FW-uOd"/>
<action selector="reset:" destination="whP-gf-Uak" eventType="touchUpInside" id="OGc-0g-DwE"/>
</connections>
</button>
</subviews>
Expand Down
50 changes: 50 additions & 0 deletions Example/Rudder-Sprig/ViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
//
// ViewController.swift
// Rudder-Sprig_Example
//
// Created by Abhishek Pandey on 16/10/24.
// Copyright © 2024 arnabp92. All rights reserved.
//

import UIKit
import Rudder
import Rudder_Sprig

class ViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()

// Do any additional setup after loading the view.

// Pass ViewController instance to RudderSprigFactory. As Sprig SDK requires this to display the servey.
RudderSprigFactory.instance.setViewController(self)
}

@IBAction func identify(_ sender: Any) {
let traits: [String: Any] = [
"email": "[email protected]",
"key-1": "value",
"key-2": 100,
"key-3": 122.56,
"key-4": true,
]
RSClient.getInstance().identify("User iOS 1", traits: traits)
}

@IBAction func trackWithoutProperties(_ sender: Any) {
RSClient.getInstance().track("Track event without properties")
}

@IBAction func trackWithProperties(_ sender: Any) {
let properties: [String: Any] = [
"key-5": "value 5",
"key-6": 200,
]
RSClient.getInstance().track("Track event with properties", properties: properties)
}

@IBAction func reset(_ sender: Any) {
RSClient.getInstance().reset(false)
}
}
13 changes: 0 additions & 13 deletions Example/Rudder-Sprig/_ViewController.h

This file was deleted.

46 changes: 0 additions & 46 deletions Example/Rudder-Sprig/_ViewController.m

This file was deleted.

52 changes: 52 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"object": {
"pins": [
{
"package": "RSCrashReporter",
"repositoryURL": "https://github.com/rudderlabs/crash-reporter-ios",
"state": {
"branch": null,
"revision": "ee563535b64d9d5feacd0fa243663b2658033a19",
"version": "1.0.1"
}
},
{
"package": "MetricsReporter",
"repositoryURL": "https://github.com/rudderlabs/metrics-reporter-ios",
"state": {
"branch": null,
"revision": "e307fa37c6c2d2cccf787d73b5b4b5bc3f650435",
"version": "2.0.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": "0ae17a87a110e61790f60bc6590021660249c49e",
"version": "1.29.1"
}
},
{
"package": "UserLeapKit",
"repositoryURL": "https://github.com/UserLeap/userleap-ios-sdk-releases",
"state": {
"branch": null,
"revision": "24fd86b65cd5350f4c46a9daa4a229623a552713",
"version": "4.22.3"
}
}
]
},
"version": 1
}
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ let package = Package(
targets: ["Rudder-Sprig"]),
],
dependencies: [
// .package(name: "<SPRIG>", url: "https://github.com/", .exact("<SPRIG>")),
.package(name: "UserLeapKit", url: "https://github.com/UserLeap/userleap-ios-sdk-releases", .exact("4.22.3")),
.package(name: "Rudder", url: "https://github.com/rudderlabs/rudder-sdk-ios", "1.29.0"..<"2.0.0")
],
targets: [
.target(
name: "Rudder-Sprig",
dependencies: [
// .product(name: "<SPRIG>", package: "<SPRIG>"),
.product(name: "UserLeapKit", package: "UserLeapKit"),
.product(name: "Rudder", package: "Rudder"),
],
path: "Rudder-Sprig",
Expand Down
Loading
Loading