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 · 0 comments
Open

Receiver not getting called for Zero-Tap #10

ajaymehtaNeo opened this issue Oct 28, 2024 · 0 comments

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

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

1 participant