@juspay-tech/react-native-hyperswitch 0.2.1 → 0.3.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.
Files changed (183) hide show
  1. package/android/build.gradle +4 -10
  2. package/android/src/main/AndroidManifest.xml +0 -19
  3. package/android/src/main/assets/hyperswitch.bundle +172 -162
  4. package/android/src/main/java/com/hyperswitchsdkreactnative/internal/ReactFragment.kt +35 -1
  5. package/android/src/main/java/com/hyperswitchsdkreactnative/modules/HyperswitchSdkNativeModule.kt +30 -6
  6. package/android/src/main/java/com/hyperswitchsdkreactnative/provider/HyperProvider.kt +3 -2
  7. package/ios/hyperswitchSDK/Core/NativeModule/OTAServices.swift +1 -1
  8. package/ios/hyperswitchSDK/Core/Resources/hyperswitch.bundle +172 -162
  9. package/lib/bs/src/context/HyperProvider-JuspayTechReactNativeHyperswitch.cmt +0 -0
  10. package/lib/bs/src/hooks/useHyper-JuspayTechReactNativeHyperswitch.cmt +0 -0
  11. package/lib/bs/src/modules/NativeHyperswitchSdk-JuspayTechReactNativeHyperswitch.cmt +0 -0
  12. package/lib/bs/src/types/PaymentSheetConfiguration-JuspayTechReactNativeHyperswitch.cmt +0 -0
  13. package/lib/commonjs/index.bundle.js +11 -0
  14. package/lib/commonjs/index.bundle.js.map +1 -0
  15. package/lib/module/index.bundle.js +11 -0
  16. package/lib/module/index.bundle.js.map +1 -0
  17. package/lib/typescript/{commonjs/babel.config.d.ts.map → babel.config.d.ts.map} +1 -1
  18. package/lib/typescript/{commonjs/eslint.config.d.mts.map → eslint.config.d.mts.map} +1 -1
  19. package/lib/typescript/rollup.config.d.ts +23 -0
  20. package/lib/typescript/rollup.config.d.ts.map +1 -0
  21. package/lib/typescript/{commonjs/scripts → scripts}/bootstrap.d.ts.map +1 -1
  22. package/lib/typescript/src/context/HyperProvider.gen.d.ts.map +1 -0
  23. package/lib/typescript/src/context/HyperProvider.res.d.ts.map +1 -0
  24. package/lib/typescript/src/hooks/useHyper.gen.d.ts.map +1 -0
  25. package/lib/typescript/src/hooks/useHyper.res.d.ts.map +1 -0
  26. package/lib/typescript/src/index.d.ts.map +1 -0
  27. package/lib/typescript/src/modules/NativeHyperswitchSdk.gen.d.ts.map +1 -0
  28. package/lib/typescript/src/modules/NativeHyperswitchSdk.res.d.ts.map +1 -0
  29. package/lib/typescript/src/shims/Js.shim.d.ts.map +1 -0
  30. package/lib/typescript/src/specs/ApplePayButtonNativeComponent.d.ts.map +1 -0
  31. package/lib/typescript/src/specs/GooglePayButtonNativeComponent.android.d.ts.map +1 -0
  32. package/lib/typescript/src/specs/HyperswitchSdkReactNativeViewNativeComponent.d.ts.map +1 -0
  33. package/lib/typescript/src/specs/NativeHyperswitchSdkNative.d.ts.map +1 -0
  34. package/lib/typescript/src/specs/NativeHyperswitchSdkReactNative.d.ts.map +1 -0
  35. package/lib/typescript/src/types/PaymentSheetConfiguration.gen.d.ts.map +1 -0
  36. package/lib/typescript/src/types/PaymentSheetConfiguration.res.d.ts.map +1 -0
  37. package/package.json +27 -27
  38. package/rescript.json +31 -0
  39. package/tsconfig.build.json +20 -0
  40. package/android/src/main/java/com/hyperswitchsdkreactnative/activity/RedirectActivity.kt +0 -39
  41. package/android/src/main/java/io/hyperswitch/logs/CrashHandler.kt +0 -29
  42. package/android/src/main/java/io/hyperswitch/logs/Debouncer.kt +0 -20
  43. package/android/src/main/java/io/hyperswitch/logs/HyperLogManager.kt +0 -113
  44. package/android/src/main/java/io/hyperswitch/logs/LogData.kt +0 -159
  45. package/android/src/main/java/io/hyperswitch/logs/LogFileManager.kt +0 -60
  46. package/android/src/main/java/io/hyperswitch/networking/HyperNetworking.kt +0 -73
  47. package/lib/commonjs/context/HyperProvider.gen.js +0 -16
  48. package/lib/commonjs/context/HyperProvider.gen.js.map +0 -1
  49. package/lib/commonjs/context/HyperProvider.res +0 -78
  50. package/lib/commonjs/context/HyperProvider.res.js +0 -98
  51. package/lib/commonjs/context/HyperProvider.res.js.map +0 -1
  52. package/lib/commonjs/hooks/useHyper.gen.js +0 -15
  53. package/lib/commonjs/hooks/useHyper.gen.js.map +0 -1
  54. package/lib/commonjs/hooks/useHyper.res +0 -142
  55. package/lib/commonjs/hooks/useHyper.res.js +0 -152
  56. package/lib/commonjs/hooks/useHyper.res.js.map +0 -1
  57. package/lib/commonjs/index.js +0 -26
  58. package/lib/commonjs/index.js.map +0 -1
  59. package/lib/commonjs/modules/NativeHyperswitchSdk.gen.js +0 -6
  60. package/lib/commonjs/modules/NativeHyperswitchSdk.gen.js.map +0 -1
  61. package/lib/commonjs/modules/NativeHyperswitchSdk.res +0 -55
  62. package/lib/commonjs/modules/NativeHyperswitchSdk.res.js +0 -14
  63. package/lib/commonjs/modules/NativeHyperswitchSdk.res.js.map +0 -1
  64. package/lib/commonjs/package.json +0 -1
  65. package/lib/commonjs/shims/Js.shim.js +0 -2
  66. package/lib/commonjs/shims/Js.shim.js.map +0 -1
  67. package/lib/commonjs/specs/ApplePayButtonNativeComponent.ts +0 -11
  68. package/lib/commonjs/specs/GooglePayButtonNativeComponent.android.js +0 -10
  69. package/lib/commonjs/specs/GooglePayButtonNativeComponent.android.js.map +0 -1
  70. package/lib/commonjs/specs/HyperswitchSdkReactNativeViewNativeComponent.ts +0 -10
  71. package/lib/commonjs/specs/NativeHyperswitchSdkNative.js +0 -9
  72. package/lib/commonjs/specs/NativeHyperswitchSdkNative.js.map +0 -1
  73. package/lib/commonjs/specs/NativeHyperswitchSdkReactNative.js +0 -9
  74. package/lib/commonjs/specs/NativeHyperswitchSdkReactNative.js.map +0 -1
  75. package/lib/commonjs/types/PaymentSheetConfiguration.gen.js +0 -2
  76. package/lib/commonjs/types/PaymentSheetConfiguration.gen.js.map +0 -1
  77. package/lib/commonjs/types/PaymentSheetConfiguration.res +0 -215
  78. package/lib/commonjs/types/PaymentSheetConfiguration.res.js +0 -4
  79. package/lib/commonjs/types/PaymentSheetConfiguration.res.js.map +0 -1
  80. package/lib/module/context/HyperProvider.gen.js +0 -11
  81. package/lib/module/context/HyperProvider.gen.js.map +0 -1
  82. package/lib/module/context/HyperProvider.res +0 -78
  83. package/lib/module/context/HyperProvider.res.js +0 -91
  84. package/lib/module/context/HyperProvider.res.js.map +0 -1
  85. package/lib/module/hooks/useHyper.gen.js +0 -10
  86. package/lib/module/hooks/useHyper.gen.js.map +0 -1
  87. package/lib/module/hooks/useHyper.res +0 -142
  88. package/lib/module/hooks/useHyper.res.js +0 -142
  89. package/lib/module/hooks/useHyper.res.js.map +0 -1
  90. package/lib/module/index.js +0 -5
  91. package/lib/module/index.js.map +0 -1
  92. package/lib/module/modules/NativeHyperswitchSdk.gen.js +0 -4
  93. package/lib/module/modules/NativeHyperswitchSdk.gen.js.map +0 -1
  94. package/lib/module/modules/NativeHyperswitchSdk.res +0 -55
  95. package/lib/module/modules/NativeHyperswitchSdk.res.js +0 -9
  96. package/lib/module/modules/NativeHyperswitchSdk.res.js.map +0 -1
  97. package/lib/module/package.json +0 -1
  98. package/lib/module/shims/Js.shim.js +0 -2
  99. package/lib/module/shims/Js.shim.js.map +0 -1
  100. package/lib/module/specs/ApplePayButtonNativeComponent.ts +0 -11
  101. package/lib/module/specs/GooglePayButtonNativeComponent.android.js +0 -5
  102. package/lib/module/specs/GooglePayButtonNativeComponent.android.js.map +0 -1
  103. package/lib/module/specs/HyperswitchSdkReactNativeViewNativeComponent.ts +0 -10
  104. package/lib/module/specs/NativeHyperswitchSdkNative.js +0 -5
  105. package/lib/module/specs/NativeHyperswitchSdkNative.js.map +0 -1
  106. package/lib/module/specs/NativeHyperswitchSdkReactNative.js +0 -5
  107. package/lib/module/specs/NativeHyperswitchSdkReactNative.js.map +0 -1
  108. package/lib/module/types/PaymentSheetConfiguration.gen.js +0 -2
  109. package/lib/module/types/PaymentSheetConfiguration.gen.js.map +0 -1
  110. package/lib/module/types/PaymentSheetConfiguration.res +0 -215
  111. package/lib/module/types/PaymentSheetConfiguration.res.js +0 -4
  112. package/lib/module/types/PaymentSheetConfiguration.res.js.map +0 -1
  113. package/lib/typescript/commonjs/package.json +0 -1
  114. package/lib/typescript/commonjs/src/context/HyperProvider.gen.d.ts.map +0 -1
  115. package/lib/typescript/commonjs/src/context/HyperProvider.res.d.ts.map +0 -1
  116. package/lib/typescript/commonjs/src/hooks/useHyper.gen.d.ts.map +0 -1
  117. package/lib/typescript/commonjs/src/hooks/useHyper.res.d.ts.map +0 -1
  118. package/lib/typescript/commonjs/src/index.d.ts.map +0 -1
  119. package/lib/typescript/commonjs/src/modules/NativeHyperswitchSdk.gen.d.ts.map +0 -1
  120. package/lib/typescript/commonjs/src/modules/NativeHyperswitchSdk.res.d.ts.map +0 -1
  121. package/lib/typescript/commonjs/src/shims/Js.shim.d.ts.map +0 -1
  122. package/lib/typescript/commonjs/src/specs/ApplePayButtonNativeComponent.d.ts.map +0 -1
  123. package/lib/typescript/commonjs/src/specs/GooglePayButtonNativeComponent.android.d.ts.map +0 -1
  124. package/lib/typescript/commonjs/src/specs/HyperswitchSdkReactNativeViewNativeComponent.d.ts.map +0 -1
  125. package/lib/typescript/commonjs/src/specs/NativeHyperswitchSdkNative.d.ts.map +0 -1
  126. package/lib/typescript/commonjs/src/specs/NativeHyperswitchSdkReactNative.d.ts.map +0 -1
  127. package/lib/typescript/commonjs/src/types/PaymentSheetConfiguration.gen.d.ts.map +0 -1
  128. package/lib/typescript/commonjs/src/types/PaymentSheetConfiguration.res.d.ts.map +0 -1
  129. package/lib/typescript/module/babel.config.d.ts +0 -10
  130. package/lib/typescript/module/babel.config.d.ts.map +0 -1
  131. package/lib/typescript/module/eslint.config.d.mts +0 -3
  132. package/lib/typescript/module/eslint.config.d.mts.map +0 -1
  133. package/lib/typescript/module/package.json +0 -1
  134. package/lib/typescript/module/scripts/bootstrap.d.ts +0 -2
  135. package/lib/typescript/module/scripts/bootstrap.d.ts.map +0 -1
  136. package/lib/typescript/module/src/context/HyperProvider.gen.d.ts +0 -17
  137. package/lib/typescript/module/src/context/HyperProvider.gen.d.ts.map +0 -1
  138. package/lib/typescript/module/src/context/HyperProvider.res.d.ts +0 -20
  139. package/lib/typescript/module/src/context/HyperProvider.res.d.ts.map +0 -1
  140. package/lib/typescript/module/src/hooks/useHyper.gen.d.ts +0 -10
  141. package/lib/typescript/module/src/hooks/useHyper.gen.d.ts.map +0 -1
  142. package/lib/typescript/module/src/hooks/useHyper.res.d.ts +0 -95
  143. package/lib/typescript/module/src/hooks/useHyper.res.d.ts.map +0 -1
  144. package/lib/typescript/module/src/index.d.ts +0 -4
  145. package/lib/typescript/module/src/index.d.ts.map +0 -1
  146. package/lib/typescript/module/src/modules/NativeHyperswitchSdk.gen.d.ts +0 -24
  147. package/lib/typescript/module/src/modules/NativeHyperswitchSdk.gen.d.ts.map +0 -1
  148. package/lib/typescript/module/src/modules/NativeHyperswitchSdk.res.d.ts +0 -2
  149. package/lib/typescript/module/src/modules/NativeHyperswitchSdk.res.d.ts.map +0 -1
  150. package/lib/typescript/module/src/shims/Js.shim.d.ts +0 -4
  151. package/lib/typescript/module/src/shims/Js.shim.d.ts.map +0 -1
  152. package/lib/typescript/module/src/specs/ApplePayButtonNativeComponent.d.ts +0 -10
  153. package/lib/typescript/module/src/specs/ApplePayButtonNativeComponent.d.ts.map +0 -1
  154. package/lib/typescript/module/src/specs/GooglePayButtonNativeComponent.android.d.ts +0 -11
  155. package/lib/typescript/module/src/specs/GooglePayButtonNativeComponent.android.d.ts.map +0 -1
  156. package/lib/typescript/module/src/specs/HyperswitchSdkReactNativeViewNativeComponent.d.ts +0 -1
  157. package/lib/typescript/module/src/specs/HyperswitchSdkReactNativeViewNativeComponent.d.ts.map +0 -1
  158. package/lib/typescript/module/src/specs/NativeHyperswitchSdkNative.d.ts +0 -17
  159. package/lib/typescript/module/src/specs/NativeHyperswitchSdkNative.d.ts.map +0 -1
  160. package/lib/typescript/module/src/specs/NativeHyperswitchSdkReactNative.d.ts +0 -9
  161. package/lib/typescript/module/src/specs/NativeHyperswitchSdkReactNative.d.ts.map +0 -1
  162. package/lib/typescript/module/src/types/PaymentSheetConfiguration.gen.d.ts +0 -149
  163. package/lib/typescript/module/src/types/PaymentSheetConfiguration.gen.d.ts.map +0 -1
  164. package/lib/typescript/module/src/types/PaymentSheetConfiguration.res.d.ts +0 -1
  165. package/lib/typescript/module/src/types/PaymentSheetConfiguration.res.d.ts.map +0 -1
  166. /package/lib/typescript/{commonjs/babel.config.d.ts → babel.config.d.ts} +0 -0
  167. /package/lib/typescript/{commonjs/eslint.config.d.mts → eslint.config.d.mts} +0 -0
  168. /package/lib/typescript/{commonjs/scripts → scripts}/bootstrap.d.ts +0 -0
  169. /package/lib/typescript/{commonjs/src → src}/context/HyperProvider.gen.d.ts +0 -0
  170. /package/lib/typescript/{commonjs/src → src}/context/HyperProvider.res.d.ts +0 -0
  171. /package/lib/typescript/{commonjs/src → src}/hooks/useHyper.gen.d.ts +0 -0
  172. /package/lib/typescript/{commonjs/src → src}/hooks/useHyper.res.d.ts +0 -0
  173. /package/lib/typescript/{commonjs/src → src}/index.d.ts +0 -0
  174. /package/lib/typescript/{commonjs/src → src}/modules/NativeHyperswitchSdk.gen.d.ts +0 -0
  175. /package/lib/typescript/{commonjs/src → src}/modules/NativeHyperswitchSdk.res.d.ts +0 -0
  176. /package/lib/typescript/{commonjs/src → src}/shims/Js.shim.d.ts +0 -0
  177. /package/lib/typescript/{commonjs/src → src}/specs/ApplePayButtonNativeComponent.d.ts +0 -0
  178. /package/lib/typescript/{commonjs/src → src}/specs/GooglePayButtonNativeComponent.android.d.ts +0 -0
  179. /package/lib/typescript/{commonjs/src → src}/specs/HyperswitchSdkReactNativeViewNativeComponent.d.ts +0 -0
  180. /package/lib/typescript/{commonjs/src → src}/specs/NativeHyperswitchSdkNative.d.ts +0 -0
  181. /package/lib/typescript/{commonjs/src → src}/specs/NativeHyperswitchSdkReactNative.d.ts +0 -0
  182. /package/lib/typescript/{commonjs/src → src}/types/PaymentSheetConfiguration.gen.d.ts +0 -0
  183. /package/lib/typescript/{commonjs/src → src}/types/PaymentSheetConfiguration.res.d.ts +0 -0
