Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receiver not getting called for Zero-Tap #10

Open
ajaymehtaNeo opened this issue Oct 28, 2024 · 1 comment
Open

Receiver not getting called for Zero-Tap #10

ajaymehtaNeo opened this issue Oct 28, 2024 · 1 comment
Assignees

Comments

@ajaymehtaNeo
Copy link

ajaymehtaNeo commented Oct 28, 2024

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..

@yundom yundom self-assigned this Dec 31, 2024
@yundom
Copy link
Contributor

yundom commented Dec 31, 2024

Hi @ajaymehtaNeo,

This issue might be related to OTP eligibility. Could you provide more details about the OTP eligibility by setting up the intent receiver com.whatsapp.otp.OTP_ERROR?

This will help us better understand and diagnose the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants