@tyrads.com/tyrads-sdk 4.0.1-beta.0 → 4.0.2-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -112,6 +112,6 @@ dependencies {
112
112
  implementation "com.facebook.react:react-native:+"
113
113
  implementation 'com.google.code.gson:gson:+'
114
114
 
115
- implementation 'com.github.tyrads-com:tyrads-sdk-android:04257cd7a0'
115
+ implementation 'com.github.tyrads-com:tyrads-sdk-android:9abcc6b935'
116
116
  }
117
117
 
@@ -195,6 +195,8 @@ public class Tyrads : NSObject {
195
195
  self.publisherUserID = acmoInitModel.data.accountInfo.publisherUserId
196
196
  self.newUser = acmoInitModel.data.newRegisteredUser
197
197
  self.token = acmoInitModel.data.token
198
+ self.initializationContinuation?.resume()
199
+ self.initializationContinuation = nil
198
200
  self.log("Login successful. Publisher User ID: \(self.publisherUserID), New User: \(self.newUser)")
199
201
  self.mainColor = acmoInitModel.data.appInfo.mainColor
200
202
 
@@ -11,11 +11,11 @@ import CoreTelephony
11
11
 
12
12
  func getDeviceDetails() -> [String: Any] {
13
13
  var fd = [String: Any]()
14
-
14
+
15
15
  let device = UIDevice.current
16
16
  let bundle = Bundle.main
17
17
  let locale = Locale.current
18
-
18
+
19
19
  // device basic info
20
20
  fd["deviceId"] = device.identifierForVendor?.uuidString ?? "Unknown"
21
21
  fd["device"] = device.model.lowercased().contains("ipad") ? "iPad" : "iPhone"
@@ -26,29 +26,31 @@ func getDeviceDetails() -> [String: Any] {
26
26
  fd["releaseVersion"] = device.systemVersion
27
27
  fd["modelName"] = getModelName()
28
28
  fd["hardware"] = deviceIdentifier()
29
-
29
+
30
30
  fd["product"] = "Darwin"
31
31
  fd["platform"] = "iOS"
32
32
  fd["apiVersion"] = AcmoConfig.API_VERSION
33
33
  fd["sdkVersion"] = AcmoConfig.SDK_VERSION
34
34
  fd["sdkPlatform"] = AcmoConfig.SDK_PLATFORM
35
-
35
+
36
36
  // app info
37
37
  fd["version"] = bundle.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown"
38
38
  fd["build"] = bundle.infoDictionary?["CFBundleVersion"] as? String ?? "Unknown"
39
39
  fd["package"] = bundle.bundleIdentifier ?? "Unknown"
40
40
  fd["installerStore"] = "App Store"
41
-
42
- fd["osLang"] = locale.languageCode ?? "en"
43
-
41
+
42
+ fd["osLang"] = Locale.current.identifier.replacingOccurrences(of: "_", with: "-")
43
+ print("[DeviceDetails] osLang resolved: \(fd["osLang"] as? String ?? "unknown")")
44
+
45
+
44
46
  // security and virtual check
45
47
  fd["rooted"] = isJailBroken()
46
48
  fd["virtual"] = isRunningOnSimulator()
47
-
49
+
48
50
  // storage info
49
51
  let (totalSpace, freeSpace) = getDiskSpace()
50
52
  fd["totalMemory"] = Double(round(100 * (Double(totalSpace) / 1_000_000_000)) / 100)
51
-
53
+
52
54
  // network info
53
55
  fd["connectionType"] = getNetworkType()
54
56
 
@@ -59,7 +61,7 @@ func getNetworkType() -> String {
59
61
  let monitor = NWPathMonitor()
60
62
  let semaphore = DispatchSemaphore(value: 0)
61
63
  var networkType = "No Connection"
62
-
64
+
63
65
  monitor.pathUpdateHandler = { path in
64
66
  if path.status == .satisfied {
65
67
  if path.usesInterfaceType(.wifi) {
@@ -76,23 +78,23 @@ func getNetworkType() -> String {
76
78
  }
77
79
  semaphore.signal()
78
80
  }
79
-
81
+
80
82
  let queue = DispatchQueue(label: "NetworkMonitor")
81
83
  monitor.start(queue: queue)
82
-
84
+
83
85
  _ = semaphore.wait(timeout: .now() + 0.1)
84
86
  monitor.cancel()
85
-
87
+
86
88
  return networkType
87
89
  }
88
90
 
89
91
  func getUptimeMetrics() -> [String: Any] {
90
92
  let uptime = ProcessInfo.processInfo.systemUptime
91
93
  let bootTimeDate = Date(timeIntervalSinceNow: -uptime)
92
-
94
+
93
95
  let formatter = DateFormatter()
94
96
  formatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
95
-
97
+
96
98
  return [
97
99
  "device_uptime_hours": String(format: "%.2f", uptime / 3600),
98
100
  "device_boot_time": formatter.string(from: bootTimeDate)
@@ -102,7 +104,7 @@ func getUptimeMetrics() -> [String: Any] {
102
104
  func getCellularType() -> String {
103
105
  let networkInfo = CTTelephonyNetworkInfo()
104
106
  var carrierType = "Cellular"
105
-
107
+
106
108
  if #available(iOS 14.1, *) {
107
109
  if let radioTechnologies = networkInfo.serviceCurrentRadioAccessTechnology {
108
110
  for (_, technology) in radioTechnologies {
@@ -211,7 +213,7 @@ func deviceIdentifier() -> String {
211
213
 
212
214
  func getModelName() -> String {
213
215
  let identifier = deviceIdentifier()
214
-
216
+
215
217
  let iphoneModelMapping: [String: String] = [
216
218
  "iPhone1,1": "iPhone",
217
219
  "iPhone1,2": "iPhone 3G",
@@ -223,13 +223,14 @@ class TyradsSdk: RCTEventEmitter , APNsNotificationListener{
223
223
  window.frame = frame
224
224
  window.backgroundColor = .clear
225
225
 
226
+ let moduleName = Bundle.main.object(forInfoDictionaryKey: "CFBundleName") as? String ?? "TyradsSdkExample"
226
227
  let rootView = PassthroughRootView(
227
228
  bridge: bridge,
228
- moduleName: "TyradsSdkExample",
229
+ moduleName: moduleName,
229
230
  initialProperties: nil
230
231
  )
231
232
 
232
- rootView.backgroundColor = .yellow
233
+ rootView.backgroundColor = .clear
233
234
  rootView.frame = frame
234
235
  let vc = UIViewController()
235
236
  vc.view = rootView
@@ -9,8 +9,8 @@ class AcmoConfig {
9
9
  static BASE_URL = `https://api.tyrads.com/v${this.API_VERSION}/`;
10
10
  static MAJOR_VERSION = "4";
11
11
  static MINOR_VERSION = "0";
12
- static PATCH_VERSION = "1";
13
- static BUILD_VERSION = "2";
12
+ static PATCH_VERSION = "2";
13
+ static BUILD_VERSION = "3";
14
14
  static SDK_PLATFORM = "React Native";
15
15
  static SDK_VERSION = `${this.MAJOR_VERSION}.${this.MINOR_VERSION}.${this.PATCH_VERSION}-${this.BUILD_VERSION}`;
16
16
  }
@@ -5,8 +5,8 @@ export class AcmoConfig {
5
5
  static BASE_URL = `https://api.tyrads.com/v${this.API_VERSION}/`;
6
6
  static MAJOR_VERSION = "4";
7
7
  static MINOR_VERSION = "0";
8
- static PATCH_VERSION = "1";
9
- static BUILD_VERSION = "2";
8
+ static PATCH_VERSION = "2";
9
+ static BUILD_VERSION = "3";
10
10
  static SDK_PLATFORM = "React Native";
11
11
  static SDK_VERSION = `${this.MAJOR_VERSION}.${this.MINOR_VERSION}.${this.PATCH_VERSION}-${this.BUILD_VERSION}`;
12
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tyrads.com/tyrads-sdk",
3
- "version": "4.0.1-beta.0",
3
+ "version": "4.0.2-beta.0",
4
4
  "description": "Tyrads SDK for React Native ",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",
@@ -194,4 +194,4 @@
194
194
  "react-native-linear-gradient": "^2.8.3",
195
195
  "react-native-snap-carousel": "^3.9.1"
196
196
  }
197
- }
197
+ }
@@ -3,8 +3,8 @@ export class AcmoConfig {
3
3
  public static BASE_URL = `https://api.tyrads.com/v${this.API_VERSION}/`;
4
4
  public static MAJOR_VERSION = "4";
5
5
  public static MINOR_VERSION = "0";
6
- public static PATCH_VERSION = "1";
7
- public static BUILD_VERSION = "2";
6
+ public static PATCH_VERSION = "2";
7
+ public static BUILD_VERSION = "3";
8
8
  public static SDK_PLATFORM = "React Native";
9
9
  public static SDK_VERSION = `${this.MAJOR_VERSION}.${this.MINOR_VERSION}.${this.PATCH_VERSION}-${this.BUILD_VERSION}`;
10
10
  }