Skip to content

Commit

Permalink
update-campaign-data-functions (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
IloveJavaa authored Aug 3, 2023
1 parent 314a29d commit b70c31b
Show file tree
Hide file tree
Showing 8 changed files with 332 additions and 34 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## 1.6.41
## 1.6.46

- update: added updatePostbackConversion function in iOS
- update: added the campaigns data functions
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ You can add the flutter sdk in two ways:-

```
dependencies:
trackier_sdk_flutter: ^1.6.41
trackier_sdk_flutter: ^1.6.46
```

2. By using cli command. you need to run the below command in `terminal/cmd`.
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ android {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.annotation:annotation:1.2.0'
implementation 'com.trackier:android-sdk:1.6.39'
implementation 'com.trackier:android-sdk:1.6.46'
implementation 'com.android.installreferrer:installreferrer:2.2'
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,74 @@ class TrackierfluttersdkPlugin : FlutterPlugin, MethodCallHandler {
"setUserPhone" -> {
setUserPhone(call, result)
}

"getAd" -> {
getAd(call, result)
}

"getAdID" -> {
getAdID(call, result)
}

"getAdSet" -> {
getAdSet(call, result)
}

"getAdSetID" -> {
getAdSetID(call, result)
}

"getCampaign" -> {
getCampaign(call, result)
}

"getCampaignID" -> {
getCampaignID(call, result)
}

"getChannel" -> {
getChannel(call, result)
}

"getP1" -> {
getP1(call, result)
}

"getP2" -> {
getP2(call, result)
}

"getP3" -> {
getP3(call, result)
}

"getP4" -> {
getP4(call, result)
}

"getP5" -> {
getP5(call, result)
}

"getClickId" -> {
getClickId(call, result)
}

"getDlv" -> {
getDlv(call, result)
}

"getPid" -> {
getPid(call, result)
}

"getIsRetargeting" -> {
getIsRetargeting(call, result)
}

"setPreinstallAttribution" -> {
setPreinstallAttribution(call, result)
}
}
}

Expand All @@ -89,7 +157,7 @@ class TrackierfluttersdkPlugin : FlutterPlugin, MethodCallHandler {
environment = configMap.get("environment") as String
}
trackierSDKConfig = TrackierSDKConfig(context, appToken, environment)
trackierSDKConfig.setSDKVersion("1.6.41")
trackierSDKConfig.setSDKVersion("1.6.46")
trackierSDKConfig.setSDKType("flutter_sdk")
trackierSDKConfig.setAppSecret(secretId, secretKey)

Expand Down Expand Up @@ -253,7 +321,76 @@ class TrackierfluttersdkPlugin : FlutterPlugin, MethodCallHandler {
val installID = TrackierSDK.getTrackierId()
result.success(installID)
}


private fun getAd(call: MethodCall, result: Result) {
result.success(TrackierSDK.getAd())
}
private fun getAdID(call: MethodCall, result: Result) {
result.success(TrackierSDK.getAdID())
}
private fun getAdSet(call: MethodCall, result: Result) {
result.success(TrackierSDK.getAdSet())
}

private fun getAdSetID(call: MethodCall, result: Result) {
result.success(TrackierSDK.getAdSetID())
}

private fun getCampaign(call: MethodCall, result: Result) {
result.success(TrackierSDK.getCampaign())
}

private fun getCampaignID(call: MethodCall, result: Result) {
result.success(TrackierSDK.getCampaignID())
}

private fun getChannel(call: MethodCall, result: Result) {
result.success(TrackierSDK.getChannel())
}

private fun getP1(call: MethodCall, result: Result) {
result.success(TrackierSDK.getP1())
}

private fun getP2(call: MethodCall, result: Result) {
result.success(TrackierSDK.getP2())
}

private fun getP3(call: MethodCall, result: Result) {
result.success(TrackierSDK.getP3())
}

private fun getP4(call: MethodCall, result: Result) {
result.success(TrackierSDK.getP4())
}

private fun getP5(call: MethodCall, result: Result) {
result.success(TrackierSDK.getP5())
}

private fun getClickId(call: MethodCall, result: Result) {
result.success(TrackierSDK.getClickId())
}

private fun getDlv(call: MethodCall, result: Result) {
result.success(TrackierSDK.getDlv())
}

private fun getPid(call: MethodCall, result: Result) {
result.success(TrackierSDK.getPid())
}

private fun getIsRetargeting(call: MethodCall, result: Result) {
result.success(TrackierSDK.getIsRetargeting())
}

private fun setPreinstallAttribution(call: MethodCall, result: Result) {
val pid = call.argument<String>("pid").toString()
val campaign = call.argument<String>("campaign").toString()
val campaignId = call.argument<String>("campaignId").toString()
TrackierSDK.setPreinstallAttribution(pid, campaign, campaignId)
}

override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) {
channel.setMethodCallHandler(null)
}
Expand Down
148 changes: 122 additions & 26 deletions ios/Classes/SwiftTrackierfluttersdkPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,63 @@ public class SwiftTrackierfluttersdkPlugin: NSObject, FlutterPlugin, DeepLinkLis
}