@@ -30,12 +30,18 @@ import com.facebook.react.shell.MainReactPackage
30
30
  import com.hyperswitchsdkreactnative.BuildConfig
31
31
  import com.hyperswitchsdkreactnative.R
32
32
  import com.hyperswitchsdkreactnative.internal.DefaultReactHost.getDefaultReactHost
33
+ import com.hyperswitchsdkreactnative.modules.HyperswitchSdkReactNativeModule
33
34
  import com.hyperswitchsdkreactnative.provider.HyperProvider
35
+ import com.proyecto26.inappbrowser.ChromeTabsDismissedEvent
36
+ import com.proyecto26.inappbrowser.ChromeTabsManagerActivity
34
37
  import `in`.juspay.hyperota.LazyDownloadCallback
35
38
  import `in`.juspay.hyperotareact.HyperOTAReact
36
39
  import io.hyperswitch.hyperota.HyperOtaLogger
37
40
  import io.hyperswitch.react.SDKEnvironment
38
41
  import io.hyperswitch.react.Utils.Companion.checkEnvironment
42
+ import io.hyperswitch.redirect.RedirectEvent
43
+ import org.greenrobot.eventbus.EventBus
44
+ import org.greenrobot.eventbus.Subscribe
39
45
 
40
46
  /**
41
47
  * Fragment for creating a React View. This allows the developer to "embed" a React Application
@@ -46,7 +52,6 @@ internal open class ReactFragment : Fragment(), PermissionAwareActivity {
46
52
 
47
53
  private var disableHostLifecycleEvents = false
48
54
  private var permissionListener: PermissionListener? = null
49
-
50
55
  override fun onCreate(savedInstanceState: Bundle?) {
51
56
  super.onCreate(savedInstanceState)
52
57
  var mainComponentName: String? = null
@@ -73,6 +78,7 @@ internal open class ReactFragment : Fragment(), PermissionAwareActivity {
73
78
  fabricEnabled,
74
79
  ))
75
80
  }
81
+ registerEventBus()
76
82
  }
77
83
 
78
84
  /**
@@ -81,6 +87,33 @@ internal open class ReactFragment : Fragment(), PermissionAwareActivity {
81
87
  * method if your application class does not implement `ReactApplication` or you simply have a
82
88
  * different mechanism for storing a `ReactNativeHost`, e.g. as a static field somewhere.
83
89
  */
