@sodyo/react-native-sodyo-sdk 3.9.15 → 3.11.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.
package/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
 
2
2
  # React Native Sodyo SDK Plugin that wraps Sodyo sdk for Android and iOS
3
3
 
4
- [SodyoSDK for iOS](https://github.com/sodyo-ltd/SodyoSDKPod) v3.61.01
4
+ [SodyoSDK for iOS](https://github.com/sodyo-ltd/SodyoSDKPod) v3.62.04
5
5
 
6
- [SodyoSDK for Android](https://search.maven.org/search?q=a:sodyo-android-sdk) 3.62.11
6
+ [SodyoSDK for Android](https://search.maven.org/search?q=a:sodyo-android-sdk) 3.62.14
7
7
 
8
8
 
9
9
  ## Install
@@ -12,11 +12,11 @@ Pod::Spec.new do |s|
12
12
  s.author = package['author']
13
13
  s.homepage = package['homepage']
14
14
  s.platform = :ios, "11.0"
15
- s.source = { :git => "https://github.com/sodyo-ltd/SodyoSDKPod", :commit => "13a57e2" }
15
+ s.source = { :git => "https://github.com/sodyo-ltd/SodyoSDKPod", :commit => "c551017" }
16
16
  s.source_files = "ios/**/*.{h,m}"
17
17
  s.requires_arc = true
18
18
 
19
19
  s.dependency "React"
20
- s.dependency "SodyoSDK", "3.61.01"
20
+ s.dependency "SodyoSDK", "3.62.04"
21
21
  end
22
22
 
@@ -55,7 +55,7 @@ repositories {
55
55
 
56
56
  dependencies {
57
57
  implementation ('com.facebook.react:react-native:+')
58
- implementation ('com.sodyo:sodyo-android-sdk:3.62.11') {
58
+ implementation ('com.sodyo:sodyo-android-sdk:3.62.14') {
59
59
  transitive = true
60
60
  exclude group: 'com.parse.bolts', module: 'bolts-android'
61
61
  }
@@ -11,6 +11,8 @@ import android.widget.FrameLayout;
11
11
  import android.app.Fragment;
12
12
  import android.app.FragmentManager;
13
13
  import android.app.FragmentTransaction;
14
+ import android.app.Activity;
15
+
14
16
  import javax.annotation.Nullable;
15
17
 
16
18
  import com.sodyo.sdk.SodyoScannerFragment;
@@ -43,16 +45,26 @@ public class RNSodyoSdkView extends SimpleViewManager<FrameLayout> {
43
45
 
44
46
  final FrameLayout view = new FrameLayout(context);
45
47
 
48
+ // Obtain the current activity from the context
49
+ Activity currentActivity = mCallerContext.getCurrentActivity();
50
+ if (currentActivity == null) {
51
+ // Handle the situation when the activity is null
52
+ Log.e(TAG, "Current activity is null, cannot initialize SodyoScannerFragment");
53
+ // Consider providing user feedback or a fallback mechanism
54
+ return view;
55
+ }
56
+
57
+ // Proceed with initialization as the activity is not null
46
58
  if (sodyoFragment == null) {
47
- Log.i(TAG,"init SodyoScannerFragment");
48
- sodyoFragment = new SodyoScannerFragment();
59
+ Log.i(TAG,"init SodyoScannerFragment");
60
+ sodyoFragment = new SodyoScannerFragment();
49
61
  }
50
62
 
51
- FragmentManager fragmentManager = mCallerContext.getCurrentActivity().getFragmentManager();
63
+ // Use the current activity's fragment manager
64
+ FragmentManager fragmentManager = currentActivity.getFragmentManager();
52
65
  FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
53
66
 
54
- fragmentTransaction.add(sodyoFragment, TAG_FRAGMENT).commit();
55
-
67
+ fragmentTransaction.add(sodyoFragment, TAG_FRAGMENT).commitAllowingStateLoss();
56
68
  fragmentManager.executePendingTransactions();
57
69
 
58
70
  view.addView(sodyoFragment.getView(), FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sodyo/react-native-sodyo-sdk",
3
- "version": "3.9.15",
3
+ "version": "3.11.0",
4
4
  "description": "RNSodyoSdk",
5
5
  "main": "sodyosdk.js",
6
6
  "typings": "./sodyosdk.d.ts",