How to use UIWebView that supports IPv6? - ios

I have an app that shows a content using UIWebView. Apple rejects the app, because it doesn't support IPv6 network. Do you have any idea how to fix that? I have to import some libraries or do something else?
I am not using IP address for the URL, but it's domain name, for example:
https://asd.com

Your UIWebView not the reason of rejection the reason was your link or you server not support IPV6, Firstly test if your link support ipv6 that apple mean from this link you can do it , If you not pass this test search for how to configuration your server to support IPV6, I hope I help you

If your application is targeting above iOS 8, try using WebKit instead of UIWebView.
Refer to the following link which clarifies the text below it:
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIWebView_Class/
Note: "In apps that run in iOS 8 and later, use the WKWebView class instead of using UIWebView. Additionally, consider setting the WKPreferences property javaScriptEnabled to false if you render files that are not supposed to run JavaScript."

Related

React native ios deeplinking with universal URL

I've been facing issue setting up deeplinking with react native for IOS with react navigation 5.
When i try the URL scheme of myownapp://homepage/ it opens up the app.
But if i try with url : https://dev.myownapp.com/homepage/ it opens up the safari browser, but it doesnt open up the app.
I've tried with the documentation by adding Appropriate code in AppDelegate.m file and also ive added myownapp.com in the Associated Domains in Xcode.
Can you guys brief about what configuration is left to be done because the same opens in android. Thanks in Advance
Can you reach https://dev.myownapp.com/.well-known/apple-app-site-association or https://dev.myownapp.com/apple-app-site-association yet?
If you can't, please host the file on the servers you want to be supported universal link.
So to make it work:
You need to setup your app to be supported wildcard domain by set applinks:*.myownapp.com.
You also need to host the config file (apple-app-site-association) to all the sub-domains, it means you're able to reach:
https://sub1.myownapp.com/.well-known/apple-app-site-association
https://sub2.myownapp.com/.well-known/apple-app-site-association
....
Another thing you should notice that all your domains must be supported secure connection (https).

will iOS universal links support work without web server?

I have created an cordova iOS app and wanted to add universal links support to it with a custom domain. Means I don't have any web server to configure my app association file . But still i need to support my app to handle a custom domain link like abc.com/path/* . abc.com doesn't exist but i need to handle this links in my ios app. Same is working fine in Android. any custom non existing domain links are working fine in android. but the same is not the case for ios. Can some one please help me in this how can i achieve this.
I have already tried cordova-plugin-deeplinks to do the same. Android is working perfectly but ios is not working.
No, it will not work. You need to host the apple-app-site-association file on that domain in order to prove ownership of the domain.
Otherwise, iOS wouldn't be able to prevent your app from hijacking e.g. twitter.com.
Custom URL Scheme solved my problem. used cordova-plugin-customurlscheme plugin and configured my custom url schema.

Enable Application cache in WKWebView

I am aware that offline application cache is not supported in iOS WKWebView.
This is enabled in Safari, so I searched webkit project for the responsible code & found this
WKPreferences
- (void)_setOfflineApplicationCacheIsEnabled:(BOOL)offlineApplicationCacheIsEnabled;
Anyone familiar with this method? is it possible to enable app cache in iOS by accessing this private methods? (I am not going to ship the app to Appstore)
Update 2022
According to one of the comments below, this hack doesn't work anymore.
Yes, we can enable App cache by accessing private API
Create a category for WKPreferences and add to following method signature.
#interface WKPreferences (MyPreferences)
- (void)_setOfflineApplicationCacheIsEnabled:(BOOL)offlineApplicationCacheIsEnabled;
#end
(I tried performSelector:withObject: but it didn't work. No idea why)
After initializing the WKWebView, enable the appcache by calling the above method in the following object
[_wkWebView.configuration.preferences _setOfflineApplicationCacheIsEnabled:YES];
It will create the ApplicationCache.db file in the Cache directory and allow the web app to work offline.
Warning :
2.5. Apps that use non-public APIs will be rejected
According to this tweet from at Apple, as of iOS 10, App Cache is now supported in WKWebView:
https://twitter.com/andersca/status/743259582252879872
...as does this WebKit bug report:
https://bugs.webkit.org/show_bug.cgi?id=152490
I've tested this in WKWebView using this site:
http://webdbg.com/test/appcache/
and can confirm it works as expected both in the iOS Simulator and on devices running iOS 10.

itms-services IPA wireless distribution link not working

I'm trying to get an IPA downloadable through a website. From reading around I see this is done itms-services.
My issue is my link in php is not working - I have a feeling it's down to the syntax but i can't figure it out. I tried url encoding etc but no luck.
Any ideas?
echo 'Click here to donwnload</br>';
This is what Apple answers themselves on this question:
Yes, the itms:// type links don't work in the simulator.
You'll need to url encode just the url. So instead of
http://localhost:8888/hockey/hockey/appname_type/info.plist
you use this
http%3A%2F%2Flocalhost%3A8888%2Fhockey%2Fhockey%2Fappname_type%2Finfo.plist
I "think" the URL must now be HTTPS vs HTTP, per Apple security change.
Is your url to your ipa-file in the info.plist correct?
It needs to be the absolute url, f.e.
<key>url</key>
<string>http://localhost:8888/hockey/hockey/appname_type/info.ipa</string>
and it shouldn't be in a .htpasswd secured directory.
Unless you are running a jailbroken iOS device that's got it's own web server, a localhost url will notwork. I suspect your localhost reference works in Safari on your mac because it is running a web server that is serving up the files.
You'll need to specify the IP address for the Mac in your link, like
Click here to donwnload</br>';
but replace 192.168.0.100 with the IP address of your Mac.
Note that this won't work in the simulator, since you cannot install apps through the itms-services

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