public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
result("iOS " + UIDevice.current.systemVersion)
if (call.method == "setUserId") {
let dict = call.arguments as? String
if (dict != nil) { setUserId(dict: dict!) }
} else if (call.method == "setUserEmail") {
let dict = call.arguments as? String
if (dict != nil) { setUserEmail(dict: dict!) }
} else if (call.method == "setUserPhone") {
let dict = call.arguments as? String
if (dict != nil) { setUserPhone(dict: dict!) }
} else if (call.method == "setUserName") {
let dict = call.arguments as? String
if (dict != nil) { setUserName(dict: dict!) }
} else if (call.method == "setUserAdditonalDetail") {
let dict = call.arguments as? [String:Any]
if (dict != nil) { setUserAdditionalDetails(dict: dict!) }
} else if (call.method == "updatePostbackConversion") {
let dict = call.arguments as? Int
if (dict != nil) { updatePostbackConversion(dict: dict!) }
} else if (call.method == "initializeSDK") {
let dict = call.arguments as? [String:Any]
if (dict != nil) { initializeSDK(dict: dict) }
} else if (call.method == "trackierEvent") {
let dict = call.arguments as? [String:Any]
if (dict != nil) { trackEvent(dict: dict) }
//result("iOS " + UIDevice.current.systemVersion)
if (call.method == "setUserId") {
let dict = call.arguments as? String
if (dict != nil) { setUserId(dict: dict!) }
} else if (call.method == "setUserEmail") {
let dict = call.arguments as? String
if (dict != nil) { setUserEmail(dict: dict!) }
} else if (call.method == "setUserPhone") {
let dict = call.arguments as? String
if (dict != nil) { setUserPhone(dict: dict!) }
} else if (call.method == "setUserName") {
let dict = call.arguments as? String
if (dict != nil) { setUserName(dict: dict!) }
} else if (call.method == "setUserAdditonalDetail") {
let dict = call.arguments as? [String:Any]
if (dict != nil) { setUserAdditionalDetails(dict: dict!) }
} else if (call.method == "updatePostbackConversion") {
let dict = call.arguments as? Int
if (dict != nil) { updatePostbackConversion(dict: dict!) }
} else if (call.method == "initializeSDK") {
let dict = call.arguments as? [String:Any]
if (dict != nil) { initializeSDK(dict: dict) }
} else if (call.method == "trackierEvent") {
let dict = call.arguments as? [String:Any]
if (dict != nil) { trackEvent(dict: dict) }
} else if (call.method == "getAd") {
getAd(result: result)
} else if (call.method == "getAdID") {
getAdID(result: result)
} else if (call.method == "getAdSet") {
getAdSet(result: result)
} else if (call.method == "getAdSetID") {
getAdSetID(result: result)
} else if (call.method == "getCampaign") {
getCampaign(result: result)
} else if (call.method == "getCampaignID") {
getCampaignID(result: result)
} else if (call.method == "getP1") {
getP1(result: result)
} else if (call.method == "getP2") {
getP2(result: result)
} else if (call.method == "getP3") {
getP3(result: result)
} else if (call.method == "getP4") {
getP4(result: result)
} else if (call.method == "getP5") {
getP5(result: result)
} else if (call.method == "getClickId") {
getClickId(result: result)
} else if (call.method == "getDlv") {
getDlv(result: result)
} else if (call.method == "getPid") {
getPid(result: result)
} else if (call.method == "getIsRetargeting") {
getIsRetargeting(result: result)
} else {
result(FlutterMethodNotImplemented)
}
}

