Skip to content

Commit

Permalink
Updated IDFV code (#18)
Browse files Browse the repository at this point in the history
* Updated IDFV code

* updated idfv

* SDK Version Upgrade

Upgrade version to SDK_VERSION = "1.6.27"

* Added support sdk type

* Adding Sdk type in request

* Indentation update

* Updated SDK Type code

* fix: sdk version

* Update trackier-ios-sdk.podspec

* Declare setSDkType and setSDKVersion as public

* Update trackier-ios-sdk/Classes/TrackierSDKConfig.swift

Co-authored-by: Hemant Mann <hemant.mann121@gmail.com>
  • Loading branch information
IloveJavaa and Hemant-Mann authored Jul 20, 2022
1 parent 7f6d8ea commit 429d7e5
Show file tree
Hide file tree
Showing 12 changed files with 208 additions and 283 deletions.
6 changes: 3 additions & 3 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PODS:
- Alamofire (5.4.4)
- CryptoSwift (1.4.3)
- trackier-ios-sdk (1.6.19):
- trackier-ios-sdk (1.6.20):
- Alamofire (~> 5.4.1)
- CryptoSwift (~> 1.4.1)
- Willow (~> 5.0)
Expand All @@ -23,9 +23,9 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
Alamofire: f3b09a368f1582ab751b3fff5460276e0d2cf5c9
CryptoSwift: a0799ee936271bd2253a006f1e4523df21845000
trackier-ios-sdk: 8ad68c58800011d15401845e5df9b8ff39bc1403
trackier-ios-sdk: 29599f9e9eea5bb6d7345c8c0c9b292d1bae5c1f
Willow: a6310f9aedcb6f4de8c35b94fd3416a660ae9280

PODFILE CHECKSUM: 6307d8f5aa6ba32335caaaa5b91debc7fcb4378e

COCOAPODS: 1.10.1
COCOAPODS: 1.11.3
46 changes: 41 additions & 5 deletions Example/trackier-ios-sdk.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@

/* Begin PBXBuildFile section */
35B1005635FC01EDA354BF77 /* Pods_trackier_ios_sdk_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D68C1AC9CFCF2EDE72CC1FE5 /* Pods_trackier_ios_sdk_Tests.framework */; };
3FA2862C287445D600C4A2CE /* Pods_trackier_ios_sdk_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 56461FA04CA7AA927851C9CE /* Pods_trackier_ios_sdk_Example.framework */; };
3FA2862D287445D600C4A2CE /* Pods_trackier_ios_sdk_Example.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 56461FA04CA7AA927851C9CE /* Pods_trackier_ios_sdk_Example.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; };
607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; };
607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; };
607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; };
607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; };
607FACEC1AFB9204008FA782 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* Tests.swift */; };
F711820BD26687CAABCC1EAC /* Pods_trackier_ios_sdk_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 56461FA04CA7AA927851C9CE /* Pods_trackier_ios_sdk_Example.framework */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -27,8 +28,23 @@
};
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
3FA2862E287445D600C4A2CE /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
3FA2862D287445D600C4A2CE /* Pods_trackier_ios_sdk_Example.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
1A0483C7D6157C8A3B004F9D /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
3FA2862B2874440F00C4A2CE /* trackier-ios-sdk */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "trackier-ios-sdk"; path = "../trackier-ios-sdk"; sourceTree = "<group>"; };
56461FA04CA7AA927851C9CE /* Pods_trackier_ios_sdk_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_trackier_ios_sdk_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
607FACD01AFB9204008FA782 /* trackier-ios-sdk_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "trackier-ios-sdk_Example.app"; sourceTree = BUILT_PRODUCTS_DIR; };
607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand All @@ -54,7 +70,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
F711820BD26687CAABCC1EAC /* Pods_trackier_ios_sdk_Example.framework in Frameworks */,
3FA2862C287445D600C4A2CE /* Pods_trackier_ios_sdk_Example.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -142,6 +158,7 @@
95FA59431A401FA8F1532248 /* Frameworks */ = {
isa = PBXGroup;
children = (
3FA2862B2874440F00C4A2CE /* trackier-ios-sdk */,
56461FA04CA7AA927851C9CE /* Pods_trackier_ios_sdk_Example.framework */,
D68C1AC9CFCF2EDE72CC1FE5 /* Pods_trackier_ios_sdk_Tests.framework */,
);
Expand Down Expand Up @@ -171,6 +188,7 @@
607FACCD1AFB9204008FA782 /* Frameworks */,
607FACCE1AFB9204008FA782 /* Resources */,
BDFFE704DA91B82E6D3FAE90 /* [CP] Embed Pods Frameworks */,
3FA2862E287445D600C4A2CE /* Embed Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -212,11 +230,13 @@
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
DevelopmentTeam = DRN85HZJS8;
DevelopmentTeam = MK28326HAN;
LastSwiftMigration = 1130;
ProvisioningStyle = Automatic;
};
607FACE41AFB9204008FA782 = {
CreatedOnToolsVersion = 6.3.1;
DevelopmentTeam = MK28326HAN;
LastSwiftMigration = 1130;
TestTargetID = 607FACCF1AFB9204008FA782;
};
Expand Down Expand Up @@ -434,6 +454,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
sd = "";
};
name = Debug;
};
Expand Down Expand Up @@ -484,6 +505,7 @@
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
VALIDATE_PRODUCT = YES;
sd = "";
};
name = Release;
};
Expand All @@ -492,12 +514,15 @@
baseConfigurationReference = 953732255429F1F26A6EE8C1 /* Pods-trackier-ios-sdk_Example.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = DRN85HZJS8;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = MK28326HAN;
INFOPLIST_FILE = "trackier-ios-sdk/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
};
Expand All @@ -508,12 +533,15 @@
baseConfigurationReference = 7943386606D86C0C591211E4 /* Pods-trackier-ios-sdk_Example.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = DRN85HZJS8;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = MK28326HAN;
INFOPLIST_FILE = "trackier-ios-sdk/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
};
Expand All @@ -523,6 +551,9 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 882C1F2B860617CC80EFE29F /* Pods-trackier-ios-sdk_Tests.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
DEVELOPMENT_TEAM = MK28326HAN;
FRAMEWORK_SEARCH_PATHS = (
"$(PLATFORM_DIR)/Developer/Library/Frameworks",
"$(inherited)",
Expand All @@ -533,6 +564,7 @@
);
INFOPLIST_FILE = Tests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
Expand All @@ -545,12 +577,16 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 6AD20BF2B2B6D0FD207A6F29 /* Pods-trackier-ios-sdk_Tests.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
DEVELOPMENT_TEAM = MK28326HAN;
FRAMEWORK_SEARCH_PATHS = (
"$(PLATFORM_DIR)/Developer/Library/Frameworks",
"$(inherited)",
);
INFOPLIST_FILE = Tests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
Expand Down
9 changes: 8 additions & 1 deletion Example/trackier-ios-sdk/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,17 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
let config = TrackierSDKConfig(appToken: "xxxx-xx-xxx-xxx", env: TrackierSDKConfig.ENV_DEVELOPMENT)

/*While Initializing the Sdk, You need to pass the two arguments in the TrackierSDKConfig.
* In First argument, you need to pass the Trackier SDK api key
* In second argument, you need to pass the environment which can be either "development", "production" or "testing". */

let config = TrackierSDKConfig(appToken: "xxxx-xx-xxx-xxx", env: TrackierSDKConfig.ENV_DEVELOPMENT) //Pass your Trackier sdk api key
TrackierSDK.initialize(config: config)
return true
}



