fraggjkee / sms-confirmation-view

A custom Android's View implementing all the necessary UI for a typical "enter SMS / PIN code" flow.
Apache License 2.0
79 stars 28 forks source link

Don't unregisterReciver when use manual mode and startListeningForIncomingMessages() not called yet #4

Closed amir14a closed 3 years ago

amir14a commented 3 years ago

Version: 1.3.1 Hello, I use manual mode and I call startListeningForIncomingMessages() in some cases, but if user finish activity before startListeningForIncomingMessages() call, this exception occurs:

    java.lang.IllegalArgumentException: Receiver not registered: com.fraggjkee.smsconfirmationview.SmsConfirmationView$smsBroadcastReceiver$1@aab0820
        at android.app.LoadedApk.forgetReceiverDispatcher(Unknown Source:193)
        at android.app.ContextImpl.unregisterReceiver(Unknown Source:9)
        at android.content.ContextWrapper.unregisterReceiver(Unknown Source:2)
        at android.content.ContextWrapper.unregisterReceiver(Unknown Source:2)
        at com.fraggjkee.smsconfirmationview.SmsConfirmationView.onDetachedFromWindow(SmsConfirmationView.kt:220)

Please check if reciver registered yet, then unregister it.

fraggjkee commented 3 years ago

Hey, please check v1.4.1, it should fix the above issue.

amir14a commented 3 years ago

Build failed in jitpack.io and I can't use it in my project: https://jitpack.io/com/github/fraggjkee/sms-confirmation-view/1.4.1/build.log

fraggjkee commented 3 years ago

woops, It appeared that the build has been failing since 1.4.0 when I changed gradle version to 7.0... try 1.4.5, the build has finally passed.

amir14a commented 3 years ago

Thanks. I will close the issue