nimbbl-mobile-react-native-sdk 1.3.0 → 1.3.2
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 +51 -19
- package/android/build.gradle +4 -4
- package/android/src/main/java/com/nimbbl/reactnative/NimbblCheckoutActivity.kt +7 -3
- package/android/src/main/java/com/nimbbl/reactnative/NimbblReactNativeSDKModule.kt +7 -0
- package/ios/NimbblReactNativeSDK.swift +5 -0
- package/lib/constants.d.ts +1 -0
- package/lib/constants.js +1 -0
- package/lib/types.d.ts +2 -0
- package/nimbbl-mobile-react-native-sdk.podspec +1 -1
- package/package.json +3 -4
- package/ios/NimbblReactNativeSDK.podspec +0 -38
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Nimbbl React Native SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**✅ Stable Release v1.3.2 - Production Ready!**
|
|
4
4
|
|
|
5
5
|
A comprehensive React Native SDK for integrating Nimbbl payment gateway into your mobile applications. This SDK provides a seamless bridge between React Native and native payment functionality, offering a unified API for both iOS and Android platforms.
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@ A comprehensive React Native SDK for integrating Nimbbl payment gateway into you
|
|
|
14
14
|
- 🛡️ **Type Safety** - Comprehensive TypeScript definitions for better development experience
|
|
15
15
|
- 📊 **Production Ready** - Built-in analytics, logging, and error handling
|
|
16
16
|
- 🔄 **Unified Event Handling** - Single callback system for all payment responses
|
|
17
|
-
- 🎯 **Latest Native SDKs** - Built on iOS 2.0.
|
|
17
|
+
- 🎯 **Latest Native SDKs** - Built on iOS 2.0.16 and Android 4.0.9
|
|
18
18
|
|
|
19
19
|
## 🚀 Quick Start
|
|
20
20
|
|
|
@@ -98,10 +98,10 @@ await nimbblSDK.checkout({
|
|
|
98
98
|
|
|
99
99
|
## 🎯 Why Choose Nimbbl React Native SDK?
|
|
100
100
|
|
|
101
|
-
- ✅ **
|
|
101
|
+
- ✅ **Stable Release**: Production-ready SDK with comprehensive testing and bug fixes
|
|
102
102
|
- ✅ **Production Ready**: Thoroughly tested and optimized for production environments
|
|
103
103
|
- ✅ **Cross-Platform Consistency**: Identical behavior on iOS and Android
|
|
104
|
-
- ✅ **Latest Native SDKs**: Built on the most recent iOS (2.0.
|
|
104
|
+
- ✅ **Latest Native SDKs**: Built on the most recent iOS (2.0.16) and Android (4.0.9) SDKs
|
|
105
105
|
- ✅ **TypeScript First**: Full TypeScript support with comprehensive type definitions
|
|
106
106
|
- ✅ **Simple Integration**: Get started in minutes with our straightforward API
|
|
107
107
|
|
|
@@ -122,6 +122,12 @@ const nimbblSDK = NimbblSDK.getSharedInstance();
|
|
|
122
122
|
|
|
123
123
|
// Initialize with default production configuration
|
|
124
124
|
await nimbblSDK.initialize();
|
|
125
|
+
|
|
126
|
+
// OR initialize with custom configuration
|
|
127
|
+
await nimbblSDK.initialize({
|
|
128
|
+
api_base_url: 'https://api.nimbbl.tech/',
|
|
129
|
+
app_code: 'your_custom_app_code' // Optional: defaults to 'reactnative_webview_sdk'
|
|
130
|
+
});
|
|
125
131
|
```
|
|
126
132
|
|
|
127
133
|
|
|
@@ -317,7 +323,7 @@ class PaymentManager {
|
|
|
317
323
|
**Problem**: WebView opens and closes, but payment status screen doesn't appear.
|
|
318
324
|
|
|
319
325
|
**Solution**:
|
|
320
|
-
- Ensure you're using the latest SDK version (`^1.
|
|
326
|
+
- Ensure you're using the latest SDK version (`^1.3.2`)
|
|
321
327
|
- The SDK automatically manages event listeners - no manual setup required
|
|
322
328
|
- Check that your app properly handles the payment success/failure events
|
|
323
329
|
|
|
@@ -418,19 +424,20 @@ npm install nimbbl-mobile-react-native-sdk@1.0.0-alpha.3
|
|
|
418
424
|
**✅ Stable version is now available!**
|
|
419
425
|
|
|
420
426
|
```bash
|
|
421
|
-
# Upgrade
|
|
422
|
-
npm install nimbbl-mobile-react-native-sdk@^1.
|
|
427
|
+
# Upgrade to latest stable version
|
|
428
|
+
npm install nimbbl-mobile-react-native-sdk@^1.3.2
|
|
423
429
|
|
|
424
430
|
# Update your package.json
|
|
425
431
|
# Change from: "nimbbl-mobile-react-native-sdk": "^1.0.0-alpha.12"
|
|
426
|
-
# To: "nimbbl-mobile-react-native-sdk": "^1.
|
|
432
|
+
# To: "nimbbl-mobile-react-native-sdk": "^1.3.2"
|
|
427
433
|
```
|
|
428
434
|
|
|
429
|
-
**Key Changes in
|
|
430
|
-
- ✅ **Automatic Event Listener Management**: SDK
|
|
435
|
+
**Key Changes in Stable Versions:**
|
|
436
|
+
- ✅ **Automatic Event Listener Management**: SDK automatically manages event listeners for optimal performance
|
|
431
437
|
- ✅ **Simplified Integration**: No need to manually add/remove event listeners
|
|
432
438
|
- ✅ **Enhanced Error Handling**: Improved error messages and debugging capabilities
|
|
433
439
|
- ✅ **Production Ready**: Fully tested and optimized for production use
|
|
440
|
+
- ✅ **Updated Native SDKs**: Latest iOS (2.0.16) and Android (4.0.9) SDK integrations
|
|
434
441
|
|
|
435
442
|
### Breaking Changes Migration
|
|
436
443
|
|
|
@@ -447,7 +454,7 @@ For production applications, consider locking to specific versions:
|
|
|
447
454
|
```json
|
|
448
455
|
{
|
|
449
456
|
"dependencies": {
|
|
450
|
-
"nimbbl-mobile-react-native-sdk": "1.
|
|
457
|
+
"nimbbl-mobile-react-native-sdk": "1.3.2"
|
|
451
458
|
}
|
|
452
459
|
}
|
|
453
460
|
```
|
|
@@ -460,13 +467,43 @@ For production applications, consider locking to specific versions:
|
|
|
460
467
|
|
|
461
468
|
## 📝 Release Notes
|
|
462
469
|
|
|
463
|
-
### v1.3.
|
|
470
|
+
### v1.3.2 - Stable Release ✅
|
|
471
|
+
|
|
472
|
+
**🚀 Stable Production-Ready React Native SDK for Nimbbl Payments**
|
|
473
|
+
|
|
474
|
+
#### 🔧 Updates & Fixes
|
|
475
|
+
- **Updated iOS Native SDK**: Upgraded to iOS SDK v2.0.16 for improved stability and features
|
|
476
|
+
- **Updated Android Native SDK**: Upgraded to Android SDK v4.0.9 for enhanced performance
|
|
477
|
+
- **Podspec Improvements**: Updated podspec configuration for better CocoaPods integration
|
|
478
|
+
- **Test Fixes**: Fixed test expectations to match actual SDK behavior
|
|
479
|
+
- **Code Quality**: Improved code formatting and linting compliance
|
|
480
|
+
|
|
481
|
+
#### ✨ Features
|
|
482
|
+
- **Unified API**: Single API for both iOS and Android platforms
|
|
483
|
+
- **Latest Native SDKs**: Built on iOS 2.0.16 and Android 4.0.9
|
|
484
|
+
- **TypeScript Support**: Full TypeScript definitions for better development experience
|
|
485
|
+
- **Cross-Platform Consistency**: Identical behavior on iOS and Android
|
|
486
|
+
- **Production Ready**: Optimized for production environments with comprehensive error handling
|
|
487
|
+
|
|
488
|
+
#### 🛠️ Technical Highlights
|
|
489
|
+
- **Modern Architecture**: Built with React Native best practices
|
|
490
|
+
- **Native Bridge**: Seamless communication between React Native and native SDKs
|
|
491
|
+
- **Performance Optimized**: Efficient memory management and callback handling
|
|
492
|
+
- **Clean Codebase**: Production-ready code with no debug artifacts
|
|
493
|
+
- **Comprehensive Testing**: Full test coverage with 20+ test cases (all passing)
|
|
494
|
+
|
|
495
|
+
#### 📱 Platform Support
|
|
496
|
+
- **iOS**: iOS 13.0+ with Swift implementation
|
|
497
|
+
- **Android**: API Level 21+ (Android 5.0) with Kotlin implementation
|
|
498
|
+
- **React Native**: 0.70.0+ support with 0.76.0 recommended
|
|
499
|
+
|
|
500
|
+
### v1.3.0 - Initial Stable Release 🎉
|
|
464
501
|
|
|
465
502
|
**🚀 Production-Ready React Native SDK for Nimbbl Payments**
|
|
466
503
|
|
|
467
504
|
#### ✨ Features
|
|
468
505
|
- **Unified API**: Single API for both iOS and Android platforms
|
|
469
|
-
- **Latest Native SDKs**: Built on iOS 2.0.
|
|
506
|
+
- **Latest Native SDKs**: Built on iOS 2.0.7 and Android 4.0.4
|
|
470
507
|
- **TypeScript Support**: Full TypeScript definitions for better development experience
|
|
471
508
|
- **Cross-Platform Consistency**: Identical behavior on iOS and Android
|
|
472
509
|
- **Production Ready**: Optimized for production environments with comprehensive error handling
|
|
@@ -485,14 +522,9 @@ For production applications, consider locking to specific versions:
|
|
|
485
522
|
- **Clean Codebase**: Production-ready code with no debug artifacts
|
|
486
523
|
- **Comprehensive Testing**: Full test coverage with 20+ test cases
|
|
487
524
|
|
|
488
|
-
#### 📱 Platform Support
|
|
489
|
-
- **iOS**: iOS 13.0+ with Swift implementation
|
|
490
|
-
- **Android**: API Level 21+ (Android 5.0) with Kotlin implementation
|
|
491
|
-
- **React Native**: 0.70.0+ support with 0.76.0 recommended
|
|
492
|
-
|
|
493
525
|
## 🎯 What's Next?
|
|
494
526
|
|
|
495
|
-
|
|
527
|
+
Future releases will include:
|
|
496
528
|
|
|
497
529
|
- 🔄 **Enhanced Features**: Additional payment methods and customization options
|
|
498
530
|
- 🚀 **Performance Improvements**: Optimizations based on real-world usage
|
package/android/build.gradle
CHANGED
|
@@ -24,7 +24,7 @@ allprojects {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
group = 'com.nimbbl.reactnative'
|
|
27
|
-
version = '1.2
|
|
27
|
+
version = '1.3.2'
|
|
28
28
|
|
|
29
29
|
android {
|
|
30
30
|
namespace 'com.nimbbl.reactnative'
|
|
@@ -35,7 +35,7 @@ android {
|
|
|
35
35
|
minSdkVersion 24
|
|
36
36
|
targetSdkVersion 36
|
|
37
37
|
versionCode 1
|
|
38
|
-
versionName "1.2
|
|
38
|
+
versionName "1.3.2"
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
buildTypes {
|
|
@@ -65,7 +65,7 @@ dependencies {
|
|
|
65
65
|
implementation 'androidx.appcompat:appcompat:1.6.1'
|
|
66
66
|
|
|
67
67
|
// Nimbbl WebView SDK dependency (includes all necessary dependencies)
|
|
68
|
-
implementation '
|
|
68
|
+
implementation 'com.github.nimbbl-tech:nimbbl_mobile_kit_android_webview_sdk:v4.0.9'
|
|
69
69
|
|
|
70
70
|
// Add Retrofit and Coroutines dependencies for Android SDK
|
|
71
71
|
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
|
@@ -79,7 +79,7 @@ afterEvaluate {
|
|
|
79
79
|
from components.release
|
|
80
80
|
groupId = 'com.nimbbl.reactnative'
|
|
81
81
|
artifactId = 'nimbbl-react-native-sdk'
|
|
82
|
-
version = '1.2
|
|
82
|
+
version = '1.3.2'
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
}
|
|
@@ -38,6 +38,7 @@ class NimbblCheckoutActivity : Activity(), NimbblCheckoutPaymentListener {
|
|
|
38
38
|
const val EXTRA_BANK_CODE = "bank_code"
|
|
39
39
|
const val EXTRA_WALLET_CODE = "wallet_code"
|
|
40
40
|
const val EXTRA_PAYMENT_FLOW = "payment_flow"
|
|
41
|
+
const val EXTRA_APP_CODE = "app_code"
|
|
41
42
|
|
|
42
43
|
fun startCheckout(
|
|
43
44
|
activity: Activity,
|
|
@@ -45,7 +46,8 @@ class NimbblCheckoutActivity : Activity(), NimbblCheckoutPaymentListener {
|
|
|
45
46
|
paymentModeCode: String = "",
|
|
46
47
|
bankCode: String = "",
|
|
47
48
|
walletCode: String = "",
|
|
48
|
-
paymentFlow: String = ""
|
|
49
|
+
paymentFlow: String = "",
|
|
50
|
+
appCode: String = ""
|
|
49
51
|
) {
|
|
50
52
|
val intent = Intent(activity, NimbblCheckoutActivity::class.java).apply {
|
|
51
53
|
putExtra(EXTRA_ORDER_TOKEN, orderToken)
|
|
@@ -53,6 +55,7 @@ class NimbblCheckoutActivity : Activity(), NimbblCheckoutPaymentListener {
|
|
|
53
55
|
putExtra(EXTRA_BANK_CODE, bankCode)
|
|
54
56
|
putExtra(EXTRA_WALLET_CODE, walletCode)
|
|
55
57
|
putExtra(EXTRA_PAYMENT_FLOW, paymentFlow)
|
|
58
|
+
putExtra(EXTRA_APP_CODE, appCode)
|
|
56
59
|
}
|
|
57
60
|
|
|
58
61
|
activity.startActivity(intent)
|
|
@@ -70,6 +73,7 @@ class NimbblCheckoutActivity : Activity(), NimbblCheckoutPaymentListener {
|
|
|
70
73
|
val bankCode = intent.getStringExtra(EXTRA_BANK_CODE) ?: ""
|
|
71
74
|
val walletCode = intent.getStringExtra(EXTRA_WALLET_CODE) ?: ""
|
|
72
75
|
val paymentFlow = intent.getStringExtra(EXTRA_PAYMENT_FLOW) ?: ""
|
|
76
|
+
val appCode = intent.getStringExtra(EXTRA_APP_CODE) ?: ""
|
|
73
77
|
|
|
74
78
|
|
|
75
79
|
if (orderToken.isNullOrEmpty()) {
|
|
@@ -87,8 +91,8 @@ class NimbblCheckoutActivity : Activity(), NimbblCheckoutPaymentListener {
|
|
|
87
91
|
.setWalletCode(walletCode)
|
|
88
92
|
.build()
|
|
89
93
|
|
|
90
|
-
// Initialize SDK and start checkout
|
|
91
|
-
NimbblCheckoutSDK.getInstance().init(this)
|
|
94
|
+
// Initialize SDK with app code and start checkout
|
|
95
|
+
NimbblCheckoutSDK.getInstance().init(this, appCode)
|
|
92
96
|
NimbblCheckoutSDK.getInstance().checkout(checkoutOptions)
|
|
93
97
|
|
|
94
98
|
} catch (e: Exception) {
|
|
@@ -143,6 +143,7 @@ class NimbblReactNativeSDKModule(private val reactContext: ReactApplicationConte
|
|
|
143
143
|
// Extract configuration
|
|
144
144
|
this.config.clear()
|
|
145
145
|
this.config["api_base_url"] = config.getString("api_base_url") ?: "https://api.nimbbl.tech"
|
|
146
|
+
this.config["app_code"] = config.getString("app_code") ?: "reactnative_webview_sdk"
|
|
146
147
|
|
|
147
148
|
// Set environment URL on the native SDK during initialization
|
|
148
149
|
val apiBaseUrl = this.config["api_base_url"] as? String
|
|
@@ -151,6 +152,10 @@ class NimbblReactNativeSDKModule(private val reactContext: ReactApplicationConte
|
|
|
151
152
|
val normalizedUrl = if (apiBaseUrl.endsWith("/")) apiBaseUrl else apiBaseUrl + "/"
|
|
152
153
|
NimbblCheckoutSDK.getInstance().setEnvironmentUrl(normalizedUrl)
|
|
153
154
|
}
|
|
155
|
+
|
|
156
|
+
// Store appCode for later use during checkout
|
|
157
|
+
val appCode = this.config["app_code"] as? String ?: "reactnative_webview_sdk"
|
|
158
|
+
this.config["app_code"] = appCode
|
|
154
159
|
|
|
155
160
|
isInitialized = true
|
|
156
161
|
|
|
@@ -392,12 +397,14 @@ class NimbblReactNativeSDKModule(private val reactContext: ReactApplicationConte
|
|
|
392
397
|
// Add a small delay to ensure callback is properly set up
|
|
393
398
|
android.os.Handler(android.os.Looper.getMainLooper()).postDelayed({
|
|
394
399
|
// Start the NimbblCheckoutActivity
|
|
400
|
+
val appCode = this.config["app_code"] as? String ?: "reactnative_webview_sdk"
|
|
395
401
|
val intent = Intent(currentActivity, NimbblCheckoutActivity::class.java).apply {
|
|
396
402
|
putExtra(NimbblCheckoutActivity.EXTRA_ORDER_TOKEN, orderToken)
|
|
397
403
|
putExtra(NimbblCheckoutActivity.EXTRA_PAYMENT_MODE_CODE, paymentModeCode)
|
|
398
404
|
putExtra(NimbblCheckoutActivity.EXTRA_BANK_CODE, bankCode)
|
|
399
405
|
putExtra(NimbblCheckoutActivity.EXTRA_WALLET_CODE, walletCode)
|
|
400
406
|
putExtra(NimbblCheckoutActivity.EXTRA_PAYMENT_FLOW, paymentFlow)
|
|
407
|
+
putExtra(NimbblCheckoutActivity.EXTRA_APP_CODE, appCode)
|
|
401
408
|
}
|
|
402
409
|
|
|
403
410
|
currentActivity.startActivity(intent)
|
|
@@ -43,6 +43,7 @@ class NimbblReactNativeSDK: RCTEventEmitter, NimbblCheckoutSDKDelegate {
|
|
|
43
43
|
// Extract configuration
|
|
44
44
|
self.config.removeAll()
|
|
45
45
|
self.config["api_base_url"] = config["api_base_url"] as? String ?? "https://api.nimbbl.tech"
|
|
46
|
+
self.config["app_code"] = config["app_code"] as? String ?? "reactnative_webview_sdk"
|
|
46
47
|
|
|
47
48
|
// Set environment URL on the native SDK during initialization
|
|
48
49
|
let apiBaseUrl = self.config["api_base_url"] as? String
|
|
@@ -52,6 +53,10 @@ class NimbblReactNativeSDK: RCTEventEmitter, NimbblCheckoutSDKDelegate {
|
|
|
52
53
|
NimbblCheckoutSDK.shared.environmentUrl = normalizedUrl
|
|
53
54
|
}
|
|
54
55
|
|
|
56
|
+
// Initialize the native SDK with appCode
|
|
57
|
+
let appCode = self.config["app_code"] as? String
|
|
58
|
+
NimbblCheckoutSDK.shared.initialize(appCode: appCode)
|
|
59
|
+
|
|
55
60
|
isInitialized = true
|
|
56
61
|
|
|
57
62
|
let result: [String: Any] = [
|
package/lib/constants.d.ts
CHANGED
package/lib/constants.js
CHANGED
package/lib/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nimbbl-mobile-react-native-sdk",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "Nimbbl React Native SDK for payment integration",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -71,15 +71,14 @@
|
|
|
71
71
|
"react": "18.2.0",
|
|
72
72
|
"react-native": "0.76.0",
|
|
73
73
|
"ts-jest": "^29.1.0",
|
|
74
|
-
"typescript": "^5.0.0"
|
|
75
|
-
},
|
|
76
|
-
"dependencies": {
|
|
74
|
+
"typescript": "^5.0.0",
|
|
77
75
|
"@react-navigation/native": "^7.1.18",
|
|
78
76
|
"@react-navigation/stack": "^7.4.9",
|
|
79
77
|
"react-native-gesture-handler": "^2.28.0",
|
|
80
78
|
"react-native-safe-area-context": "^5.6.1",
|
|
81
79
|
"react-native-screens": "^4.16.0"
|
|
82
80
|
},
|
|
81
|
+
"dependencies": {},
|
|
83
82
|
"files": [
|
|
84
83
|
"lib/constants.js",
|
|
85
84
|
"lib/constants.d.ts",
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
require 'json'
|
|
2
|
-
|
|
3
|
-
package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
|
|
4
|
-
|
|
5
|
-
Pod::Spec.new do |s|
|
|
6
|
-
s.name = 'NimbblReactNativeSDK'
|
|
7
|
-
s.version = package['version']
|
|
8
|
-
s.summary = package['description']
|
|
9
|
-
s.homepage = package['homepage']
|
|
10
|
-
s.license = package['license']
|
|
11
|
-
s.author = package['author']
|
|
12
|
-
s.platform = :ios, "13.0"
|
|
13
|
-
s.source = { :git => "https://github.com/nimbbl-tech/nimbbl_mobile_kit_react_native_sdk.git", :tag => "#{s.version}" }
|
|
14
|
-
s.source_files = "*.{h,m,swift}"
|
|
15
|
-
s.swift_version = '5.0'
|
|
16
|
-
s.requires_arc = true
|
|
17
|
-
|
|
18
|
-
s.dependency "React-Core"
|
|
19
|
-
|
|
20
|
-
# Nimbbl WebView SDK dependency (includes all necessary dependencies)
|
|
21
|
-
s.dependency "nimbbl_mobile_kit_ios_webview_sdk", "~> 2.0.4"
|
|
22
|
-
|
|
23
|
-
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
24
|
-
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
|
25
|
-
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
|
|
26
|
-
s.pod_target_xcconfig = {
|
|
27
|
-
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
28
|
-
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
|
29
|
-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
30
|
-
}
|
|
31
|
-
s.dependency "React-RCTFabric"
|
|
32
|
-
s.dependency "React-Codegen"
|
|
33
|
-
s.dependency "RCT-Folly"
|
|
34
|
-
s.dependency "RCTRequired"
|
|
35
|
-
s.dependency "RCTTypeSafety"
|
|
36
|
-
s.dependency "ReactCommon/turbomodule/core"
|
|
37
|
-
end
|
|
38
|
-
end
|