Oracle MAF application can't load remote URL on iphone - ios

I created a new feature that should load a remote URL connection. I also whitelisted the domain, just to be sure. The problem is that when I deploy it on my iPhone, it does not load that URL. On the contrary, on the simulator, it loads the URL without any issues.
What can be the problem?
Thank you in advance,
Razvan

I found the answer I needed. Since MAF 2.2.1, non-HTTPS connections seem to fail to run on iOS. So if you disable Application Transport Security (APS) , the problem should be solved. You can do it like this in JDeveloper :
Disabling App Transport Security for MAF Applications on iOS Devices
MAF applications that you migrate to this release of MAF enable ATS by default. You can disable ATS in your MAF application as follows:
In JDeveloper, choose Application > Application Properties > Deployment.
In the Deployment page, double-click the iOS deployment profile.
Choose iOS Options.
Select Disable Application Transport Security and click OK.
Hope to be helpful for others.
Thanks,
Razvan

Related

How debug Universal links

I use the cordova plugin "ionic-plugin-deeplinks" (to my knowledge also works with a plain cordova app).
On Android, links when clicked let users choice between chrome and my application.
=> I suppose that app links works
=> As I'm able to access window.IonicDeeplink and redirect the user to the right page
I'm not able to have the same behavior on iOS, when I click a link I always get the app open in Safari.
How can I find clue on issues ?
More context:
apple-app-site-association is got with a HTTP 200 (over https only), it's located in /.well-known/apple-app-site-association:
I checked TeamID and BundleID 5 times (at least);
with the branch.io validator i get all validations green:
Your domain is valid (valid DNS).
Your file is served over HTTPS.
Your server does not return error status codes greater than 400.
Your file's 'content-type' header was found :)
Your JSON is validated.
with the apple validator, I got : "Action required
Could not extract required information for Universal Links. Learn how to implement the recommended Universal Links.
Error no apps with domain entitlements
The entitlement data used to verify deep link dual authentication is from the current released version of your app. This data may take 48 hours to update." (but some devs said that working app add the same error) what to do with that result?
when monitoring server's log while installing the app with Xcode I see a request get a HTTP 200 on apple-app-site-association
while installing the app with Xcode I got no logs referring to swcd in Xcode (I read here that I should if I had error while installing the app). Is a successful installation silent?
I followed that guide to setup entitlements, but some things feel odd with it:
Unlike the snapshot in the guide, I didn't found any *.entitlements file in my project. Should I have one with cordova? (my xCode seems to remember my setting though). Is it possible to check that installed app get entitlements?
I did set my domain in Xcode like this: applinks:mydomain.com and the switch is ON. But I never uploaded any thing from my local dev environment to apple services. Should I have? If yes, how ?
My current interrogations are highlighted but any explanations on any lack of understanding will be more than welcome!!!
Until then I started a verification for testFlight looking for more info.
while installing the app with Xcode I got no logs referring to swcd in xCode
I implemented Universal Links manually, but situation was similar. Particularly I mentioned empty swcd process log while installing the app, and it turned out that most likely iOS didn't even try to download apple-app-site-association file, like if responsible process wasn't run. In my case device restart helped and deep-linking began to work.
Thus I think restarting device is one another step in troubleshooting when you are sure about all your setup.
For anyone trying to debug this in development:
In XCode, ensure you're editing the Debug version of Signing & Capabilities.
To bypass the Apple Universal Links CDN, configure your Debug domains like applinks:?mode=developer -- adding that query string in development is important.
On your iOS Device, go to Settings->Developer->Universal Links and ensure the Associated Domains Development toggle is switched on.
On your iOS Device in Settings->Developer->Universal Links->Diagnostics, enter your Universal Links URL and ensure you get a green checkmark.
After following all of these steps, Universal Links work locally.

Disable App Transport Security for Simulator only

