You can use the built-in window.pushwoosh bridge to talk to the SDK from an In-App message. This works on iOS, Android, and React Native without extra setup.
To save an email address from an HTML form in your In-App message, call setEmail() in your script:
document.getElementById('emailForm').addEventListener('submit', function(e) {
e.preventDefault();
var email = document.getElementById('emailInput').value;
pushwoosh.setEmail(email);
pushwoosh.closeInApp();
});
In this example, the SDK saves the email address and closes the message when the user clicks submit.
The window.pushwoosh bridge includes these methods for In-App messages:
Sending data to the SDK
setEmail()— Saves an email address.sendTags()— Sets device tags.postEvent()— Triggers an event.registerForPushNotifications()— Asks the user for push permissions.closeInApp()— Closes the message.
Getting data from the SDK
getHwid()— Returns the unique hardware ID.getUserId()— Returns the user ID.getTags()— Returns current tag values.
Comments
0 comments
Please sign in to leave a comment.