Skip to content

Receiver not getting called for Zero-Tap #10

Description

@ajaymehtaNeo

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions