Skip to content

Commit

Permalink
Merge pull request #58 from alexWorkArhs/fix-EuiccManager-check
Browse files Browse the repository at this point in the history
changed check to be version P and moved initMgr for after the check
  • Loading branch information
FrLallemandArhs authored Oct 10, 2023
2 parents 67f6060 + ba573f2 commit ea94166
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ SimCardsManagerModule.setupEsim({

## Changelog

### 1.0.18

- **Fix** fix setupEsim. check for OS version P or above, before continuing and return if below.
- Moved initMgr() to after the version check.

### 1.0.12 & .13 & .14 & .15 & .16 & .17

- **Fix** npm package; missing index.ts file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,14 @@ private boolean checkCarrierPrivileges() {
@RequiresApi(api = Build.VERSION_CODES.P)
@ReactMethod
public void setupEsim(ReadableMap config, Promise promise) {
initMgr();
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.LOLLIPOP_MR1) {

if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.P) {
promise.reject("0", "EuiccManager is not available or before Android 9 (API 28)");
return;
}

initMgr();

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && mgr != null && !mgr.isEnabled()) {
promise.reject("1", "The device doesn't support a cellular plan (EuiccManager is not available)");
return;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-sim-cards-manager",
"version": "1.0.17",
"version": "1.0.18",
"description": "react-native-sim-cards-manager description",
"main": "index.js",
"types": "types/index.d.ts",
Expand Down

0 comments on commit ea94166

Please sign in to comment.