cordova-plugin-sms-retriever-manager 1.0.4 → 1.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cordova-plugin-sms-retriever-manager",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Easily retrieve SMS messages using the Google SMS Retriever API with our cross-platform plugin designed for Ionic/Cordova. This powerful tool streamlines the process and is specifically available for Android devices.",
5
5
  "cordova": {
6
6
  "id": "cordova-plugin-sms-retriever-manager",
package/plugin.xml CHANGED
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
3
- id="cordova-plugin-sms-retriever-manager" version="1.0.4">
3
+ id="cordova-plugin-sms-retriever-manager" version="1.0.5">
4
4
  <name>Cordova SMS Retriver Plugin</name>
5
5
  <description>Easily retrieve SMS messages using the Google SMS Retriever API with our cross-platform plugin designed for Ionic/Cordova. This powerful tool streamlines the process and is specifically available for Android devices.</description>
6
6
  <license>MIT</license>
@@ -11,6 +11,7 @@ import android.content.BroadcastReceiver;
11
11
  import android.content.Intent;
12
12
  import android.content.IntentFilter;
13
13
  import android.os.Bundle;
14
+ import android.os.Build;
14
15
  import android.util.Log;
15
16
  import android.widget.Toast;
16
17
 
@@ -30,6 +31,7 @@ import com.google.android.gms.tasks.Task;
30
31
  import java.util.ArrayList;
31
32
 
32
33
  import static com.google.android.gms.common.api.CommonStatusCodes.*;
34
+ import static android.content.Context.RECEIVER_EXPORTED;
33
35
 
34
36
  import android.content.ContextWrapper;
35
37
  import android.content.pm.PackageManager;
@@ -151,7 +153,12 @@ public class AndroidSmsRetriever extends CordovaPlugin {
151
153
 
152
154
  IntentFilter intentFilter = new IntentFilter();
153
155
  intentFilter.addAction(SmsRetriever.SMS_RETRIEVED_ACTION);
154
- cordova.getActivity().getApplicationContext().registerReceiver(mMessageReceiver, intentFilter);
156
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
157
+ cordova.getActivity().getApplicationContext().registerReceiver(mMessageReceiver, intentFilter, RECEIVER_EXPORTED);
158
+ } else {
159
+ cordova.getActivity().getApplicationContext().registerReceiver(mMessageReceiver, intentFilter);
160
+ }
161
+
155
162
  }
156
163
  });
157
164
 
@@ -209,7 +216,7 @@ public class AndroidSmsRetriever extends CordovaPlugin {
209
216
  final String message = extra.getString(SmsRetriever.EXTRA_SMS_MESSAGE);
210
217
  //if (!StringUtils.hasContent(message)) return;
211
218
  if(message == null) return;
212
-
219
+
213
220
  Log.d(TAG, message);
214
221
 
215
222
  data = new JSONObject();