Expand Down Expand Up @@ -81,6 +113,70 @@ public class SwiftTrackierfluttersdkPlugin: NSObject, FlutterPlugin, DeepLinkLis
TrackierSDK.updatePostbackConversion(conversionValue: postbackConversion)
}

func getAd(result: FlutterResult) -> Void {
result("sanu")
}

func getAdID(result: FlutterResult) -> Void {
result("sanu22")
}

func getAdSet(result: FlutterResult) -> Void {
result(TrackierSDK.getAdSet())
}

func getAdSetID(result: FlutterResult) -> Void {
result(TrackierSDK.getAdSetID())
}

func getCampaign(result: FlutterResult) -> Void {
result(TrackierSDK.getCampaign())
}

func getCampaignID(result: FlutterResult) -> Void {
result(TrackierSDK.getCampaignID())
}

func getChannel(result: FlutterResult) -> Void {
result(TrackierSDK.getChannel())
}

func getP1(result: FlutterResult) -> Void {
result(TrackierSDK.getP1())
}

func getP2(result: FlutterResult) -> Void {
result(TrackierSDK.getP2())
}

func getP3(result: FlutterResult) -> Void {
result(TrackierSDK.getP3())
}

func getP4(result: FlutterResult) -> Void {
result(TrackierSDK.getP4())
}

func getP5(result: FlutterResult) -> Void {
result(TrackierSDK.getP5())
}

func getClickId(result: FlutterResult) -> Void {
result(TrackierSDK.getClickId())
}

func getDlv(result: FlutterResult) -> Void {
result(TrackierSDK.getDlv())
}

func getPid(result: FlutterResult) -> Void {
result(TrackierSDK.getPid())
}

func getIsRetargeting(result: FlutterResult) -> Void {
result(TrackierSDK.getIsRetargeting())
}

func initializeSDK(dict: Optional<Dictionary<String, Any>>) -> Void {
let appToken = "\(dict?["appToken"] as? String ?? "")"
let environment = "\(dict?["environment"] as? String ?? "")"
Expand All @@ -89,7 +185,7 @@ public class SwiftTrackierfluttersdkPlugin: NSObject, FlutterPlugin, DeepLinkLis
let deeplinkKey = "\(dict?["deeplinkCallback"] as? String ?? "")"
let config = TrackierSDKConfig(appToken: appToken , env: environment)
config.setAppSecret(secretId: secretId, secretKey: secretKey)
config.setSDKVersion(sdkVersion: "1.6.41")
config.setSDKVersion(sdkVersion: "1.6.46")
if (!deeplinkKey.isEmpty) {
config.setDeeplinkListerner(listener: self)
}
Expand Down
2 changes: 1 addition & 1 deletion ios/trackier_sdk_flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
Pod::Spec.new do |s|
s.name = 'trackier_sdk_flutter'
s.version = '1.6.40'
s.version = '1.6.46'
s.summary = 'Trackier flutter SDK'
s.description = <<-DESC
This is Trackier flutter SDK
Expand Down
Loading

0 comments on commit b70c31b

Please sign in to comment.