EddieKamau / sms_advanced

This is an SMS library for Flutter. Its allow to send, receive, query sms messages, sms delivery and query contacts info. Currently supporting only android
MIT License
30 stars 64 forks source link

onSmsReceived i think is not working or do i have put something on androidxml file to make it work? #2

Open karlreginaldo opened 3 years ago

medbenzekri commented 2 years ago

@EddieKamau yea i have the same issue SmsReceiver is rising a PlatformException on runtime this is the output : E/EventChannel#plugins.elyudde.com/recvSMS(27025): Failed to open event stream E/EventChannel#plugins.elyudde.com/recvSMS(27025): java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter arguments E/EventChannel#plugins.elyudde.com/recvSMS(27025): at com.elyudde.sms_advanced.SmsReceiver.onListen(Unknown Source:2) E/EventChannel#plugins.elyudde.com/recvSMS(27025): at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onListen(EventChannel.java:188) E/EventChannel#plugins.elyudde.com/recvSMS(27025): at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onMessage(EventChannel.java:167) E/EventChannel#plugins.elyudde.com/recvSMS(27025): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:84) E/EventChannel#plugins.elyudde.com/recvSMS(27025): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:865) E/EventChannel#plugins.elyudde.com/recvSMS(27025): at android.os.MessageQueue.nativePollOnce(Native Method) E/EventChannel#plugins.elyudde.com/recvSMS(27025): at android.os.MessageQueue.next(MessageQueue.java:335) E/EventChannel#plugins.elyudde.com/recvSMS(27025): at android.os.Looper.loop(Looper.java:206) E/EventChannel#plugins.elyudde.com/recvSMS(27025): at android.app.ActivityThread.main(ActivityThread.java:8587) E/EventChannel#plugins.elyudde.com/recvSMS(27025): at java.lang.reflect.Method.invoke(Native Method) E/EventChannel#plugins.elyudde.com/recvSMS(27025): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602) E/EventChannel#plugins.elyudde.com/recvSMS(27025): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)

══╡ EXCEPTION CAUGHT BY SERVICES LIBRARY ╞═════════════════════════════════════════════════════════ ═ The following PlatformException was thrown while activating platform stream on channel plugins.elyudde.com/recvSMS: PlatformException(error, Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter arguments, null, null)

When the exception was thrown, this was the stack:

0 JSONMethodCodec.decodeEnvelope

(package:flutter/src/services/message_codecs.dart:155:7)

1 MethodChannel._invokeMethod

(package:flutter/src/services/platform_channel.dart:156:18 )

#2 EventChannel.receiveBroadcastStream. (package:flutter/src/services/platform_channel.dart:486:9) ══════════════════════════════════════════════════════════ ══════════════════════════════════════════
OjasBali commented 2 years ago

PR https://github.com/EddieKamau/sms_advanced/pull/3 opened by @medbenzekri

makobec commented 2 years ago

Same error for me, I'm using sms_advanced 1.0.1

JLFFFF commented 2 years ago

Try to grant the permission in setting app. and check https://github.com/EddieKamau/sms_advanced/commit/3341c4183f85cc01883d91e4d5a51ce7da31d3f2

gassion88 commented 1 year ago

Try to grant the permission in setting app. and check 3341c41 Please explain me how to solve this problem. I don't have this file