Specific features of Canvas can be triggered manually through the use of Javascript functions.
These functions must be implemented directly on the website side, and will only work when the website is viewed inside the app.
Below you can find a list of all the available functions:
nativeFunctions.onesignalSendTags([$tags])
Adds an array of tags to the user profile in OneSignal
<button onclick="nativeFunctions.onesignalSendTags(['tag1', 'tag2', 'tag3'])">Add tags</button>
nativeFunctions.onesignalDeleteTags([$tags])
Removes an array of tags from the user profile in OneSignal
<button onclick="nativeFunctions.onesignalDeleteTags(['tag1', 'tag2', 'tag3'])">Remove tags</button>
nativeFunctions.onesignalSetExternalUserId($id)
Adds an external ID to the user profile in OneSignal
<button onclick="nativeFunctions.onesignalSetExternalUserId('123')">Add user ID</button>
nativeFunctions.onesignalRemoveExternalUserId()
Removes an external ID from the user profile in OneSignal
<button onclick="nativeFunctions.onesignalRemoveExternalUserId('123')">Remove user ID</button>
nativeFunctions.onesignalSetEmail($email)
Adds an email profile to OneSignal
<button onclick="nativeFunctions.onesignalSetEmail('user@email.com')">Add user email</button>
nativeFunctions.onesignalLogoutEmail()
Removes the current email profile from OneSignal
<button onclick="nativeFunctions.onesignalLogoutEmail('user@email.com')">Remove user email</button>