[ 
https://issues.apache.org/jira/browse/CB-10078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15242268#comment-15242268
 ] 

Jacob Weber commented on CB-10078:
----------------------------------

OK, I'm almost embarrassed to post this because it's so hacky. But if you need 
this to work right away, you can force it to use the same image that 
cordova-plugin-splashscreen uses, by inserting an entry into the Info.plist 
file. It will be scaled, but it will at least force the iPad Pro to use the 
right user agent.

In Xcode's Build Phases, add a "Run Script" entry after Copy Bundle Resources, 
with the following code:
{code}
/usr/libexec/PlistBuddy -c 'Add :UILaunchImages:0 dict' 
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
/usr/libexec/PlistBuddy -c 'Add :UILaunchImages:0:UILaunchImageMinimumOSVersion 
string 8.0' "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
/usr/libexec/PlistBuddy -c 'Add :UILaunchImages:0:UILaunchImageName string 
LaunchImage-700-Portrait' "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
/usr/libexec/PlistBuddy -c 'Add :UILaunchImages:0:UILaunchImageOrientation 
string Portrait' "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
/usr/libexec/PlistBuddy -c 'Add :UILaunchImages:0:UILaunchImageSize string 
{1024, 1366}' "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"

/usr/libexec/PlistBuddy -c 'Add :UILaunchImages:0 dict' 
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
/usr/libexec/PlistBuddy -c 'Add :UILaunchImages:0:UILaunchImageMinimumOSVersion 
string 8.0' "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
/usr/libexec/PlistBuddy -c 'Add :UILaunchImages:0:UILaunchImageName string 
LaunchImage-700-Landscape' "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
/usr/libexec/PlistBuddy -c 'Add :UILaunchImages:0:UILaunchImageOrientation 
string Landscape' "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
/usr/libexec/PlistBuddy -c 'Add :UILaunchImages:0:UILaunchImageSize string 
{1024, 1366}' "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
{code}

> With iPad Pro the wrong userAgent (iPhone) will be saved
> --------------------------------------------------------
>
>                 Key: CB-10078
>                 URL: https://issues.apache.org/jira/browse/CB-10078
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: Master, 3.6.3
>         Environment: iPad Pro
> iOS 9.1
>            Reporter: Christian Hemker
>              Labels: cordova-ios-4.1.1
>
> Using UIWebView on an iPad Pro (iOS 9.1) gives you a wrong userAgent, because 
> it says its an iPhone. 
> You can reproduce this behavior with the iPad Pro device and with the iPad 
> Pro simulator. In both cases the userAgent is:
> {noformat}
> mozilla/5.0 (iphone; cpu iphone os 9_1 like mac os x) applewebkit/601.1.46 
> (khtml, like gecko) mobile/13b137
> {noformat}
> This seems to be a known bug with iOS 9.1 on the iPad Pro because it is fixed 
> with iOS 9.2 beta 4 and you are getting the right userAgent.
> If you clean install your app, everything works fine on iOS 9.2 beta 4. But 
> if you update your previously installed app, you are still getting the wrong 
> userAgent because the CDVUserAgentUtil uses the cached userAgent. 
> For users it is not possible to clean install the app, because in that case 
> the whole configuration would get lost. To get the right userAgent every 
> time, developers must have the option to disable the caching of the userAgent 
> in their apps. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to