I have a toggle control for subscribing to push notifications and I want to only display it if the user is running the native mobile app.
I have tried the following:
code
if (typeof cordova == "undefined") {
Apperyio("tglSubscribe").hide();
}
/code
and (with the toggle control set to not visible):
code
if (navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry|IEMobile)/)) {
document.addEventListener("deviceready", onDeviceReady, false);
Apperyio("tglSubscribe").show();
} else {
Apperyio("tglSubscribe").hide();
}
/code