devbathaniotpless / otpless-react-native-demo

0 stars 1 forks source link

Chrome not opening the whatsapp for sign in #4

Open priyanshop opened 4 months ago

priyanshop commented 4 months ago

https://github.com/devbathaniotpless/otpless-react-native-demo/assets/73154019/c91c880c-ed3d-468a-9fd8-1f810692480a

const module = new OtplessModule(); const [token, setMyToken] = useState(""); // Function to update the string value const updateString = (userToken: string) => { setMyToken(userToken); }; const extra = { method: "get", params: { cid: "3PNIL5CCK8V8XC9BVETB71MCJJHNS5H3", // Add your CID value provided from the dashboard crossButtonHidden: "true", appId: "VV5US9ITT5G2JPEO9M1N", //Add your appId value provided from the dashboard }, };

// This code will be used to detect the whatsapp installed status in users device // If you are using WHATSAPP login then its reqiured to add this code to hide the OTPless functionality const isWhatsappInstalled = () => { module.isWhatsappInstalled((hasWhatsapp) => { console.log(hasWhatsapp); }); };

//This function is used to trigger OTPless login page const openLoginPage = () => { isWhatsappInstalled(); module.showLoginPage((data) => { console.log("===================================="); console.log("data", data); console.log("===================================="); let message: string = ""; if (data.data === null || data.data === undefined) { message = data.errorMessage; } else { message = data.data.token; console.log(message); updateString(message); // todo here } }, extra); };

useEffect(() => { openLoginPage(); return () => {}; }, []);

devbathaniotpless commented 4 months ago

Let's connect tomorrow after 1pm to solve this issue

On Fri, Apr 26, 2024, 10:04 priyanshop @.***> wrote:

https://github.com/devbathaniotpless/otpless-react-native-demo/assets/73154019/c91c880c-ed3d-468a-9fd8-1f810692480a

— Reply to this email directly, view it on GitHub https://github.com/devbathaniotpless/otpless-react-native-demo/issues/4, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFCUWH7PMQ2JM3YG7HWPANDY7HKM5AVCNFSM6AAAAABG2CQJFOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI3DIOJUGI2DMOI . You are receiving this because you are subscribed to this thread.Message ID: @.***>