From 42b850b1bc4c07f3cea54baaf70551300585f608 Mon Sep 17 00:00:00 2001 From: Sergei Kamakov Date: Fri, 1 Aug 2025 17:13:11 +0400 Subject: [PATCH] Update internal SDK libraries to android 3.8.9 and iOS 3.8.8. Upgrade React Native version --- CHANGELOG.md | 1 + android/build.gradle | 3 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../msdkreactnative/MsdkReactNativeModule.kt | 247 ++++++++-------- .../com/msdkreactnative/extensions/mapExt.kt | 4 +- .../example/MainApplication.kt | 3 +- example/android/build.gradle | 4 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../project.pbxproj | 272 +++++------------- example/package.json | 10 +- msdk-react-native.podspec | 2 +- package.json | 10 +- 12 files changed, 223 insertions(+), 337 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a84aeff..5898314 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2 +1,3 @@ ## [0.2.0] Initial release with working Android and iOS examples ## [0.2.1] Update internal SDK libraries to android 3.8.8 and iOS 3.8.5 +## [0.2.2] Update internal SDK libraries to android 3.8.9 and iOS 3.8.8. Upgrade React Native version diff --git a/android/build.gradle b/android/build.gradle index b854a55..36efefd 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -96,8 +96,7 @@ def kotlin_version = getExtOrDefault("kotlinVersion") dependencies { coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.3") - implementation "com.ecommpay:msdk-ui:3.8.8" - implementation "com.ecommpay:msdk-core-android:0.12.4" + implementation "com.ecommpay:msdk-ui:3.8.9" implementation "com.facebook.react:react-native:+" implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 1af9e09..09523c0 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/android/src/main/java/com/msdkreactnative/MsdkReactNativeModule.kt b/android/src/main/java/com/msdkreactnative/MsdkReactNativeModule.kt index 6bed851..2abf4ff 100644 --- a/android/src/main/java/com/msdkreactnative/MsdkReactNativeModule.kt +++ b/android/src/main/java/com/msdkreactnative/MsdkReactNativeModule.kt @@ -5,13 +5,8 @@ import android.content.Intent import android.util.Log import com.ecommpay.msdk.ui.EcmpActionType import com.ecommpay.msdk.ui.EcmpAdditionalField -import com.ecommpay.msdk.ui.EcmpAdditionalFieldType -import com.ecommpay.msdk.ui.EcmpPaymentInfo import com.ecommpay.msdk.ui.EcmpPaymentOptions import com.ecommpay.msdk.ui.EcmpPaymentSDK -import com.ecommpay.msdk.ui.EcmpRecipientInfo -import com.ecommpay.msdk.ui.EcmpRecurrentData -import com.ecommpay.msdk.ui.EcmpRecurrentDataSchedule import com.ecommpay.msdk.ui.EcmpScreenDisplayMode import com.facebook.react.bridge.ActivityEventListener import com.facebook.react.bridge.Arguments @@ -20,132 +15,142 @@ import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.bridge.ReactContextBaseJavaModule import com.facebook.react.bridge.ReactMethod import com.facebook.react.bridge.ReadableMap -import com.facebook.react.bridge.ReadableType -import com.msdkreactnative.extensions.* - -class MsdkReactNativeModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext), ActivityEventListener { - - init { - reactContext.addActivityEventListener(this) - } - - private var paymentPromise: Promise? = null - - override fun getName(): String { - return "MsdkReactNative" - } - - @ReactMethod - fun initializePaymentWithOptions( - params: ReadableMap, - promise: Promise - ) { - val currentActivity = currentActivity ?: return - - val ecmpPaymentInfo = params.getMap("paymentInfo")?.let { it.buildPaymentInfo() } - - params.getMap("paymentInfo")?.let { Log.d("INFO", it.toString()) } - - // Create payment options - val paymentOptions = EcmpPaymentOptions().apply { - if (ecmpPaymentInfo != null) { - paymentInfo = ecmpPaymentInfo - } - - actionType = EcmpActionType.entries.toTypedArray()[params.getInt("actionType") - 1] - - additionalFields { - params.getArray("additionalFields")?.let { array -> - mutableListOf().apply { - for (i in 0 until array.size()) { - add(array.getMap(i).buildAdditionalField()) - } - } - } ?: listOf() +import com.msdkreactnative.extensions.buildAdditionalField +import com.msdkreactnative.extensions.buildPaymentInfo +import com.msdkreactnative.extensions.buildRecipientInfo +import com.msdkreactnative.extensions.buildRecurrentInfo +import com.msdkreactnative.extensions.safeGetBoolean +import com.msdkreactnative.extensions.safeGetInt + +class MsdkReactNativeModule(reactContext: ReactApplicationContext) : + ReactContextBaseJavaModule(reactContext), ActivityEventListener { + + init { + reactContext.addActivityEventListener(this) + } + + private var paymentPromise: Promise? = null + + override fun getName(): String { + return "MsdkReactNative" + } + + @ReactMethod + fun initializePaymentWithOptions( + params: ReadableMap, + promise: Promise, + ) { + val currentActivity = currentActivity ?: return + + val ecmpPaymentInfo = params.getMap("paymentInfo")?.let { it.buildPaymentInfo() } + + params.getMap("paymentInfo")?.let { Log.d("INFO", it.toString()) } + + // Create payment options + val paymentOptions = EcmpPaymentOptions().apply { + if (ecmpPaymentInfo != null) { + paymentInfo = ecmpPaymentInfo + } + + actionType = EcmpActionType.entries.toTypedArray()[params.getInt("actionType") - 1] + + additionalFields { + params.getArray("additionalFields")?.let { array -> + mutableListOf().apply { + for (i in 0 until array.size()) { + array.getMap(i)?.buildAdditionalField()?.let { add(it) } } - - screenDisplayModes { - params.getArray("screenDisplayModes")?.let { array -> - mutableSetOf().apply { - for (i in 0 until array.size()) { - add(EcmpScreenDisplayMode.entries[array.getInt(i) - 1]) - } - } - } ?: emptySet() - } - - isDarkTheme = params.getBoolean("isDarkTheme") - recipientInfo = params.getMap("recipientInfo")?.let { it.buildRecipientInfo() } - recurrentData = params.getMap("recurrentData")?.let { it.buildRecurrentInfo() } - hideScanningCards = params.safeGetBoolean("hideScanningCards") - - merchantId = params.getString("googleMerchantId") ?: "" - merchantName = params.getString("googleMerchantName") ?: "" - isTestEnvironment = params.safeGetBoolean("googleIsTestEnvironment") - - // Brand customization - params.getString("brandColor")?.let { colorString -> - brandColor = colorString + } + } ?: listOf() + } + + screenDisplayModes { + params.getArray("screenDisplayModes")?.let { array -> + mutableSetOf().apply { + for (i in 0 until array.size()) { + add(EcmpScreenDisplayMode.entries[array.getInt(i) - 1]) } + } + } ?: emptySet() + } + + isDarkTheme = params.getBoolean("isDarkTheme") + recipientInfo = params.getMap("recipientInfo")?.let { it.buildRecipientInfo() } + recurrentData = params.getMap("recurrentData")?.let { it.buildRecurrentInfo() } + hideScanningCards = params.safeGetBoolean("hideScanningCards") + + merchantId = params.getString("googleMerchantId") ?: "" + merchantName = params.getString("googleMerchantName") ?: "" + isTestEnvironment = params.safeGetBoolean("googleIsTestEnvironment") + + // Brand customization + params.getString("brandColor")?.let { colorString -> + brandColor = colorString + } + + // Stored card type + storedCardType = params.safeGetInt("storedCardType") + } - // Stored card type - storedCardType = params.safeGetInt("storedCardType") - } + val mockMode = EcmpPaymentSDK.EcmpMockModeType.entries[params.getInt("mockModeType")] - val mockMode = EcmpPaymentSDK.EcmpMockModeType.entries[params.getInt("mockModeType")] + // Initialize SDK and open payment form + val sdk = EcmpPaymentSDK(currentActivity.applicationContext, paymentOptions, mockMode) - // Initialize SDK and open payment form - val sdk = EcmpPaymentSDK(currentActivity.applicationContext, paymentOptions, mockMode) + paymentPromise = promise - paymentPromise = promise + val intent = sdk.intent + currentActivity.startActivityForResult(intent, 1001) + } - val intent = sdk.intent - currentActivity.startActivityForResult(intent, 1001) - } + @ReactMethod + fun getParamsForSignature(params: ReadableMap, promise: Promise) { + Log.d("MSDK", "getParamsForSignature called with: $params") + try { + val paymentInfoMap = params.getMap("paymentInfo") ?: params + val ecmpPaymentInfo = paymentInfoMap.buildPaymentInfo() + Log.d("MSDK", "Created EcmpPaymentInfo: $ecmpPaymentInfo") - @ReactMethod - fun getParamsForSignature(params: ReadableMap, promise: Promise) { - Log.d("MSDK", "getParamsForSignature called with: $params") - try { - val paymentInfoMap = params.getMap("paymentInfo") ?: params - val ecmpPaymentInfo = paymentInfoMap.buildPaymentInfo() - Log.d("MSDK", "Created EcmpPaymentInfo: $ecmpPaymentInfo") - - val result = ecmpPaymentInfo.getParamsForSignature() - Log.d("MSDK", "getParamsForSignature result: $result") - promise.resolve(result) - } catch (e: Exception) { - Log.e("MSDK", "getParamsForSignature error: ${e.message}") - promise.reject("GET_PARAMS_ERROR", e.message, e) - } + val result = ecmpPaymentInfo.getParamsForSignature() + Log.d("MSDK", "getParamsForSignature result: $result") + promise.resolve(result) + } catch (e: Exception) { + Log.e("MSDK", "getParamsForSignature error: ${e.message}") + promise.reject("GET_PARAMS_ERROR", e.message, e) } - - override fun onActivityResult(activity: Activity?, requestCode: Int, resultCode: Int, data: Intent?) { - when (resultCode) { - EcmpPaymentSDK.RESULT_SUCCESS -> { - val paymentJson = data?.getStringExtra(EcmpPaymentSDK.EXTRA_PAYMENT) - val resultMap = Arguments.createMap() - resultMap.putString("paymentJson", paymentJson) - resultMap.putInt("resultCode", resultCode) - paymentPromise?.resolve(resultMap) - } - - EcmpPaymentSDK.RESULT_ERROR -> { - val errorCode = data?.getStringExtra(EcmpPaymentSDK.EXTRA_ERROR_CODE) - val errorMessage = data?.getStringExtra(EcmpPaymentSDK.EXTRA_ERROR_MESSAGE) - val resultMap = Arguments.createMap() - resultMap.putString("errorCode", errorCode) - resultMap.putString("errorMessage", errorMessage) - paymentPromise?.resolve(resultMap) - } - - else -> { - paymentPromise?.resolve(resultCode) - } - } - paymentPromise = null + } + + override fun onActivityResult( + activity: Activity?, + requestCode: Int, + resultCode: Int, + data: Intent?, + ) { + when (resultCode) { + EcmpPaymentSDK.RESULT_SUCCESS -> { + val paymentJson = data?.getStringExtra(EcmpPaymentSDK.EXTRA_PAYMENT) + val resultMap = Arguments.createMap() + resultMap.putString("paymentJson", paymentJson) + resultMap.putInt("resultCode", resultCode) + paymentPromise?.resolve(resultMap) + } + + EcmpPaymentSDK.RESULT_ERROR -> { + val errorCode = data?.getStringExtra(EcmpPaymentSDK.EXTRA_ERROR_CODE) + val errorMessage = data?.getStringExtra(EcmpPaymentSDK.EXTRA_ERROR_MESSAGE) + val resultMap = Arguments.createMap() + resultMap.putString("errorCode", errorCode) + resultMap.putString("errorMessage", errorMessage) + paymentPromise?.resolve(resultMap) + } + + else -> { + paymentPromise?.resolve(resultCode) + } } + paymentPromise = null + } - override fun onNewIntent(data: Intent?) {} + override fun onNewIntent(data: Intent?) {} } diff --git a/android/src/main/java/com/msdkreactnative/extensions/mapExt.kt b/android/src/main/java/com/msdkreactnative/extensions/mapExt.kt index b64e8ff..7e384be 100644 --- a/android/src/main/java/com/msdkreactnative/extensions/mapExt.kt +++ b/android/src/main/java/com/msdkreactnative/extensions/mapExt.kt @@ -41,7 +41,7 @@ fun ReadableMap.safeGetInt(key: String): Int { fun ReadableMap.buildPaymentInfo(): EcmpPaymentInfo { val signature = getString("signature") android.util.Log.d("PaymentInfo", "Signature from JS: $signature") - + return EcmpPaymentInfo( projectId = getInt("projectID"), paymentId = getString("paymentID") ?: "", @@ -81,7 +81,7 @@ fun ReadableMap.buildRecurrentInfo(): EcmpRecurrentData { val schedule = getArray("schedule")?.let { array -> mutableListOf().apply { for (i in 0 until array.size()) { - add(array.getMap(i).buildRecurrentInfoSchedule()) + array.getMap(i)?.buildRecurrentInfoSchedule()?.let { add(it) } } } } ?: listOf() diff --git a/example/android/app/src/main/java/msdkreactnative/example/MainApplication.kt b/example/android/app/src/main/java/msdkreactnative/example/MainApplication.kt index ff57842..412c71e 100644 --- a/example/android/app/src/main/java/msdkreactnative/example/MainApplication.kt +++ b/example/android/app/src/main/java/msdkreactnative/example/MainApplication.kt @@ -9,6 +9,7 @@ import com.facebook.react.ReactPackage import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost import com.facebook.react.defaults.DefaultReactNativeHost +import com.facebook.react.soloader.OpenSourceMergedSoMapping import com.facebook.soloader.SoLoader class MainApplication : Application(), ReactApplication { @@ -34,7 +35,7 @@ class MainApplication : Application(), ReactApplication { override fun onCreate() { super.onCreate() - SoLoader.init(this, false) + SoLoader.init(this, OpenSourceMergedSoMapping) if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { // If you opted-in for the New Architecture, we load the native entry point for this app. load() diff --git a/example/android/build.gradle b/example/android/build.gradle index 60cf025..7787fb4 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,7 +1,7 @@ buildscript { ext { buildToolsVersion = "35.0.0" - minSdkVersion = 23 + minSdkVersion = 24 compileSdkVersion = 35 targetSdkVersion = 35 ndkVersion = "26.1.10909125" @@ -13,7 +13,7 @@ buildscript { mavenCentral() } dependencies { - classpath("com.android.tools.build:gradle:8.1.1") + classpath('com.android.tools.build:gradle:8.11.1') classpath("com.facebook.react:react-native-gradle-plugin") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") } diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index 6f7a6eb..ed4c299 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/example/ios/MsdkReactNativeExample.xcodeproj/project.pbxproj b/example/ios/MsdkReactNativeExample.xcodeproj/project.pbxproj index ce9a9ab..41619ad 100644 --- a/example/ios/MsdkReactNativeExample.xcodeproj/project.pbxproj +++ b/example/ios/MsdkReactNativeExample.xcodeproj/project.pbxproj @@ -7,31 +7,18 @@ objects = { /* Begin PBXBuildFile section */ - 00E356F31AD99517003FC87E /* MsdkReactNativeExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* MsdkReactNativeExampleTests.m */; }; 0C80B921A6F3F58F76C31292 /* libPods-MsdkReactNativeExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-MsdkReactNativeExample.a */; }; 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 7699B88040F8A987B510C191 /* libPods-MsdkReactNativeExample-MsdkReactNativeExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-MsdkReactNativeExample-MsdkReactNativeExampleTests.a */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; ED315D7B9A26DFB8535D6560 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 044B26A852C377199855C725 /* PrivacyInfo.xcprivacy */; }; /* End PBXBuildFile section */ -/* Begin PBXContainerItemProxy section */ - 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 13B07F861A680F5B00A75B9A; - remoteInfo = MsdkReactNativeExample; - }; -/* End PBXContainerItemProxy section */ - /* Begin PBXFileReference section */ - 00E356EE1AD99517003FC87E /* MsdkReactNativeExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MsdkReactNativeExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 00E356F21AD99517003FC87E /* MsdkReactNativeExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MsdkReactNativeExampleTests.m; sourceTree = ""; }; - 044B26A852C377199855C725 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; name = PrivacyInfo.xcprivacy; path = MsdkReactNativeExample/PrivacyInfo.xcprivacy; sourceTree = ""; }; + 044B26A852C377199855C725 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = MsdkReactNativeExample/PrivacyInfo.xcprivacy; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* MsdkReactNativeExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MsdkReactNativeExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = MsdkReactNativeExample/AppDelegate.h; sourceTree = ""; }; 13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = MsdkReactNativeExample/AppDelegate.mm; sourceTree = ""; }; @@ -50,14 +37,6 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 00E356EB1AD99517003FC87E /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 7699B88040F8A987B510C191 /* libPods-MsdkReactNativeExample-MsdkReactNativeExampleTests.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -137,7 +116,6 @@ isa = PBXGroup; children = ( 13B07F961A680F5B00A75B9A /* MsdkReactNativeExample.app */, - 00E356EE1AD99517003FC87E /* MsdkReactNativeExampleTests.xctest */, ); name = Products; sourceTree = ""; @@ -156,27 +134,6 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 00E356ED1AD99517003FC87E /* MsdkReactNativeExampleTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "MsdkReactNativeExampleTests" */; - buildPhases = ( - A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */, - 00E356EA1AD99517003FC87E /* Sources */, - 00E356EB1AD99517003FC87E /* Frameworks */, - 00E356EC1AD99517003FC87E /* Resources */, - C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */, - F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - 00E356F51AD99517003FC87E /* PBXTargetDependency */, - ); - name = MsdkReactNativeExampleTests; - productName = MsdkReactNativeExampleTests; - productReference = 00E356EE1AD99517003FC87E /* MsdkReactNativeExampleTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; 13B07F861A680F5B00A75B9A /* MsdkReactNativeExample */ = { isa = PBXNativeTarget; buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "MsdkReactNativeExample" */; @@ -206,10 +163,6 @@ attributes = { LastUpgradeCheck = 1210; TargetAttributes = { - 00E356ED1AD99517003FC87E = { - CreatedOnToolsVersion = 6.2; - TestTargetID = 13B07F861A680F5B00A75B9A; - }; 13B07F861A680F5B00A75B9A = { LastSwiftMigration = 1120; }; @@ -229,19 +182,11 @@ projectRoot = ""; targets = ( 13B07F861A680F5B00A75B9A /* MsdkReactNativeExample */, - 00E356ED1AD99517003FC87E /* MsdkReactNativeExampleTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 00E356EC1AD99517003FC87E /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; 13B07F8E1A680F5B00A75B9A /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -288,28 +233,6 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-MsdkReactNativeExample/Pods-MsdkReactNativeExample-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-MsdkReactNativeExample-MsdkReactNativeExampleTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -332,23 +255,6 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-MsdkReactNativeExample-MsdkReactNativeExampleTests/Pods-MsdkReactNativeExample-MsdkReactNativeExampleTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-MsdkReactNativeExample-MsdkReactNativeExampleTests/Pods-MsdkReactNativeExample-MsdkReactNativeExampleTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-MsdkReactNativeExample-MsdkReactNativeExampleTests/Pods-MsdkReactNativeExample-MsdkReactNativeExampleTests-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -366,34 +272,9 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-MsdkReactNativeExample/Pods-MsdkReactNativeExample-resources.sh\"\n"; showEnvVarsInLog = 0; }; - F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-MsdkReactNativeExample-MsdkReactNativeExampleTests/Pods-MsdkReactNativeExample-MsdkReactNativeExampleTests-resources-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Copy Pods Resources"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-MsdkReactNativeExample-MsdkReactNativeExampleTests/Pods-MsdkReactNativeExample-MsdkReactNativeExampleTests-resources-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-MsdkReactNativeExample-MsdkReactNativeExampleTests/Pods-MsdkReactNativeExample-MsdkReactNativeExampleTests-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 00E356EA1AD99517003FC87E /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 00E356F31AD99517003FC87E /* MsdkReactNativeExampleTests.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 13B07F871A680F5B00A75B9A /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -405,66 +286,7 @@ }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 13B07F861A680F5B00A75B9A /* MsdkReactNativeExample */; - targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - /* Begin XCBuildConfiguration section */ - 00E356F61AD99517003FC87E /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 5B7EB9410499542E8C5724F5 /* Pods-MsdkReactNativeExample-MsdkReactNativeExampleTests.debug.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = MsdkReactNativeExampleTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.4; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - OTHER_LDFLAGS = ( - "-ObjC", - "-lc++", - "$(inherited)", - ); - PRODUCT_BUNDLE_IDENTIFIER = msdkreactnative.example; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MsdkReactNativeExample.app/MsdkReactNativeExample"; - }; - name = Debug; - }; - 00E356F71AD99517003FC87E /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 89C6BE57DB24E9ADA2F236DE /* Pods-MsdkReactNativeExample-MsdkReactNativeExampleTests.release.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - COPY_PHASE_STRIP = NO; - INFOPLIST_FILE = MsdkReactNativeExampleTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.4; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - OTHER_LDFLAGS = ( - "-ObjC", - "-lc++", - "$(inherited)", - ); - PRODUCT_BUNDLE_IDENTIFIER = msdkreactnative.example; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MsdkReactNativeExample.app/MsdkReactNativeExample"; - }; - name = Release; - }; 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-MsdkReactNativeExample.debug.xcconfig */; @@ -479,6 +301,42 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0; + OTHER_CFLAGS = ( + "$(inherited)", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/DoubleConversion/DoubleConversion.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/RCTDeprecation/RCTDeprecation.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/RCTFabric/React-RCTFabric.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/RCTRuntime/React-RCTRuntime.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/RCTTypeSafety/RCTTypeSafety.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/React/React-Core.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/ReactAppDependencyProvider/ReactAppDependencyProvider.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/ReactCodegen/ReactCodegen.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/ReactCommon/ReactCommon.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/React_Fabric/React-Fabric.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/React_FabricComponents/React-FabricComponents.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/React_NativeModulesApple/React-NativeModulesApple.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/React_RCTAppDelegate/React-RCTAppDelegate.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/folly/RCT-Folly.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/glog/glog.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/jsi/React-jsi.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/jsinspector_modern/React-jsinspector.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/jsinspector_modern_tracing/React-jsinspectortracing.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/react_debug/React-debug.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/react_featureflags/React-featureflags.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/react_nativemodule_defaults/React-defaultsnativemodule.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/react_nativemodule_dom/React-domnativemodule.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/react_nativemodule_featureflags/React-featureflagsnativemodule.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/react_nativemodule_idlecallbacks/React-idlecallbacksnativemodule.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/react_nativemodule_microtasks/React-microtasksnativemodule.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/react_renderer_css/React-renderercss.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/react_renderer_debug/React-rendererdebug.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/react_renderer_graphics/React-graphics.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/react_renderer_imagemanager/React-ImageManager.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/react_runtime/React-jsitooling.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/react_utils/React-utils.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/reacthermes/React-hermes.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/yoga/Yoga.modulemap\"", + ); OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -505,6 +363,43 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0; + OTHER_CFLAGS = ( + "$(inherited)", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/DoubleConversion/DoubleConversion.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/RCTDeprecation/RCTDeprecation.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/RCTFabric/React-RCTFabric.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/RCTRuntime/React-RCTRuntime.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/RCTTypeSafety/RCTTypeSafety.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/React/React-Core.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/ReactAppDependencyProvider/ReactAppDependencyProvider.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/ReactCodegen/ReactCodegen.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/ReactCommon/ReactCommon.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/React_Fabric/React-Fabric.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/React_FabricComponents/React-FabricComponents.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/React_NativeModulesApple/React-NativeModulesApple.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/React_RCTAppDelegate/React-RCTAppDelegate.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/folly/RCT-Folly.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/glog/glog.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/jsi/React-jsi.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/jsinspector_modern/React-jsinspector.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/jsinspector_modern_tracing/React-jsinspectortracing.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/react_debug/React-debug.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/react_featureflags/React-featureflags.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/react_nativemodule_defaults/React-defaultsnativemodule.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/react_nativemodule_dom/React-domnativemodule.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/react_nativemodule_featureflags/React-featureflagsnativemodule.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/react_nativemodule_idlecallbacks/React-idlecallbacksnativemodule.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/react_nativemodule_microtasks/React-microtasksnativemodule.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/react_renderer_css/React-renderercss.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/react_renderer_debug/React-rendererdebug.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/react_renderer_graphics/React-graphics.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/react_renderer_imagemanager/React-ImageManager.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/react_runtime/React-jsitooling.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/react_utils/React-utils.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/reacthermes/React-hermes.modulemap\"", + "-fmodule-map-file=\"${PODS_ROOT}/Headers/Public/yoga/Yoga.modulemap\"", + "-DNDEBUG", + ); OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -590,10 +485,7 @@ "-DFOLLY_CFG_NO_COROUTINES=1", "-DFOLLY_HAVE_CLOCK_GETTIME=1", ); - OTHER_LDFLAGS = ( - "$(inherited)", - " ", - ); + OTHER_LDFLAGS = "$(inherited) "; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG"; @@ -666,10 +558,7 @@ "-DFOLLY_CFG_NO_COROUTINES=1", "-DFOLLY_HAVE_CLOCK_GETTIME=1", ); - OTHER_LDFLAGS = ( - "$(inherited)", - " ", - ); + OTHER_LDFLAGS = "$(inherited) "; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; USE_HERMES = true; @@ -680,15 +569,6 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "MsdkReactNativeExampleTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 00E356F61AD99517003FC87E /* Debug */, - 00E356F71AD99517003FC87E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "MsdkReactNativeExample" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/example/package.json b/example/package.json index 336c068..fd9eea1 100644 --- a/example/package.json +++ b/example/package.json @@ -10,17 +10,17 @@ "build:ios": "react-native build-ios --scheme MsdkReactNativeExample --mode Debug --extra-params \"-sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO\"" }, "dependencies": { - "react": "18.3.1", - "react-native": "^0.75.3" + "react": "19.0.0", + "react-native": "^0.79.5" }, "devDependencies": { "@babel/core": "^7.20.0", "@babel/preset-env": "^7.20.0", "@babel/runtime": "^7.20.0", "@react-native-community/cli": "latest", - "@react-native/babel-preset": "0.75.3", - "@react-native/metro-config": "0.75.3", - "@react-native/typescript-config": "0.75.3", + "@react-native/babel-preset": "0.79.5", + "@react-native/metro-config": "0.79.5", + "@react-native/typescript-config": "0.79.5", "react-native-builder-bob": "^0.30.2" }, "engines": { diff --git a/msdk-react-native.podspec b/msdk-react-native.podspec index 71ad33c..97d0648 100644 --- a/msdk-react-native.podspec +++ b/msdk-react-native.podspec @@ -19,7 +19,7 @@ Pod::Spec.new do |s| # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0. # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79. install_modules_dependencies(s) - s.dependency 'EcommpaySDK_UI', '3.8.5' + s.dependency 'EcommpaySDK_UI', '3.8.8' # Don't install the dependencies when we run `pod install` in the old architecture. if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then diff --git a/package.json b/package.json index 799e702..e663e71 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "msdk-react-native", - "version": "0.2.1", + "version": "0.2.2", "description": "m", "source": "./src/index.tsx", "main": "./lib/commonjs/index.js", @@ -72,18 +72,18 @@ "@release-it/conventional-changelog": "^5.0.0", "@types/crypto-js": "^4.1.1", "@types/jest": "^29.5.5", - "@types/react": "^18.2.44", + "@types/react": "^19.0.0", "commitlint": "^17.0.2", "del-cli": "^5.1.0", - "eslint": "^8.51.0", + "eslint": "^9.32.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-prettier": "^5.0.1", "jest": "^29.7.0", "metro": "^0.82.4", "metro-core": "^0.82.4", "prettier": "^3.0.3", - "react": "18.3.1", - "react-native": "0.75.3", + "react": "19.0.0", + "react-native": "0.79.5", "react-native-builder-bob": "^0.30.2", "release-it": "^15.0.0", "turbo": "^1.10.7",