@jimrising/easymerchantsdk-react-native 1.6.0 → 1.6.1

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.
package/README.md CHANGED
@@ -7,7 +7,7 @@ To add the path of sdk in your project. Open your `package.json` file and inside
7
7
 
8
8
  ```json
9
9
  "dependencies": {
10
- "@jimrising/easymerchantsdk-react-native": "^1.6.0"
10
+ "@jimrising/easymerchantsdk-react-native": "^1.6.1"
11
11
  },
12
12
  ```
13
13
 
@@ -40,6 +40,10 @@ allprojects {
40
40
  ## Changes in IOS side.
41
41
  Add below content inside the AppDelegate.swift File :-
42
42
 
43
+ ## Requirements
44
+ - Ruby 3.2.8
45
+
46
+
43
47
  Create a new file named AppDelegate.swift
44
48
  ```swift
45
49
  import UIKit
@@ -1 +1 @@
1
- #Thu Jun 19 14:12:11 IST 2025
1
+ #Tue Jun 24 09:49:20 IST 2025
@@ -2,8 +2,8 @@
2
2
  #import <React/RCTLog.h>
3
3
  #import <React/RCTBridgeModule.h>
4
4
 
5
- //#import <easymerchantsdk-Swift.h>
6
- #import <easymerchantsdk/easymerchantsdk-Swift.h>
5
+ #import <easymerchantsdk-Swift.h>
6
+ //#import <easymerchantsdk/easymerchantsdk-Swift.h>
7
7
 
8
8
  @interface EasyMerchantSdk ()
9
9
  @property (nonatomic, strong) EasyMerchantSdkPlugin *sdkPluginInstance;
@@ -504,8 +504,9 @@ class OTPVerificationVC: BaseVC {
504
504
  if let data = serviceData,
505
505
  let responseObj = try? JSONSerialization.jsonObject(with: data, options: []) as? [String: Any],
506
506
  let message = responseObj["message"] as? String {
507
- // self.presentPaymentErrorVC(errorMessage: message)
508
- self.showToast(message: message)
507
+ DispatchQueue.main.async {
508
+ self.showToast(message: message)
509
+ }
509
510
  }
510
511
  }
511
512
  }
@@ -5085,8 +5085,9 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
5085
5085
  if let data = serviceData,
5086
5086
  let responseObj = try? JSONSerialization.jsonObject(with: data, options: []) as? [String: Any],
5087
5087
  let message = responseObj["message"] as? String {
5088
- // self.presentPaymentErrorVC(errorMessage: message)
5089
- self.showToast(message: message)
5088
+ DispatchQueue.main.async {
5089
+ self.showToast(message: message)
5090
+ }
5090
5091
  }
5091
5092
  }
5092
5093
  }
@@ -6,13 +6,11 @@
6
6
  //
7
7
 
8
8
  import UIKit
9
- //import SDWebImage
10
9
 
11
10
  class ThreeDSecurePaymentDoneVC: BaseVC {
12
11
 
13
12
  @IBOutlet weak var imgViewPaymentDone: UIImageView!
14
13
  @IBOutlet weak var imgViewLoading: UIImageView!
15
- // @IBOutlet weak var imgViewLoading: SDAnimatedImageView!
16
14
  @IBOutlet weak var viewMain: UIView!
17
15
  @IBOutlet weak var lblCompleteAuthentication: UILabel!
18
16
  @IBOutlet weak var btnDone: UIButton!
@@ -144,26 +142,64 @@ class ThreeDSecurePaymentDoneVC: BaseVC {
144
142
  oneMinuteCountdownTimer = nil
145
143
  }
146
144
 
147
- func startRotatingImage() {
148
- let rotationAnimation = CABasicAnimation(keyPath: "transform.rotation")
149
- rotationAnimation.toValue = CGFloat.pi * 2 // 360 degrees in radians
150
- rotationAnimation.duration = 1 // Adjust the duration as needed
151
- rotationAnimation.isCumulative = true
152
- rotationAnimation.repeatCount = .infinity // Continuous rotation
153
- imgViewLoading.layer.add(rotationAnimation, forKey: "rotationAnimation")
145
+ // func startRotatingImage() {
146
+ // let rotationAnimation = CABasicAnimation(keyPath: "transform.rotation")
147
+ // rotationAnimation.toValue = CGFloat.pi * 2 // 360 degrees in radians
148
+ // rotationAnimation.duration = 1 // Adjust the duration as needed
149
+ // rotationAnimation.isCumulative = true
150
+ // rotationAnimation.repeatCount = .infinity // Continuous rotation
151
+ // imgViewLoading.layer.add(rotationAnimation, forKey: "rotationAnimation")
152
+ // }
153
+
154
+ private func showHourglassGIF() {
155
+ guard let bundlePath = Bundle.easyPayBundle.path(forResource: "hourglass", ofType: "gif"),
156
+ let gifData = try? Data(contentsOf: URL(fileURLWithPath: bundlePath)),
157
+ let source = CGImageSourceCreateWithData(gifData as CFData, nil) else {
158
+ print("⚠️ Could not load GIF from bundle")
159
+ return
154
160
  }
161
+
162
+ var images: [UIImage] = []
163
+ var duration: Double = 0
164
+
165
+ let frameCount = CGImageSourceGetCount(source)
166
+ for i in 0..<frameCount {
167
+ if let cgImage = CGImageSourceCreateImageAtIndex(source, i, nil) {
168
+ let frameDuration = getFrameDuration(from: source, index: i)
169
+ duration += frameDuration
170
+ images.append(UIImage(cgImage: cgImage))
171
+ }
172
+ }
173
+
174
+ if !images.isEmpty {
175
+ let animatedImage = UIImage.animatedImage(with: images, duration: duration)
176
+ imgViewLoading.image = animatedImage
177
+ imgViewLoading.contentMode = .scaleAspectFit
178
+ }
179
+ }
155
180
 
156
- // private func showHourglassGIF() {
157
- // if let bundlePath = Bundle.easyPayBundle.path(forResource: "hourglass", ofType: "gif") {
158
- // let url = URL(fileURLWithPath: bundlePath)
159
- // imgViewLoading.sd_setImage(with: url)
160
- // self.imgViewLoading.contentMode = .redraw
161
- // }
162
- // }
181
+ private func getFrameDuration(from source: CGImageSource, index: Int) -> Double {
182
+ let defaultFrameDuration = 0.1
183
+
184
+ guard let properties = CGImageSourceCopyPropertiesAtIndex(source, index, nil) as? [CFString: Any],
185
+ let gifProperties = properties[kCGImagePropertyGIFDictionary] as? [CFString: Any] else {
186
+ return defaultFrameDuration
187
+ }
188
+
189
+ if let unclampedDelay = gifProperties[kCGImagePropertyGIFUnclampedDelayTime] as? Double, unclampedDelay > 0 {
190
+ return unclampedDelay
191
+ }
192
+
193
+ if let delay = gifProperties[kCGImagePropertyGIFDelayTime] as? Double, delay > 0 {
194
+ return delay
195
+ }
196
+
197
+ return defaultFrameDuration
198
+ }
163
199
 
164
- // func startRotatingImage() {
165
- // showHourglassGIF()
166
- // }
200
+ func startRotatingImage() {
201
+ showHourglassGIF()
202
+ }
167
203
 
168
204
  private func setupTapOnLabel() {
169
205
  if let url = redirectURL {
@@ -255,7 +291,7 @@ class ThreeDSecurePaymentDoneVC: BaseVC {
255
291
  }
256
292
  oneMinuteCountdownTimer?.resume()
257
293
 
258
- // API check timer: runs continuously every 5 seconds until success/failure
294
+ // API check timer: runs continuously every 5 seconds until success/failure
259
295
  apiStatusCheckTimer = Timer.scheduledTimer(withTimeInterval: 5.0, repeats: true) { [weak self] _ in
260
296
  guard let self = self else { return }
261
297
  self.checkThreeDSecureStatus(completion: nil)
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'easymerchantsdk'
3
- s.version = '1.6.0'
3
+ s.version = '1.6.1'
4
4
  s.summary = 'A React Native SDK for Easy Merchant.'
5
5
  s.description = <<-DESC
6
6
  A React Native SDK to enable Easy Merchant functionality in mobile applications.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jimrising/easymerchantsdk-react-native",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {