Skip to content

Commit

Permalink
update: postbacks conversion code in ios (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
IloveJavaa authored Apr 6, 2023
1 parent f2e70cf commit 314a29d
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 6 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.40
## 1.6.41

- update: version upgrade in class
- update: added updatePostbackConversion function in iOS
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.40
trackier_sdk_flutter: ^1.6.41
```

2. By using cli command. you need to run the below command in `terminal/cmd`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class TrackierfluttersdkPlugin : FlutterPlugin, MethodCallHandler {
environment = configMap.get("environment") as String
}
trackierSDKConfig = TrackierSDKConfig(context, appToken, environment)
trackierSDKConfig.setSDKVersion("1.6.40")
trackierSDKConfig.setSDKVersion("1.6.41")
trackierSDKConfig.setSDKType("flutter_sdk")
trackierSDKConfig.setAppSecret(secretId, secretKey)

Expand Down
1 change: 1 addition & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class _MyAppState extends State<MyApp> {
trackerSDKConfig.deferredDeeplinkCallback = (uri){
print('The value of deeplinkUrl is: $uri');
};
Trackierfluttersdk.updatePostbackConversion(0);
Trackierfluttersdk.setUserId("737263"); //Pass your userid
Trackierfluttersdk.setUserEmail("[email protected]");

Expand Down
10 changes: 9 additions & 1 deletion ios/Classes/SwiftTrackierfluttersdkPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public class SwiftTrackierfluttersdkPlugin: NSObject, FlutterPlugin, DeepLinkLis
} 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) }
Expand Down Expand Up @@ -73,6 +76,11 @@ public class SwiftTrackierfluttersdkPlugin: NSObject, FlutterPlugin, DeepLinkLis
TrackierSDK.setUserAdditionalDetails(userAdditionalDetails: userAdditionalDetails);
}

func updatePostbackConversion(dict: Int) -> Void {
let postbackConversion = dict
TrackierSDK.updatePostbackConversion(conversionValue: postbackConversion)
}

func initializeSDK(dict: Optional<Dictionary<String, Any>>) -> Void {
let appToken = "\(dict?["appToken"] as? String ?? "")"
let environment = "\(dict?["environment"] as? String ?? "")"
Expand All @@ -81,7 +89,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.40")
config.setSDKVersion(sdkVersion: "1.6.41")
if (!deeplinkKey.isEmpty) {
config.setDeeplinkListerner(listener: self)
}
Expand Down
5 changes: 5 additions & 0 deletions lib/trackierfluttersdk.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:ffi';
import 'package:flutter/services.dart';
import 'package:trackier_sdk_flutter/trackierevent.dart';
import 'trackierconfig.dart';
Expand Down Expand Up @@ -40,6 +41,10 @@ class Trackierfluttersdk {
_channel.invokeMethod('setUserName', userName);
}

static void updatePostbackConversion(int conversion) {
_channel.invokeMethod('updatePostbackConversion', conversion);
}

static void setUserAdditonalDetail(Map userAdditonalDetail) {
_channel.invokeMethod('setUserAdditonalDetail', userAdditonalDetail);
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: trackier_sdk_flutter
description: This is trackier flutter SDK
version: 1.6.40
version: 1.6.41
homepage: https://github.com/trackier/flutter-sdk

environment:
Expand Down

0 comments on commit 314a29d

Please sign in to comment.