Skip to content

Commit

Permalink
Attribute Organic Updated (#15)
Browse files Browse the repository at this point in the history
* Attribute Organic Updated

* Update TrackierSDK.swift
  • Loading branch information
prak24oct authored Oct 27, 2021
1 parent 45c7492 commit 5d473b8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
6 changes: 3 additions & 3 deletions trackier-ios-sdk.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

Pod::Spec.new do |s|
s.name = 'trackier-ios-sdk'
s.version = '1.6.11'
s.summary = 'This is trackier-ios-sdk 1.6.11'
s.version = '1.6.12'
s.summary = 'This is trackier-ios-sdk 1.6.12'

# This description is used to generate tags and improve search results.
# * Think: What does it do? Why did you write it? What is the focus?
Expand All @@ -25,7 +25,7 @@ TODO: Add long description of the pod here.
# s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'trackier' => 'dev@trackier.com' }
s.source = { :git => 'https://github.com/trackier/ios-sdk.git', :tag => '1.6.11' }
s.source = { :git => 'https://github.com/trackier/ios-sdk.git', :tag => '1.6.12' }
# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'

s.swift_version = '5.0'
Expand Down
4 changes: 4 additions & 0 deletions trackier-ios-sdk/Classes/TrackierSDK.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,8 @@ public class TrackierSDK {
public static func setUserAdditionalDetails(userAdditionalDetails: Dictionary<String, Any>) {
shared.instance.customerOptionals = userAdditionalDetails
}

public static func trackAsOrganic(organic: Bool) {
shared.instance.organic = organic
}
}
2 changes: 2 additions & 0 deletions trackier-ios-sdk/Classes/TrackierSDKInstance.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class TrackierSDKInstance {
var customerId = ""
var customerEmail = ""
var customerOptionals: Dictionary<String, Any>? = nil
var organic = false

/**
* Initialize method should be called to initialize the sdk
Expand Down Expand Up @@ -136,6 +137,7 @@ class TrackierSDKInstance {
wrk.customerId = customerId
wrk.customerEmail = customerEmail
wrk.customerOptionals = customerOptionals
wrk.organic = organic
let lastSessionTime = getLastSessionTime()
wrk.lastSessionTime = Utils.convertUnixTsToISO(ts: lastSessionTime)
let currentSessionTime = Int64(Date().timeIntervalSince1970)
Expand Down
2 changes: 2 additions & 0 deletions trackier-ios-sdk/Classes/TrackierWorkRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class TrackierWorkRequest {
var customerId = ""
var customerEmail = ""
var customerOptionals: Dictionary<String, Any>? = nil
var organic = false

init(kind: String, appToken: String, mode: String) {
self.kind = kind
Expand All @@ -46,6 +47,7 @@ class TrackierWorkRequest {
if (customerOptionals != nil) {
dict["opts"] = customerOptionals
}
dict["organic"] = organic
return dict
}

Expand Down

0 comments on commit 5d473b8

Please sign in to comment.