You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 4, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on May 4, 2022. It is now read-only.
bug: Ionic 3, iOS 13.4.1, the framework shows the Android UI instead of the iOS UI (UI components) #1104
I am also experiencing this issue on iPad tablets showing the wrong UI.
I notice that this.platform.platforms() does not show the correct values, its empty with only cordova.
I notice that the status bar is also overlaying over the headers because the correct styles are not being applied
Same here, this.platform.is('ios') is returning ['cordova', 'core'] only.
Any fix? I am currently maintaining a version assuming it is iOS, without platform.is('ios') verification, for the AppStore.
Same here, we change all our platform.is('ios') to device.platform == 'iOS' using @ionic-native/device instead. However this only solves the issue inside of checking the platform inside the app but no the app styling itself.
The whole problem is caused by change on useragent done by iOS 13. The platform service rely on that user agent to get the device information.
My small fix that seems to work (not tested in all iOS-versions on device, only 14 + 13.5 in simulator, not tested for Android):
With webviewplugin version 4.2.0 or greater the user agent has changed. See comment above (#1104 (comment))
I assume that the cordova device-plugin cannot be relied on to be started when the ionic-angular properties are configured. So in app.module.ts I added the following function:
/**
* ionic wkweb plugin after 4.1.3 returns userAgent with Macintosh, for instance
* Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148
*/
export function determineMode() {
const iOSStrings = ['ipod', 'ipad', 'iphone', 'macintosh'];
const userAgent = window.navigator.userAgent.toLocaleLowerCase();
return iOSStrings.find(searchString => userAgent.includes(searchString)) ? 'ios' : 'md';
}
Besides that I had the problem that statusbar-padding class was not set. To me it seems like it should be set either way when the app is running in cordova, but again I assume the user agent change may have changed how this is determined.
Hence I hardcoded it in the config object passed to ionic-angular.
My modified config then contained in IonicModule.forRoot the following:
IonicModule.forRoot(YourApp, {
mode: determineMode(),
statusbarPadding: true,
(.... your other properties if any)
}
@oddcb Regarding your useful determineMode function.
I believe you would need to adjust to have the following on the return function: return iOSStrings.find(searchString => userAgent.includes(searchString)) ? 'ios' : 'md';
At least that what I needed to do on ionic v3 to get the android theme working
@oddcb Regarding your useful determineMode function.
I believe you would need to adjust to have the following on the return function: return iOSStrings.find(searchString => userAgent.includes(searchString)) ? 'ios' : 'md';
At least that what I needed to do on ionic v3 to get the android theme working
@IMPMAC Thanks for spotting that. At the time I hadn't tested Android yet. :-) I've updated my comment.
@oddcb - for reference, it seems like your addition to check for macintosh is along the same lines of what the current Ionic codebase is doing too. Thanks for the helpful info.
For reference, their iPad check does also require an additional isMobile check, likely to confirm a device is not a desktop/laptop Macintosh. That snippet is below too:
I'm seeing a more severe version of this issue, triggered by update to cordova-ios@6. Not only is the ios platform not added for styling purposes, cordova is not available, leading to plugin failure. Is anyone else seeing something similar?
I was trying the previous solutions, and the icons was working but the ion-app classes wasn't properly filled with platform-ios or platform-mobile, etc.
That is why I made a fork of webview@5.0.0 and simulate the older userAgent to avoid the ios detections problems
With that change, the icons works fine, the classes are filled and the this.platform._platforms return all the sets like the older versions: ["cordova", "mobile", "ios", "tablet", "ipad"]
@fbrun Did you try my changes?
Did you install this fork in the branch 5.x.x ?
Did you have OverrideUserAgent or AppendUserAgent setted ?
I installed this fork with ionic@3.9.2, and tested in devices ipad7@13.1.1 , iphone7@14.7.1 and some ipad simulators 11.4, 14.3, for now I didn't see the problem.
I was trying the previous solutions, and the icons was working but the ion-app classes wasn't properly filled with platform-ios or platform-mobile, etc.
That is why I made a fork of webview@5.0.0 and simulate the older userAgent to avoid the ios detections problems
With that change, the icons works fine, the classes are filled and the this.platform._platforms return all the sets like the older versions: ["cordova", "mobile", "ios", "tablet", "ipad"]
Activity
IMPMAC commentedon May 19, 2020
I am also experiencing this issue on iPad tablets showing the wrong UI.
I notice that this.platform.platforms() does not show the correct values, its empty with only cordova.
I notice that the status bar is also overlaying over the headers because the correct styles are not being applied
ulver2812 commentedon May 20, 2020
@IMPMAC Yes, I experiencing the same issues...
sengoontoh commentedon May 27, 2020
Experiencing same issues as well.
platform.is('ios') is false on iPad
platforms array only has 'cordova' and 'core.
Any workarounds?
ulver2812 commentedon Jun 8, 2020
@sengoontoh yes, in app.module.ts I use this code:
basically you have to set
mode: 'ios'in theIonicModule.forRoot.But this workaround is good if you are working only on iOS, because it forces the iOS UI also on Android 🙁.
andrehhtm commentedon Aug 28, 2020
Same here,
this.platform.is('ios')is returning['cordova', 'core']only.Any fix? I am currently maintaining a version assuming it is iOS, without
platform.is('ios')verification, for the AppStore.crazyserver commentedon Sep 15, 2020
Same here, we change all our platform.is('ios') to device.platform == 'iOS' using @ionic-native/device instead. However this only solves the issue inside of checking the platform inside the app but no the app styling itself.
The whole problem is caused by change on useragent done by iOS 13. The platform service rely on that user agent to get the device information.
oddcb commentedon Oct 14, 2020
Hi. Are you all using wkwebview plugin with version greater than 4.1.3, e.g. 4.2.x or 5.0.0? See ionic-team/cordova-plugin-ionic-webview#556 (comment)
oddcb commentedon Oct 14, 2020
My small fix that seems to work (not tested in all iOS-versions on device, only 14 + 13.5 in simulator, not tested for Android):
With webviewplugin version 4.2.0 or greater the user agent has changed. See comment above (#1104 (comment))
I assume that the cordova device-plugin cannot be relied on to be started when the ionic-angular properties are configured. So in
app.module.tsI added the following function:The function more or less (I think) follows the logic in platform.ts: https://github.com/ionic-team/ionic-v3/blob/master/src/platform/platform.ts#L893 with the addition of 'macintosh'.
Besides that I had the problem that statusbar-padding class was not set. To me it seems like it should be set either way when the app is running in cordova, but again I assume the user agent change may have changed how this is determined.
Hence I hardcoded it in the config object passed to ionic-angular.
My modified config then contained in IonicModule.forRoot the following:
IMPMAC commentedon Oct 28, 2020
@oddcb Regarding your useful
determineModefunction.I believe you would need to adjust to have the following on the return function:
return iOSStrings.find(searchString => userAgent.includes(searchString)) ? 'ios' : 'md';At least that what I needed to do on ionic v3 to get the android theme working
oddcb commentedon Nov 12, 2020
@IMPMAC Thanks for spotting that. At the time I hadn't tested Android yet. :-) I've updated my comment.
brassier commentedon Dec 10, 2020
@oddcb - for reference, it seems like your addition to check for
macintoshis along the same lines of what the current Ionic codebase is doing too. Thanks for the helpful info.ionic-team/ionic-framework#19258
For reference, their iPad check does also require an additional
isMobilecheck, likely to confirm a device is not a desktop/laptop Macintosh. That snippet is below too:Shane98c commentedon Apr 9, 2021
I'm seeing a more severe version of this issue, triggered by update to cordova-ios@6. Not only is the ios platform not added for styling purposes, cordova is not available, leading to plugin failure. Is anyone else seeing something similar?
fbrun commentedon Aug 26, 2021
Hi,
same error under iPad.
this.platform.is('ios')is returning['cordova', 'core']only.I tried this solution:
but under iOS14, i have the error IOS build failed for IOS 14 - Property ‘userAgent’ not found on object of type ‘CDVViewController *’
My ionic info:
lempere commentedon Sep 7, 2021
I was trying the previous solutions, and the icons was working but the ion-app classes wasn't properly filled with platform-ios or platform-mobile, etc.
That is why I made a fork of webview@5.0.0 and simulate the older userAgent to avoid the ios detections problems

we-are-Joinup/cordova-plugin-ionic-webview@57fc602
With that change, the icons works fine, the classes are filled and the this.platform._platforms return all the sets like the older versions:
["cordova", "mobile", "ios", "tablet", "ipad"]fbrun commentedon Sep 13, 2021
I tried your change under ipad@14.6 but platform.platforms() always return only ['cordova', 'core'] values
lempere commentedon Sep 13, 2021
@fbrun Did you try my changes?
Did you install this fork in the branch 5.x.x ?
Did you have OverrideUserAgent or AppendUserAgent setted ?
I installed this fork with ionic@3.9.2, and tested in devices ipad7@13.1.1 , iphone7@14.7.1 and some ipad simulators 11.4, 14.3, for now I didn't see the problem.
fbrun commentedon Sep 13, 2021
We just change code from the screen. We will try to install it correctly, thanks
jake-moritz-trifecta commentedon Sep 15, 2021
This seemed to work for me, thank you.