Xcode 8.3 libMobileGestalt MobileGestaltSupport.m:153: - ios

I'm using UIWebView XCode Version 8.3. My console continues to show me this error when I start the app and I do not understand what it means. In my UIViewController there is no code so I do not understand why XCode continues to show me this error.
I have only one place in my webview viewcontroller by Storyboard.
This is the error:-
2017-04-07 23:54:50.081592+0200 Conquers[1647:697735]
libMobileGestalt MobileGestaltSupport.m:153: pid 1647 (Conquers) does
not have sandbox access for frZQaeyWLUvLjeuEK43hmg and
IS NOT appropriately entitled
2017-04-07 23:54:50.081651+0200 Conquers[1647:697735] libMobileGestalt
MobileGestalt.c:550: no access to InverseDeviceID (see
)

Just by searching on the web when I came across this issue and found that can be an Apple error (no bugs or crash are appearing with this error in my app).
If the error occurs only when you set up the UIWebView on your app. I would check if the app has configured correctly the "App transport security Settings" in your .plist
if you inspect your .plist you can add it by hand like:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>add-your-site-here-if-needed</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>
This happens to me also when I added some third-party code like FirebaseSDK. And it suddenly stops appearing after I setup correctly my URL schemes for all my environments. So I´m assuming that this error appears when something is not fully/correctly implemented like in a snowball effect by Apple side code.
NOTE: You can also try to go back a few steps back on when the error occurs to narrow down the possibilities of occurrences of this error.

Related

iOS WKWebView doesn't load http web content

WKWebView doesn't load http requests, only https is working. My Url's strings are fetched from an API, so the url's links could be http and https. I did read about security, however the only thing I found was to add the following lines to the Info.plist:
<key>NSAppTransportSecurity</key>
<dict>
<key> NSAllowsArbitraryLoadsInWebContent</key>
<true/>
</dict>
However, in the .plist these keys don't exist. Is there any way to make WKWebView load http web content, and would the app be approved by the App Store?
I'm using Xcode 9.
1: Open your info.plist file from the project
2: add App Transport Security Settings in Information Property List
3: add Allow Arbitrary Loads in App Transport Security Settings
See the attached images
You can ignore all transport security restrictions with the key your provided using the following:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
I assume your example is not working due the space in the key:
<key> NSAllowsArbitraryLoadsInWebContent</key>
Try to use the same value as you did but without the space.

app runs in simulator, fails on iPad "missing required entitlement ... icloud-services"

Added iCloud to a working iOS app, with data stored in the public database. I have to log on to iCloud in the simulator, but that done, the app runs fine in the simulator. On an iPad, the program crashes on the following statement:
CKContainer * dbContainer = [CKContainer defaultContainer];
The app is terminated "due to uncaught exception 'CKException', reason: 'The application is missing required entitlement com.apple.developer.icloud-services'
When I turn on the iCloud capability in XCode, XCode creates an entry in the .entitlements file for com.apple.developer.icloud-services, with one item in the array: a string with value "CloudKit".
On my iPad I am logged in to iCloud in the same way as on the simulator.
I have been through Apple's entitlement troubleshooting guide in detail several times, I have searched every way I know how, and I can't figure out why this fails. I did find and read the posts suggested as duplicates and none of the solutions suggested worked for me.
After posting this question, I went through the entitlement troubleshooting guide one more time and found the following entitlement section in the built app:
<dict>
<key>keychain-access-groups</key>
<array>
<string>PTXZTRRTHH.*</string>
</array>
<key>get-task-allow</key>
<true/>
<key>application-identifier</key>
<string>PTXZTRRTHH.com.quipzl.Quipzl</string>
<key>com.apple.developer.ubiquity-kvstore-identifier</key>
<string>PTXZTRRTHH.*</string>
<key>com.apple.developer.icloud-services</key>
<string>*</string>
<key>com.apple.developer.icloud-container-environment</key>
<array>
<string>Development</string>
<string>Production</string>
</array>
<key>com.apple.developer.icloud-container-identifiers</key>
<array>
<string>iCloud.com.quipzl.Quipzl</string>
</array>
<key>com.apple.developer.icloud-container-development-container-identifiers</key>
<array>
<string>iCloud.com.quipzl.Quipzl</string>
</array>
<key>com.apple.developer.ubiquity-container-identifiers</key>
<array>
<string>iCloud.com.quipzl.Quipzl</string>
</array>
<key>com.apple.developer.team-identifier</key>
<string>PTXZTRRTHH</string>
<key>aps-environment</key>
<string>development</string>
</dict>
And the app does run on my iPad - until execution reaches the code above, when it throws an exception. Why?
This crash was not due to any missing entitlements, though the exception said it was. I don't know exactly what fixed the problem, but I do know the process that worked, as follows:
1) create a new iOS project of the same type an make sure it runs.
2) enable CloudKit in the new app, and add #import "CloudKit/CloundKit.h" in the default controller created by XCode.
3) add the statement "[CKContainer defaultContainer];" in the viewDidLoad() method.
4) run the app again and make sure it doesn't crash on the added statement.
5) go through all of the app properties in the old app and make sure all of the values are identical to those in the new app.
This last step included around a dozen value changes, and solved the problem: the old app no longer crashes trying to access iCloud.