How can I disable App Transport Security only when I run my app on the simulator (while still keeping it enabled when I run my app on my device, even in Debug mode)? Is there a way to disable it with Swift code instead of by modifying the Info.plist file?
I'm asking because I've configured things (via the code snippet below) so that the simulator connects (over HTTP) to a development server running on localhost and the device connects (over HTTPS) to the production server running in the cloud.
#if arch(x86_64) || arch(i386) // simulator
let apiBaseURLString = "http://localhost:3000"
#else // device
let apiBaseURLString = "https://api.example.com"
#endif
Ideally, I'd like keep App Transport Security enabled on the simulator and have the simulator connect over HTTPS to the development server running on localhost. I had that working, but I just updated Xcode, and it broke.
App Transport Security is configured at compile time by reading in the Info.plist. Changing it at runtime would actually have no effect on ATS enforcement, even if you could change the Info.plist at runtime (which you can't).
I can only think of two solutions:
Simulator build config -You could create two versions of the Info.plist, one of which disables ATS altogether, the other is used for running on devices. You can then create a specific build config for running on the simulator. In your Build settings, choose the new Info-Simulator.plist which disables ATS. The downside of this is that you would need to change your build config before running on the simulator - it would not automatically use the correct build config for simulator vs. devices.
Don't have different ATS settings for the simulator. Configure ATS to handle both the Simulator and physical devices. There are many options for ATS exceptions that should work for most scenarios. Need exceptions for local network connections? Look into NSAllowsLocalNetworking. Need more flexibility in a webview? Try NSAllowsArbitraryLoadsInWebContent.
Unfortunately, you can detect the simulator at runtime, but you can't change ATS behavior at runtime. You'll need to find another way, or re-evaluate if you really need a different config on simulators vs. devices.
I think this Code should work to access the .plist file, upon this code you can make changes what you need and put condition for that.
Bundle.main.object(forInfoDictionaryKey: key_name)
UPDATE
Here I'm Posting an Image please folow it:
Here you can get the value for:
NSAllowsArbitraryLoads = 1;
And through this you can put a condition according to your requirement.
Thanks

App Transport Security not working on Distribution

I have set App Transport Security for my iPad App with exception domains for few open api like weather online traffic etc., which we display it in a cordova webview. If I run it directly into iPad, it is working fine. But it is not loading correctly if I archive and distribute it.
Any idea ?
Actually, it looks like you are incorrectly adding exception domains. Don't include http:// in your exception domain entries.
Are you testing locally on an iOS 10 device (which would use the NSAllowsArbitraryLoadsInWebContentto ignore ATS in your web view altogether)? It would work on an iOS 10 device, but maybe the enterprise distribution fails on a device because the device is iOS9, which would try to use your exception domains, which are formatted incorrectly.
Another possible reason for a difference in behavior is that you have a different Info.plist specified for debug vs. release builds. Verify in your project settings that you are referencing the same Info.plist file for both build configs.

iPad:the server requires a client certificate

I have https server configured with ssl options.I configured certificates in Settings>General>Profiles.
When I access my server using Safari browser it works fine. But same doesn't work with Firefox,chrome and my ios app.
Do I need to do any specific step to solve this problem?
I am afraid it is not possible to solve this issue :/
I'm having the exact same problem: I have installed a custom certificate on my IPad and the secure connection works fine on Safari, but on Firefox the website tells me that there is no certificate installed
On the desktop application there is an option to add certificates to Firefox (tools > security > certificates), but this option does not exists in Firefox
From my understanding this is due to Firefox for IOS having only very limited functionalities (no module for example), so unfortunately it looks like it is not possible to set Firefox for IOS to use local security certificates...

iOS7 itms-services scheme not work?

I have an in-house app which I distribute over a local wifi
in release page have a link like this
itms-services://?action=download-manifest&url=http://192.168.1.231/app/plist/houseApp/out.plist
this worked on iOS 7 Safari
but when i add this page to main screen (like web app)
the same link didn't work, and apache access.log have no record about /app/plist/houseApp/out.plist
this worked in iOS 6
Anybody knows about this?
On the 7.1 update all software installation services are forced to use the HTTPS protocol, also covering non-standard itms-services:// URLs.
You need to change the protocol type:
from: itms-services://?action=download-manifest&url=http://yourdomain.com/manifest.plist
to: itms-services://?action=download-manifest&url=https://yourdomain.com/manifest.plist
For more detail and how to get a certificate go to: Fix certificate error on iOS 7
It seems Apple have disabled all URL schemas in iOS7 (including mailto: links) in standalone webapps. This has seriously implications for my place of work.
See this post: https://discussions.apple.com/thread/5385948?start=0&tstart=0
This worked for me in iOS 8.0. Simply use https for URLs.

Resources