Page 2 of 2

How do I Display a Control Only on Mobile App?

Posted: Mon Dec 21, 2015 10:56 pm
by Louis Adekoya

Hi Sergiy, what am I doing wrong? I set my control to be hidden by default (visible unchecked in design mode) then on my page's page show event I have:

code
var isPhoneGapApp = function() {

Code: Select all

     return (document.URL.indexOf('http://') === -1 && document.URL.indexOf('https://') === -1); 

 }; 

if (isPhoneGapApp === "true") {
Appery("tglSubscribe").show();
}
/code

This hasn't worked.


How do I Display a Control Only on Mobile App?

Posted: Wed Dec 23, 2015 10:37 am
by Serhii Kulibaba

Please use "isPhoneGapApp" as a function:
preif (isPhoneGapApp()) {
Appery("tglSubscribe").show();
} /pre


How do I Display a Control Only on Mobile App?

Posted: Wed Dec 23, 2015 3:24 pm
by Louis Adekoya

Thanks Sergiy. Seemed promising but still doesn't work unfortunately. The control is still hidden when I use the native app on my phone. My current code (in my page's pageShow event) is:

code
var isPhoneGapApp = function() {

Code: Select all

     return (document.URL.indexOf('http://') === -1 && document.URL.indexOf('https://') === -1); 

 }; 

if (isPhoneGapApp()) {

Appery("tglSubscribe").show();

}
/code


How do I Display a Control Only on Mobile App?

Posted: Thu Dec 24, 2015 12:24 pm
by Serhii Kulibaba

Please move prevar isPhoneGapApp = function() {

return (document.URL.indexOf('http://') === -1 && document.URL.indexOf('https://') === -1);

}; /pre to the custom JS file.
And use JS on the page show event:
preif (isPhoneGapApp()) {
Apperyio("tglSubscribe").show();
} /pre

If it doesn't work, please share (http://devcenter.appery.io/documentat...) your app with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a and provide us with the following information:

1) App name
2) Test credentials if login functionality is implemented in your app
3) Detailed steps to reproduce the issue


How do I Display a Control Only on Mobile App?

Posted: Mon Dec 28, 2015 6:32 pm
by Louis Adekoya

In case anyone needs the solution (provided by Sergiy):

On the device ready event of my start page, I added:

Apperyio.storage.isDevice.set(true);

Then on the page show event of the page containing my hidden control (which I only want to display in the native app), I have:

if(Apperyio.storage.isDevice.get()){
Apperyio("tglSubscribe").closest(".ui-field-contain").show();
}