otpReader icon indicating copy to clipboard operation
otpReader copied to clipboard

UnBind OtpReader

Open Nishikant04 opened this issue 7 years ago • 3 comments

I am not able to unBind OtpReader.

Nishikant04 avatar Jul 07 '17 07:07 Nishikant04

@Nishikant04 As I understand, you mean the listener keeps on receiving the messages (yes it may be necessary if we need to keep receiving messages multiple times), currently workaround would be if you can handle the same using a received flag in your OTPListener if you want to receive the message only once.

swarajsaaj avatar Jul 10 '17 05:07 swarajsaaj

I want listener keeps on receiving the message till my fragment is present.

Nishikant04 avatar Jul 11 '17 05:07 Nishikant04

@Nishikant04 In current version there is no unbind method in Receiver though, as a workaround you can use OtpReader.bind(null,""), to remove binding to your listener in your fragment's onDestroy() method and call OtpReader.bind in your fragment's onResume() I think that should solve the issue of listening only when fragment is there.

swarajsaaj avatar Jul 11 '17 08:07 swarajsaaj