Closed happysingh23828 closed 2 years ago
@arsamme
@happysingh23828 Hi, Thanks for reporting issue. I'll take a look at this.
Yes, please. We need to stop receiver on activity lifecycle. We also need to add stop listener for onetimeconsent sms.
@happysingh23828 Reply already submitted
fixed. In consent mode, null
will be returned on timeout and cancel.
@happysingh23828 I've also added unregisterReceiver
on onDetachedFromActivity
to stop receiver.
@arsamme We are using on FlutterLoginActivity
and in that we are having two screens.
if I start this activity with first screen and enter mobile number and move to OTP screen. and Immediately if I come back. The one time consent dialog still shows on message received even I'm on the phone entering screen.
We need stop listener for one time so we can stop in particular screen's dispose method.
@happysingh23828 Thanks for your participation. I've added another method for stopping one time consent receiver. Check latest version.
Thanks, @arsamme, I'll validate once and close this thread. Keep building awesome libraries. 👍
Getting same error while listening for SMS.
E/ContentValues(20771): java.lang.IllegalArgumentException: Receiver not registered: me.arsam.sms_retriever.SmsRetrieverPlugin$ConsentBroadcastReceiver@ae63073
E/ContentValues(20771): at android.app.LoadedApk.forgetReceiverDispatcher(LoadedApk.java:1435)
E/ContentValues(20771): at android.app.ContextImpl.unregisterReceiver(ContextImpl.java:1553)
E/ContentValues(20771): at android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:674)
E/ContentValues(20771): at me.arsam.sms_retriever.SmsRetrieverPlugin.unregisterReceiver(SmsRetrieverPlugin.kt:340)
E/ContentValues(20771): at me.arsam.sms_retriever.SmsRetrieverPlugin.access$unregisterReceiver(SmsRetrieverPlugin.kt:29)
E/ContentValues(20771): at me.arsam.sms_retriever.SmsRetrieverPlugin$ConsentBroadcastReceiver.onReceive(SmsRetrieverPlugin.kt:392)
E/ContentValues(20771): at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1558)
E/ContentValues(20771): at android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA.run(Unknown Source:2)
E/ContentValues(20771): at android.os.Handler.handleCallback(Handler.java:883)
E/ContentValues(20771): at android.os.Handler.dispatchMessage(Handler.java:100)
E/ContentValues(20771): at android.os.Looper.loop(Looper.java:224)
E/ContentValues(20771): at android.app.ActivityThread.main(ActivityThread.java:7590)
E/ContentValues(20771): at java.lang.reflect.Method.invoke(Native Method)
E/ContentValues(20771): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
E/ContentValues(20771): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
@TheAlphamerc Hello, I'll check this.