iOS 9 ATS Whitelisting

This may sound like a stupid question but I've been having some trouble understanding ATS and Whitelisting.
I use the Facebook SDK so I followed what the documentation said and made the appropriate changes on my .plist to Whitelist Facebook servers.
In my app, I make API calls to my server and I was wondering how I should go about Whitelisting that? Also, in one of the WWDC talks on ATS, they spoke about URLSchemes. If someone could explain or point me in the right direction where I can get an understanding of why it needs to be implemented and how it should be done, that would be great!
Again sorry if this sounds like a stupid question - I've tried reading articles but haven't really been able to understand it.
Many thanks in advance for your help!
You may try the following:
Official technote :
Apple Developer Technote for ATS
Console log, User Experience and Solution : click here
If enabled, ATS will block every HTTP request made by your App or third party libraries.
Apple will require specific justification whether you're disabling it or putting exceptions in the NSExceptionDomains dictionary.
You're allowed to do it when you have to connect to a server not managed by you or using a device that cannot support secure connections or be requesting media content already DRM-protected.
Your .plist will look to something like this:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoadsInWebContent</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>domain.com/</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>
Don't forget to put the domain without the: http://

XCode - Swift - App Transport Security has blocked a cleartext HTTP (http://) error

I have been trying to deal with this problem for a while now, and I'm hoping someone has a solution that I haven't yet seen.
I am using XCode 7 and am testing my app on an iPad (ios 9 beta). I have tried adding the code below to every instance of Info.plist and it doesn't work.
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
I have tried decreasing the Deployment Target to 8.4. I have tried restarting both my laptop I am developing on and the iPad.
I just don't know what else to do. Thanks.
You may just be adding it in an invalid position, it should be inside the main <dict> tag. Try adding as the first element in the first dictionary like this.

App Over-The-Air Installation with HTTPS not working

I know that in general installation via HTTPS is working but somehow it doesn't in my Environment.
The itms-service link is HTTP as far as I understood:
itms-services://?action=download-manifest&url=http://' . $_SERVER['SERVER_NAME'] . $downloadLink
The links in the .plist are then HTTPS
<key>assets</key>
<array>
<dict>
<key>kind</key>
<string>software-package</string>
<key>url</key>
<string>https://app.ipa</string>
</dict>
<dict>
<key>kind</key>
<string>full-size-image</string>
<key>needs-shine</key>
<true/>
<key>url</key>
<string>https://image_512x512.png</string>
</dict>
<dict>
<key>kind</key>
<string>display-image</string>
<key>needs-shine</key>
<true/>
<key>url</key>
<string>https://image_57x57.png</string>
</dict>
</array>
But the app won't install. I always get the message "App could not be loaded"
All URL's are reachable with HTTP & HTTPS.
XCode shows the app log
unknown securityd[2331] : CFReadStream domain: 12 error: 8
What am I doing wrong here?
Thx
There's not a huge amount of information about how you've tried to solve this, so rather than actual answers I just have questions. If the answer to any of the questions is 'no' then should point you at the area your problem is in.
Is https://app.ipa the actual URL you're using in the .plist? If so I'd try with the full hostname & path in there.
Does the https site have a proper signed valid certificate that Safari on iOS accepts without any interaction with the user? If not try a proper certificate.
Do you see the .ipa file get downloaded from the server, if you check the server log file?
Have you tried installing the .ipa file using iTunes, does it get accepted?
The problem is that the Certificate Authority needs to be known by the iPad.
If you distribute Apps with HTTPS and the CA Server is your own, you need to install the certificate on the iPad. Otherwise iOS will try to download it.
You can install it sending it via email to your iPad or create a .pem File from the Keychain Access program and host it on your server for installation purposes. Then open it with Safari and iOS will ask you to accept it.
Then the installation works. But beware of using .htaccess as using HTTPS and HTTP together in the installation process seems to trigger the login/password for every request, which are 4 for images, .ipa and .plist, which is really annoying.
[EDIT]
Please keep in mind that you need to refer to the .plist file only with HTTPS since Apple introduced iOS 7.1.
See here: Enterprise app deployment doesn't work on iOS 7.1

Resources