You can register a user's phone number for SMS and WhatsApp directly from your website using the Web SDK's registerSmsNumber and registerWhatsappNumber API methods.
Here is an example of how to use these methods in your JavaScript code:
Pushwoosh.push((api) => {
// Register an SMS number
api.registerSmsNumber('+15551234567');
// Register a WhatsApp number
api.registerWhatsappNumber('+15551234568');
});
Both numbers must be in E.164 format (a leading + followed by the country code and digits only) - do not prefix the WhatsApp number with whatsapp:.
These methods associate the provided phone numbers with the current user's profile.
Comments
0 comments
Please sign in to leave a comment.