@capgo/capacitor-android-sms-retriever 8.0.10 → 8.0.12

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.
@@ -25,10 +25,10 @@ public class AndroidSmsRetrieverPlugin extends Plugin {
25
25
  private static final String EVENT_SMS_ERROR = "smsRetrieverError";
26
26
  private static final String STATUS_DONE = "SMS_RETRIEVER_DONE";
27
27
 
28
- private final String pluginVersion = "8.0.10";
28
+ private final String pluginVersion = "8.0.12";
29
29
  private AndroidSmsRetriever implementation;
30
30
  private ActivityResultLauncher<IntentSenderRequest> phoneNumberHintLauncher;
31
- private String pendingPhoneNumberCallId;
31
+ private PluginCall pendingPhoneNumberCall;
32
32
 
33
33
  @Override
34
34
  public void load() {
@@ -121,7 +121,7 @@ public class AndroidSmsRetrieverPlugin extends Plugin {
121
121
  return;
122
122
  }
123
123
 
124
- if (pendingPhoneNumberCallId != null) {
124
+ if (pendingPhoneNumberCall != null) {
125
125
  call.reject("Another Phone Number Hint request is already in progress.");
126
126
  return;
127
127
  }
@@ -137,13 +137,13 @@ public class AndroidSmsRetrieverPlugin extends Plugin {
137
137
  .getPhoneNumberHintIntent(request)
138
138
  .addOnSuccessListener((pendingIntent) -> {
139
139
  try {
140
- bridge.saveCall(call);
141
- pendingPhoneNumberCallId = call.getCallbackId();
140
+ call.setKeepAlive(true);
141
+ pendingPhoneNumberCall = call;
142
142
  IntentSenderRequest intentSenderRequest = new IntentSenderRequest.Builder(pendingIntent.getIntentSender()).build();
143
143
  phoneNumberHintLauncher.launch(intentSenderRequest);
144
144
  } catch (Exception exception) {
145
- pendingPhoneNumberCallId = null;
146
- bridge.releaseCall(call);
145
+ pendingPhoneNumberCall = null;
146
+ call.setKeepAlive(false);
147
147
  call.reject(resolveMessage("Unable to launch Phone Number Hint.", exception), exception);
148
148
  }
149
149
  })
@@ -168,7 +168,7 @@ public class AndroidSmsRetrieverPlugin extends Plugin {
168
168
  private void handlePhoneNumberHintResult(ActivityResult result) {
169
169
  PluginCall call = getPendingPhoneNumberCall();
170
170
  if (call == null) {
171
- pendingPhoneNumberCallId = null;
171
+ pendingPhoneNumberCall = null;
172
172
  return;
173
173
  }
174
174
 
@@ -202,16 +202,13 @@ public class AndroidSmsRetrieverPlugin extends Plugin {
202
202
  }
203
203
 
204
204
  private PluginCall getPendingPhoneNumberCall() {
205
- if (pendingPhoneNumberCallId == null) {
206
- return null;
207
- }
208
- return bridge.getSavedCall(pendingPhoneNumberCallId);
205
+ return pendingPhoneNumberCall;
209
206
  }
210
207
 
211
208
  private void releasePendingPhoneNumberCall(PluginCall call) {
212
- if (pendingPhoneNumberCallId != null) {
213
- bridge.releaseCall(call);
214
- pendingPhoneNumberCallId = null;
209
+ if (pendingPhoneNumberCall != null) {
210
+ call.setKeepAlive(false);
211
+ pendingPhoneNumberCall = null;
215
212
  }
216
213
  }
217
214
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-android-sms-retriever",
3
- "version": "8.0.10",
3
+ "version": "8.0.12",
4
4
  "description": "Capacitor plugin for Android SMS Retriever and Phone Number Hint APIs.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -53,6 +53,7 @@
53
53
  "watch": "tsc --watch",
54
54
  "prepublishOnly": "bun run build",
55
55
  "check:wiring": "node scripts/check-capacitor-plugin-wiring.mjs",
56
+ "check:cap9-deprecated": "node scripts/check-cap9-deprecated.mjs",
56
57
  "example:install": "cd example-app && bun install --frozen-lockfile",
57
58
  "example:build": "bun run build && cd example-app && bun install --frozen-lockfile && bun run build",
58
59
  "changelog:ai": "node scripts/generate-ai-changelog.mjs"