iqbalmineraltown / flutter_sms_receiver Goto Github PK
View Code? Open in Web Editor NEWSMS Receiver API Flutter Plugin
License: BSD 3-Clause "New" or "Revised" License
SMS Receiver API Flutter Plugin
License: BSD 3-Clause "New" or "Revised" License
This package should be migrated to the latest features of the Flutter framework including the Null-Safety
.
flutter run output:
Failed to build iOS app
Error output from Xcode build:
↳
2020-09-10 18:22:26.600 xcodebuild[84348:7889314] DTDeviceKit: deviceType from 00008020-001270961104003A was NULL
2020-09-10 18:22:26.746 xcodebuild[84348:7889314] DTDeviceKit: deviceType from 00008020-001270961104003A was NULL
** BUILD FAILED **
Xcode's output:
↳
Command CompileSwift failed with a nonzero exit code
/Users/idrats/.pub-cache/hosted/pub.dartlang.org/sms_receiver-0.3.1+1/ios/Classes/SmsReceiverPlugin.m:6:4: error: unknown receiver 'SwiftSmsReceiverPlugin'; did you mean 'SmsReceiverPlugin'?
[SwiftSmsReceiverPlugin registerWithRegistrar:registrar];
^~~~~~~~~~~~~~~~~~~~~~
SmsReceiverPlugin
In file included from /Users/idrats/.pub-cache/hosted/pub.dartlang.org/sms_receiver-0.3.1+1/ios/Classes/SmsReceiverPlugin.m:1:
/Users/idrats/.pub-cache/hosted/pub.dartlang.org/sms_receiver-0.3.1+1/ios/Classes/SmsReceiverPlugin.h:3:12: note: 'SmsReceiverPlugin' declared here
@interface SmsReceiverPlugin : NSObject<FlutterPlugin>
^
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
flutter doctor:
• Flutter version 1.20.3 at /Users/idrats/Documents/flutter
• Framework revision 216dee60c0 (9 days ago), 2020-09-01 12:24:47 -0700
• Engine revision d1bc06f032
• Dart version 2.9.2
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/idrats/Library/Android/sdk
• Platform android-29, build-tools 29.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.5, Build version 11E608c
• CocoaPods version 1.9.3
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 47.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] Connected device (1 available)
• iPhone (Ilya) (mobile) • 00008020-001270961104003A • ios • iOS 13.5.1
• No issues found!
* Error running Gradle:
ProcessException: Process "$projectPath/android/gradlew" exited abnormally:
Starting a Gradle Daemon, 1 busy and 2 stopped Daemons could not be reused, use --status for details
> Configure project :sms_receiver
WARNING: API 'variant.getPackageLibrary()' is obsolete and has been replaced with 'variant.getPackageLibraryProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getPackageLibrary(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
> Configure project :onesignalflutter
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
> Configure project :app
WARNING: API 'variant.getMergeAssets()' is obsolete and has been replaced with 'variant.getMergeAssetsProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getMergeAssets(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
WARNING: API 'variantOutput.getProcessResources()' is obsolete and has been replaced with 'variantOutput.getProcessResourcesProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variantOutput.getProcessResources(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
*********************************************************
WARNING: This version of package_info will break your Android build if it or its dependencies aren't compatible with AndroidX.
See https://goo.gl/CP92wY for more information on the problem and how to fix it.
This warning prints for all Android build failures. The real root cause of the error may be unrelated.
*********************************************************
Command: $projectPath/android/gradlew app:properties
flutter doctor
resultDoctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v1.6.3, on Mac OS X 10.14.5 18F132, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
[✓] Android Studio (version 3.4)
[✓] VS Code (version 1.35.1)
[✓] Connected device (1 available)
• No issues found!
Hi, Received Sms is not read in the iPhone. It is working on android but facing issues in the iPhones please help.
I also used the sms plugin to read the received sms but this is also not working for iOS
Fatal Exception: java.lang.SecurityException
One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
- android.os.Parcel.createExceptionOrNull (Parcel.java:3069)
- android.content.ContextWrapper.registerReceiver (ContextWrapper.java:772)
- com.oval.sms_receiver.SmsReceiverPlugin$startListening$1.invoke (SmsReceiverPlugin.java:1)
- com.oval.sms_receiver.SmsReceiverPlugin$startListening$1.invoke (SmsReceiverPlugin.java:1)
- com.oval.sms_receiver.SmsReceiverPlugin.startListening$lambda$1 (SmsReceiverPlugin.java:1)
- com.google.android.gms.tasks.zzm.run (zzm.java:25)
- com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1103)
Most probably you should add RECEIVER_EXPORTED
when registering a BroadcastReceiver
in SmsReceiverPlugin.kt#84
:
// old
activity.registerReceiver(smsBroadcastReceiver,
IntentFilter(SmsRetriever.SMS_RETRIEVED_ACTION))
// new
if (Build.VERSION.SDK_INT >= 33) {
activity.registerReceiver(smsBroadcastReceiver,
IntentFilter(SmsRetriever.SMS_RETRIEVED_ACTION),
Context.RECEIVER_EXPORTED)
} else {
activity.registerReceiver(smsBroadcastReceiver,
IntentFilter(SmsRetriever.SMS_RETRIEVED_ACTION))
}
We could use sth like stopListening()
or a way to dispose
listener
Hi,
i have a issue with reading SMS if provider is with XXXX(Address), but if sender address is like XX-YYYY it is reading.
Help me out to solve this issue !
Does this package support mms?
After Updating the Android Studio and Gradle its throwing error like below,
"FlutterProjects/SDKFlutter/flutter/.pub-cache/hosted/pub.dartlang.org/sms_receiver-0.3.1+1/android/src/main/kotlin/com/oval/smsreceiver/SMSBroadcastReceiver.kt: (23, 32): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Bundle?"
help me out how to fix this ?!
I am trying to read incoming otp code for my app, plug in is not listening to any otp messages.
Here is my code. app is following all the rules of sms retriever api.
void initState() {
super.initState();
SharedPref.sharedPreferenceGet(StringsConstants.FCM_ID)
.then((dynamic tempAuth) {
authKey = tempAuth;
});
_updateData();
_smsReceiver = SmsReceiver(onSmsReceived, onTimeout: onTimeout);
_startListening();
}
void onSmsReceived(String message) {
setState(() {
_textContent = message;
String a=_textContent;
});
}
void onTimeout() {
setState(() {
_textContent = "Timeout!!!";
if(_textContent=="Timeout!!!")
{_startListening();}
});
}
void _startListening() {
_smsReceiver.startListening();
setState(() {
_textContent = "Waiting for messages...";
});
}
Plugin not listening to any messages,I didn't request permission with permission_handler 5.0.1+1,
I don't understand way to Generate acceptable message format. Can you have video example? Thanks so much.
Hi, after adding the dependency I'm getting this error 'sms_receiver/sms_receiver-Swift.h' file not found
Hi ,
this is not issue, but have doubt
deployment_cert.der
filedeployment_cert.der
file to a .jks
filekeytool Command
i generated Hash .now how do i store hash as constant in our app ?
Hi,
We have recently released a new version Android Application on Playstore. It's reported more crashes on Firebase Crashlytics in com.oval.sms_receiver.SMSBroadcastReceiver.onReceive. I'm using sms_receiver: ^0.4.1
plugin.
flutter doctor -v
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.0.1 21A559 darwin-arm, locale
en-IN)
• Flutter version 2.8.1 at
/Users/macbookair/Documents/developer/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 77d935af4d (8 weeks ago), 2021-12-16 08:37:33 -0800
• Engine revision 890a5fca2e
• Dart version 2.15.1
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
• Android SDK at /Users/macbookair/Library/Android/sdk
• Platform android-32, build-tools 32.0.0
• Java binary at: /Applications/Android
Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2020.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
[✓] Connected device (1 available)
• Chrome (web) • chrome • web-javascript • Google Chrome 98.0.4758.80
• No issues found!
Firebase Crash Log,
Fatal Exception: java.lang.RuntimeException: Error receiving broadcast Intent { act=com.google.android.gms.auth.api.phone.SMS_RETRIEVED flg=0x200010 pkg=com.examplepackage (has extras) } in c.h.a.a@cc353d5
at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1629)
at android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA.run(-.java:2)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:257)
at android.app.ActivityThread.main(ActivityThread.java:8143)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:626)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1015)
Caused by h.o: null cannot be cast to non-null type kotlin.String
at com.oval.sms_receiver.SMSBroadcastReceiver.onReceive(SMSBroadcastReceiver.java:97)
at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1619)
at android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA.run(-.java:2)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:257)
at android.app.ActivityThread.main(ActivityThread.java:8143)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:626)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1015)
Any solution ? Thanks in advance!
I've setup everyting correctly but is not receiving anything .
I am new for flutter. I am working application which is read the received sms and show in our application.
So I require a plugin for reading the Received SMS in Android and iphone both.
Dude, it doesn't catch any messages tf?! Tried 20+ times. Didn't catch a single sms.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.