PDA

View Full Version : [INFOREQ] App - Ext.is.iOS return false on iPad



steve1964
24 Aug 2012, 1:22 AM
Sencha touch 1.1.1
Running an iPhone app on iPad in 2x emulation Ext.is.iOS return false, even of course we are on iOS, working fine with universal app or iPad app.

Mac OSX Lion 10.7.4
xCode 4.3.3
Sencha Touch 1.1.1
Phonegap 1.8.1

I dont look at the code in Sencha Touch 2, but if you test navigator property the same way, Ext.is.iOS will return false on Sencha Touch 2 too.

Using Ext.is.iOS in an iPhone app will cause unexpected result on iPad and this will cause the rejection of the app on appstore, because they test that the app is working fine also on iPad.
Off course was my fault to not testing the app on iPad in 2x emulation, but this a bug in Sencha Touch...

mitchellsimoens
24 Aug 2012, 6:52 AM
Do a test in Safari it's returning true so this is only within Phonegap? What's the useragent then?

steve1964
24 Aug 2012, 7:30 AM
Hi Mitch, the issue is with webview, in safari everything work as expected,
This happen only when you compile an app with xCode for iPhone (for iPhone only, not universal app), then as you know, you have to test the app also on iPad because the app MUST work on iPad too or the app is rejected.
In this case (when running on iPad and emulating the iPhone webview) Ext.is.iOS return false.
I can suppose that this issue has to do with the iPad emulation, i dont know if they use a particular webview, in this case, that prevent Ext.is.iOS to return true.
The same app running on iPhone work as expected.
To summarize:
app for iPhone is working as expected, but not on iPad
universal app is working as expected both on iPhone and iPad

steve1964
25 Aug 2012, 3:06 AM
In the app i added the following:

console.log(navigator.platform);
console.log(navigator.appVersion);
console.log(navigator.userAgent);
console.log(Ext.is.iOS);

The xCode log:

2012-08-25 13:30:45.939 VillaggiodellaSalutepiu[258:707] Multi-tasking -> Device: YES, App: YES
2012-08-25 13:30:45.943 VillaggiodellaSalutepiu[258:707] Multi-tasking -> Device: YES, App: YES
2012-08-25 13:30:45.991 VillaggiodellaSalutepiu[258:707] supportedOrientations: (
1
)
2012-08-25 13:30:45.993 VillaggiodellaSalutepiu[258:707] AppDelegate forcing status bar to: 1 from: 5
2012-08-25 13:30:48.878 VillaggiodellaSalutepiu[258:707] [INFO] iPad
2012-08-25 13:30:48.879 VillaggiodellaSalutepiu[258:707] [INFO] 5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206
2012-08-25 13:30:48.881 VillaggiodellaSalutepiu[258:707] [INFO] Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206
2012-08-25 13:30:48.882 VillaggiodellaSalutepiu[258:707] [INFO] false
2012-08-25 13:30:48.895 VillaggiodellaSalutepiu[258:707] [INFO] Cordova Facebook Connect plugin initialized successfully.

Running a an iPhone app on iPad 2.

The same app running on iPhone 4s:

2012-08-25 13:28:07.326 VillaggiodellaSalutepiu[352:707] Multi-tasking -> Device: YES, App: YES
2012-08-25 13:28:07.331 VillaggiodellaSalutepiu[352:707] Multi-tasking -> Device: YES, App: YES
2012-08-25 13:28:10.322 VillaggiodellaSalutepiu[352:707] [INFO] iPhone
2012-08-25 13:28:10.324 VillaggiodellaSalutepiu[352:707] [INFO] 5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206
2012-08-25 13:28:10.325 VillaggiodellaSalutepiu[352:707] [INFO] Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206
2012-08-25 13:28:10.327 VillaggiodellaSalutepiu[352:707] [INFO] true
2012-08-25 13:28:10.365 VillaggiodellaSalutepiu[352:707] [INFO] Cordova Facebook Connect plugin initialized successfully.