90
+
91
+ @Subscribe
92
+ fun onEvent(event: RedirectEvent) {
93
+ unRegisterEventBus()
94
+ EventBus.getDefault().post(
95
+ ChromeTabsDismissedEvent(
96
+ event.message,
97
+ event.resultType,
98
+ event.isError
99
+ )
100
+ )
101
+ startActivity(ChromeTabsManagerActivity.createDismissIntent(context))
102
+ }
103
+ private fun registerEventBus() {try{
104
+ if (!EventBus.getDefault().isRegistered(this)) {
105
+ EventBus.getDefault().register(this)
106
+ }
107
+ }catch(_: Exception){}
108
+ }
109
+
110
+ fun unRegisterEventBus() {
111
+ try {
112
+ if (EventBus.getDefault().isRegistered(this)) {
113
+ EventBus.getDefault().unregister(this)
114
+ }
115
+ }catch(_: Exception){}
116
+ }
84
117
  @Suppress("DEPRECATION")
85
118
  @Deprecated(
86
119
  "You should not use ReactNativeHost directly in the New Architecture. Use ReactHost instead.",
@@ -159,6 +192,7 @@ internal open class ReactFragment : Fragment(), PermissionAwareActivity {
159
192
 
160
193
  override fun onDestroy() {
161
194
  super.onDestroy()
195
+ unRegisterEventBus()
162
196
  if (!disableHostLifecycleEvents) {
163
197
  reactDelegate.onHostDestroy()
164
198
  } else {
@@ -38,7 +38,6 @@ class HyperswitchSdkNativeModule(reactContext: ReactApplicationContext) :
38
38
 
39
39
  @ReactMethod
40
40
  override fun launchGPay(requestObj: String, callback: Callback) {
41
- Log.i("Manideep", "called gpay here")
42
41
  currentActivity?.let {
43
42
  GooglePayCallbackManager.setCallback(
44
43
  it,
@@ -61,8 +60,8 @@ class HyperswitchSdkNativeModule(reactContext: ReactApplicationContext) :
61
60
  @ReactMethod
62
61
  override fun exitPaymentsheet(rootTag: Double, result: String, reset: Boolean) {
63
62
  try {
64
- resetView()
65
63
  resolvePromise(result)
64
+ resetView()
66
65
  } catch (e: JSONException) {
67
66
  // Log.e(NAME, "Failed to parse JSON result: $result", e)
68
67
  resolvePromise(result)
@@ -73,7 +72,13 @@ class HyperswitchSdkNativeModule(reactContext: ReactApplicationContext) :
73
72
  @ReactMethod
74
73
  override fun exitPaymentMethodManagement(rootTag: Double, result: String, reset: Boolean) {
75
74
  // Log.d(NAME, "exitPaymentMethodManagement called $result")
76
- resolvePromise(result)
75
+ try {
76
+ resolvePromise(result)
77
+ resetView()
78
+ } catch (e: JSONException) {
79
+ // Log.e(NAME, "Failed to parse JSON result: $result", e)
80
+ resolvePromise(result)
81
+ }
77
82
 
78
83
  // Implementation for exiting payment method management
79
84
  }
@@ -81,7 +86,14 @@ class HyperswitchSdkNativeModule(reactContext: ReactApplicationContext) :
81
86
  @ReactMethod
82
87
  override fun exitWidget(result: String, widgetType: String) {
83
88
  // Log.d(NAME, "exitWidget called with result: $result, widgetType: $widgetType")
84
- resolvePromise(result)
89
+ try {
90
+ resolvePromise(result)
91
+ resetView()
92
+ } catch (e: JSONException) {
93
+ // Log.e(NAME, "Failed to parse JSON result: $result", e)
94
+ resolvePromise(result)
95
+ }
96
+
85
97
 
86
98
  // Implementation for exiting widget
87
99
  }
@@ -89,7 +101,13 @@ class HyperswitchSdkNativeModule(reactContext: ReactApplicationContext) :
89
101
  @ReactMethod
90
102
  override fun exitCardForm(result: String) {
91
103
  // Log.d(NAME, "exitCardForm called with result: $result")
92
- resolvePromise(result)
104
+ try {
105
+ resolvePromise(result)
106
+ resetView()
107
+ } catch (e: JSONException) {
108
+ // Log.e(NAME, "Failed to parse JSON result: $result", e)
109
+ resolvePromise(result)
110
+ }
93
111
 
94
112
  // Implementation for exiting card form
95
113
  }
@@ -97,7 +115,13 @@ class HyperswitchSdkNativeModule(reactContext: ReactApplicationContext) :
97
115
  @ReactMethod
98
116
  override fun exitWidgetPaymentsheet(rootTag: Double, result: String, reset: Boolean) {
99
117
  // Log.d(NAME, "exitWidgetPaymentsheet called")
100
- resolvePromise(result)
118
+ try {
119
+ resolvePromise(result)
120
+ resetView()
121
+ } catch (e: JSONException) {
122
+ // Log.e(NAME, "Failed to parse JSON result: $result", e)
123
+ resolvePromise(result)
124
+ }
101
125
 
102
126
  // Implementation for exiting widget payment sheet
103
127
  }
@@ -91,6 +91,7 @@ internal class HyperProvider internal constructor(private val activity: Activity
91
91
  activity?.let {
92
92
  try {
93
93
  if (reactFragment != null) {
94
+ reactFragment!!.unRegisterEventBus()
94
95
  it.supportFragmentManager.beginTransaction().remove(reactFragment!!).commitAllowingStateLoss()
95
96
  }
96
97
  if (reset) {
@@ -103,7 +104,7 @@ internal class HyperProvider internal constructor(private val activity: Activity
103
104
 
104
105
  companion object {
105
106
  @JvmStatic
106
- var reactFragment: Fragment? = null
107
+ var reactFragment: ReactFragment? = null
107
108
 
108
109
  @JvmStatic
109
110
  private var publishableKey: String? = null
@@ -205,7 +206,7 @@ internal class HyperProvider internal constructor(private val activity: Activity
205
206
 
206
207
  private fun getHyperParams(context: Activity, configuration: Bundle): Bundle = Bundle().apply {
207
208
  putString("appId", context.packageName)
208
- putString("country", context.resources?.configuration?.locale?.country)
209
+ putString("country", context.resources?.configuration?.locales?.get(0)?.country)
209
210
  putString("user-agent", getUserAgent(context))
210
211
  putDouble("launchTime", getCurrentTime())
211
212
  putString("sdkVersion", BuildConfig.VERSION_NAME)
@@ -102,7 +102,7 @@ public final class OTAServices {
102
102
  "forceUpdate": true,
103
103
  "localAssets": (getHyperOTAPlist(configKey) ?? "releaseConfigURL") == "releaseConfigURL",
104
104
  "fileName": getHyperOTAPlist("fileName") ?? "" ,
105
- "releaseConfigURL": (getHyperOTAPlist(configKey) ?? "") + "/mobile-ota/ios/" + SDKVersion.current + "/config.json",
105
+ "releaseConfigURL": (getHyperOTAPlist(configKey) ?? "") + "/mobile-ota/rn/ios/" + SDKVersion.current + "/config.json",
106
106
  ] as [String: Any]
107
107
  self.otaServices = HyperOTAServices(payload: payload, loggerDelegate: logger, baseBundle: Bundle(for: OTAServices.self))
108
108
  }