I'm developing an application for iPad, which is coded using Phonegap 1.7. Working with iframes is needed, so I enable the domains I want to access to in the white list and set OpenAllWhitelistURLsInWebView to YES on the Cordova.plist. The problem is that I'd like to open some specific links in a MobileSafari browser, not in the webview. According to the Phonegap wiki:
Enabling iFrames on PhoneGap-iOS requires that you whitelist the
iframe domains and enable "OpenAllWhitelistURLsInWebView". While this
doesn't sound like a problem, many applications want to open specific
sites in MobileSafari (not a ChildBrowser), which cannot be
accomplished easily when "OpenAllWhitelistURLsInWebView" is enabled.
So, although that "cannot be accomplished easily", is there any way to accomplish it?
Related
I was using a website, and noticed that from my iphone on Safari, I could directly install their app from the Web UI. This was from the top of the page at https://flytap.com/ . I can't find what this is called or how to do it anywhere in the iOS documentation. This only seems to work in Safari.
Does anyone know what they are doing, or how I can do it?
This is done via adding Universal Link support (documentation here).
The banner you are seeing is the Universal Link smart banner (documentation here).
In-short, you should have a website, the website should be SSL enabled, you need to add an apple-app-site-association-file which defines the links your app needs to handle, make changes in your app to handle Universal Links and you should be good to go.
The app you shared has its apple-app-site-association file here. You can view this file for any app that supports Universal Links using the pattern https://<SITE_BASE_URL>/.well-known/apple-app-site-association or https://<SITE_BASE_URL>/apple-app-site-association.
From Apple's guide in Support Universal Links:
When you support universal links, iOS 9 users can tap a link to your website and get seamlessly redirected to your installed app without going through Safari. If your app isn’t installed, tapping a link to your website opens your website in Safari.
But i'm confused that if my app is not installed,and I tap a universal link of my app in another app's UIWebView,will the system launch Safari app to load my website,or still load it in the UIWebView?
I test some app's universal links when the app is not installed,and they never launch Safari to load the next page ,they still load it in the UIWebView.
I want to konw if it's possible to launch Safari,but not stay in UIWebView.Do I need any configuration in apple-app-site-association file?
Actually I want to trace where my app was installed from by using cookie.I can store a cookie in Safari with informations of the download page,and get the cookie with SFSafariViewController when my app is installed and opened,and present different views according to the cookie.
What you are trying to build is called 'deferred deep linking'. This (plus a lot more) is exactly what we provide at Branch.io. If you want to avoid the headache of configuring it all yourself, give this a look. Apps like Pinterest, Airbnb, and Tinder all use us for this reason.
Apple's documentation is referring to the default behavior with the standalone Safari browser. Handling links inside an app with UIWebView supersedes this, and there is no way to automatically bounce out of the origin app into the main Safari app.
The workaround is to store data on your own backend. As you've discovered, relying on a cookie pass-through on the device itself won't work in many cases.
I want to have custom view for smart app banner which I think is not possible. but I have seen it in wikipedia mobile site which is smaller than standard apple banner.
wikipedia shows custom banner on its mobile site only if wikipedia app is installed. if it is not installed or user uninstalls it then banner disappears.
Is there a way to achieve this kind of banners?
Are you talking about 'Open in app' banner? Those comes by default if you have supported for universal links in the app.
See screenshot:
For iOS6+, you can use Smart Banners: https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html
One of your requirement is to not show when the app is not installed (instead of promoting the app).
I do not know of a way to test for installation but I would look
url scheme: seems limited because the app will always open instead of
just being able to check if system can answer
cookies: can a cookie
be set from inside app that would be reused by safari when visiting
the same domain?
files: create a file from the app and try to open it
from safari
I am in the mist of creating a mobile web app and have both meta tags
I have an iphone 5 on 7.0.4
When I click on a regular link like the one below it, opens up a mobile safari window and leaves the webapp. I also tried setting the target to _self and same behavior.
Sign in
I then used my ipad which was on 7.0.3 and it worked as should, not opening mobile safari on links. I think proceeded to update my ipad to 7.0.4 and the same issue as I had on my ipad.
Anyone ran into this issue and or knows a fix ?
Thanks
Since iOS 7.0.4 all links in WebApps open in Safari. As a workaround you can use Javascript:
window.location.href='text.html'
But remember that these steps will not be captured in history (so there is no ability to use Javascript like history.back() ..).
Alternatively, if you are using a menu in your web app, try to combine iframe and Javascript, you can change the content of your iframe with this Javascipt:
document.getElementById("frame").src = new_content.html
This will prevent your WebApp to open up links in Safari and stay in WebApp view.
I am developing an app for both BlackBerry and Android. On Android, when I send the browser to some url, it redirects to another url with good look. But on BlackBerry for the same url it is only displaying links on the site. It is not applying css and does not look like the Android layout.
Blackberry browser (specially in OS versions < 6) is not as good as the Android one. There are also a couple of options in the Browser Settings that you should enable for it to load JavaScript, Background Images or PC-targeted CSS files. Sadly, there seems to be no way of automatically passing this as a parameter to the browser before opening.
You're facing a platform issue, not a developer's one. Although you could, of course, create a set of CSS files intended for Blackberry visitors, taking these limits in mind and being conscious that it will not look as good as the Android one.