I am using Zero-Tap OTP Authentication. While sending the OTP from Server Api, getting code in the whatsapp but my receiver is not getting called. I have reviewed all the articles found on web but no success.
AndroidManifest.xml
<receiver
android:name=".module.whatsapp.OtpCodeReceiver"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="com.whatsapp.otp.OTP_RETRIEVED" />
</intent-filter>
</receiver>
OtpCodeReceiver.java
public class OtpCodeReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
WhatsAppOtpIncomingIntentHandler whatsAppOtpIncomingIntentHandler = new WhatsAppOtpIncomingIntentHandler();
whatsAppOtpIncomingIntentHandler.processOtpCode(intent, message -> {
Toast.makeText(context, "WS Data :: " + message, Toast.LENGTH_SHORT).show();
}, (whatsAppOtpError, e) -> {
Toast.makeText(context, "WA Error :: " + e.getMessage(), Toast.LENGTH_SHORT).show();
});
}
}
Seems everything in code is ok but don't know if I am missing anything.
Kindly help me..
I am using Zero-Tap OTP Authentication. While sending the OTP from Server Api, getting code in the whatsapp but my receiver is not getting called. I have reviewed all the articles found on web but no success.
AndroidManifest.xml
OtpCodeReceiver.java
Seems everything in code is ok but don't know if I am missing anything.
Kindly help me..