1-Click Button Opt-In (Wix only)

Walkthrough:

Add this code inside a new embedded HTML Element on the page:

<button onclick="WalletSmsButton('[YOUR NUMBER HERE]', '[YOUR KEYWORD HERE]');">Join our SMS List!</button>
<script> 
    var WalletSmsButton = function(number,body){
        var ua = navigator.userAgent.toLowerCase();
        var url;
        if (ua.indexOf("iphone") > -1 || ua.indexOf("ipad") > -1) {
            url = "sms:" + number + "&body=" + body;
        } else {
            url = "sms:" + number + "?body=" + body;
        }
        window.open(url); 
    }
</script>

Then, be sure to give this element the ID of "iframeHiddenSmsSignupButton".

Lastly, place this code in your "masterPage.js" file:

import wixWindow from 'wix-window';
if(wixWindow.formFactor === "Mobile"){
    $w("#iframeHiddenSmsSignupButton").show()
} 
else{
    $w("#iframeHiddenSmsSignupButton").hide()
}

IMPORTANT: Set your SMS Number and Keyword in the code above ^

And voila! You're done! Just click the Wix "Preview" button and switch between Desktop view and Mobile view to see the button appear and disappear.

Feel free to apply any custom styling you require, to make the button match your website's existing theme and layout.

If you have any difficulty with installing the button on your Wix website, please connect with us on our Discord channel: https://discord.com/invite/xzwhcNCjcQ

Thanks,

-The Wallet Inc Development Team