Code Monkey home page Code Monkey logo

flutter_sms_receiver's People

Contributors

andzejsw avatar blackmenthor avatar gofur avatar idrats avatar iqbalmineraltown avatar marinagosson avatar sullenel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

flutter_sms_receiver's Issues

Can not run on iOS after upgrading to Flutter 1.20.3

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!

Not building on Android

Error

* 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 result

Doctor 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.

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

Crash on Android 14

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)
image

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))
}

MMS

Does this package support mms?

Only safe (?.) or non-null asserted (!!.) calls are allowed

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 ?!

Plugin not listening to any messages.

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...";
});
}

Not understand

I don't understand way to Generate acceptable message format. Can you have video example? Thanks so much.

Crashing devices on com.oval.sms_receiver.SMSBroadcastReceiver.onReceive

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.