func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
Expand Down
11 changes: 5 additions & 6 deletions Example/trackier-ios-sdk/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="vXZ-lx-hvc">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="vXZ-lx-hvc">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="ufC-wZ-h7g">
<objects>
<viewController id="vXZ-lx-hvc" customClass="ViewController" customModule="trackier-ios-sdk_Example" customModuleProvider="target" sceneMemberID="viewController">
<viewController id="vXZ-lx-hvc" customClass="ViewController" customModule="trackier_ios_sdk_Example" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/>
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
Expand All @@ -25,6 +23,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="22" y="113"/>
</scene>
</scenes>
</document>
70 changes: 61 additions & 9 deletions Example/trackier-ios-sdk/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,73 @@ class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let event = TrackierEvent(id: TrackierEvent.PURCHASE)
event.addEventValue(prop: "purchaseId", val: "sldfjdslfsfsdf")
event.addEventValue(prop: "purchasePnr", val: "sd2-3dslk329032-23")
event.setRevenue(revenue: 120.5, currency: "INR")
event.param1 = "this is a param1 value"
DispatchQueue.global().async {
sleep(1)
TrackierSDK.trackEvent(event: event)

}
}
func userDetails(){

let event = TrackierEvent(id: TrackierEvent.LOGIN)

/*Passing the UserId and User EmailId Data */
event.setUserId("XXXXXXXX"); //Pass the UserId values here
event.setUserEmail("abc@gmail.com"); //Pass the user email id in the argument.

/*Passing the custom value in the events */
event.addEventValue("customeValue1","XXXXX");
event.addEventValue("customeValue2","XXXXX");


DispatchQueue.global().async {
sleep(1)
TrackierSDK.trackEvent(event: event)
}
}

func eventsRevenueTracking(){

let event = TrackierEvent(id: TrackierEvent.LOGIN)

//Passing the revenue events be like below example
event.revenue = 10.0; //Pass your generated revenue here.
event.currency = "INR"; //Pass your currency here.
event.orderId = "orderID";
event.param1 = "param1";
event.param2 = "param2";
event.setEventValue("ev1", "eventValue1");
event.setEventValue("ev2", 1);
DispatchQueue.global().async {
sleep(1)
TrackierSDK.trackEvent(event: event)
}

}


func eventsTracking(){
let event = TrackierEvent(id:"sEMWSCTXeu")

/*Below are the function for the adding the extra data,
You can add the extra data like login details of user or anything you need.
We have 10 params to add data, Below 5 are mentioned*/

event.param1 = "this is a param1 value"
event.param2 = "this is a param2 value"
event.param3 = "this is a param3 value"
event.param4 = "this is a param4 value"
event.param5 = "this is a param5 value"
DispatchQueue.global().async {
sleep(1)
TrackierSDK.trackEvent(event: event)
}

}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.

}
}


extension UIDevice {
var modelName: String {
Expand All @@ -42,5 +93,6 @@ extension UIDevice {
}
return identifier
}

}

Loading

0 comments on commit 429d7e5

Please sign in to comment.