PhoneGap/Cordova and external url instead of www/index.html - ios

I'm about to build and app with Cordova.js to enable file upload on the iPhone. I'd like to just use the regular responsive web site and include the cordova.js to get access to native features like the camera.
I read somewhere that Apple might reject apps that loads external urls in an app like this. Is this true and what's the real problem?
Would it be different if the app contains a local page by default and opens external content on user interaction?

Well if you app can be reproduced by a web site then Apple will just reject it. You are going to add camera features so that is a good start. If you don't use some native features they will reject it out of hand.
Secondly Apple does not like apps that load code from remote locations. They want to be able to go over everything themselves and don't like the idea of things changing without them being able to verify it first. So, remote data is okay but remote code is not in their eyes.

Related

How to open my iOS App with custom URL scheme in Swift 3?

I need to open my particular UIViewController when the following link is clicked on the Safari browser:
http://my.sampledomain.com/en/customer/account/resetpassword/?id=24&token=8fbf662617d14c10f4a11f716c1b2285
When this link is clicked on the browser, I need to open my application on a particular screen and retrieve the data from this url. For example:
id = 24
token = 8fbf662617d14c10f4a11f716c1b2285
...and pass it to that particular UIViewController.
How can i do that?
What you are describing is called Deep Linking. It's a very common app feature to implement — most apps have it — and conceptually, it seems like an easy thing to build. However, it's complicated to get right, and there are a lot of edge cases.
You basically need to accomplish two things:
If the app is installed: open the app and route users to the correct content inside it.
If the app is NOT installed: forward users to the App Store so they can download it. Ideally, also route users to the correct content inside the app after downloading (this is known as 'deferred deep linking').
While not required, you'll also probably want to track all of this activity so you can see what is working.
If the app is installed
Your existing custom URI scheme fits into this category. However, Apple has decided that custom URI schemes are not a good technology, and deprecated them with iOS 9 in favor of Universal Links.
Apple is right about this. Custom URI schemes have a number of problems, but these are the biggest:
There is no fallback if the app isn't installed. In fact, you get an error.
They often aren't recognized as links the user can click.
To work around these, it used to be possible to use a regular http:// link, and then insert a redirect on the destination page to forward the user to your custom URI scheme, thereby opening the app. If that redirect failed, you could then redirect users to the App Store instead, seamlessly. This is the part Apple broke in iOS 9 to drive adoption of Universal Links.
Universal Links are a better user experience, because they are http:// links by default and avoid nasty errors. However, they are hard to set up and still don't work everywhere.
To ensure your users end up inside the app when they have it installed, you need to support both Universal Links and a custom URI scheme, and even then there are a lot of edge cases like Facebook and Twitter which require special handling.
If the app is NOT installed
In this case, the user will end up on your http:// fallback URL. At this point, you have two options:
Immediately forward the user directly to the App Store.
Send the user to your mobile website (and then use something like a smart banner to give them the option of going to the App Store).
Most large brands prefer the second option. Smaller apps often go with the first approach, especially if they don't have a website.
To forward the user to the App Store, you can use a Javascript redirect like this:
<script type="text/javascript">
window.onload = function() {
window.location = "https://itunes.apple.com/app/id1121012049";
};
</script>
Until recently, it was possible to use a HTTP redirect for better speed, but Apple changed some behavior in Safari with iOS 10.3, so this no longer works as well.
Deferred deep linking
Unfortunately there's no native way to accomplish this last piece on either iOS or Android. To make this work, you need a remote server to close the loop. You can build this yourself, but you really shouldn't for a lot of reasons, not the least of which being you have more important things to do.
Bottom line
Deep linking is very complicated. Most apps today don't attempt to set it up by building an in-house system. Free hosted deep link services like Branch.io (full disclosure: they're so awesome I work with them) and Firebase Dynamic Links can handle all of this for you, and ensure you are always up to date with the latest standards and edge cases.
See here for a video overview an employee at Branch made of everything you need to know about this.

universal links with redirects using google url shortener

The use case is, essentially, this:
the user create some content and uploads it to our server.
our server responds with the URL.
the user sends the URL (eg via text message) to another user.
the other user clicks on the URL. If they have the app installed, they should be taken to the content in the app. If they don't have it, they should still be able to view the content on our site (eg in safari).
This is easy enough, and we have that working, except our URLs are long and we'd like to use shortened URLs. With shortened URLs, the problem is it always opens in Safari, instead of the app, unless we setup a custom domain. (This is described in many places, including here: iOS Universal Links and URL Shorteners).
The docs for google URL shortener indicate that they have overcome this somehow:
Even though App Indexing for iOS is available only in limited release, you can still enable iOS app deep links with goo.gl by implementing App Indexing for iOS. While these deep links may not begin appearing in Search results, they will start working with goo.gl links.
So I installed the app indexing for iOS into our app on a test device and ran it. Then I created a short link but it still opens in my browser, not my app.
Does this really work as advertised? Do I have to wait longer? Install the indexer on more apps? Will a created link open in the app right away, or does the content have to be indexed?
...Or am I missing something else?
Related:
Google app indexing for iOS and universal links
UPDATE:
The only way I can see this actually working without a custom domain is if Google added every app they indexed to their apple site association file. All I see is google apps there, so obviously that's not the case.
Stack overflow won't let me link it because it thinks it's a link shortener, but it's close to this:
https://goo. gl/apple-app-site-association
You are exactly right: for this to work, Google would need to add your app to their apple-app-site-association file. Unfortunately that would be impossible even if Google wanted to do so, because Apple puts a size limit of 128 kb on that file.
Integrating the App Indexing SDK was a good thought, but doesn't solve this issue either.
What you need is a (free) service like Branch.io (full disclosure: I'm on the Branch team). This is specifically designed for exactly what you're trying to accomplish, and takes care of all the housekeeping tasks you are running into. You'll be able to create branded short URLs that take you to your app (if installed) or website fallback (if not installed), and the AASA file will be generated automatically for the short URL domain.

How to get images from email or desktop into iOS app?

I know this is a very basic question, but something I'm never quite sure of, is how do you get images from say your email, or from your desktop (say a Mac) into your iOS app?
Let's say I develop an app and I want people to be able to put their company's logo into it, how would they do that? I presume they don't have their company logo in their phone, so how would they get it from another source into the app? If they linked to it on the web, wouldn't that just open a UIWebView to show it? i.e it wouldn't load the actual .png from the web direct to be used by the app or would it?
So, to avoid long comments, I'm putting my answer here, although this is a very general question.
The common thing with all the apps that want an image input, is that they require the user either take a photo with their phone camera, or grant access to the photo library, so that the user can select an image and upload it to the app. If you have used any of the photo-involved apps these days, you should be familiar with this. Example is Instagram, Facebook, Flickr, etc.
However if you really really want to let the user download it off the internet through your app, then you should embed a web browser in your app, allowing the user type in a URL and save the file in that URL to the documents/downloads folder in your app, and then allow them access those folders to browse and upload stuff. A good example of this kind of app, is "NuageApp" which is actually a client for the Cloud App. It's really handy to deal with file sharing the way NuageApp (funky name, huh?!) does, however it's far more complicated to implement that, than the access to the photo library.

iOS Conversion / installation Tracking

Objective: i want to fetch my custom parameter(referrer) from iTunes link upon installation of my application in device.
iTunes links look somethings like this:
https://itunes.apple.com/in/app/complete-gym-guide-lite/id550449574?mt=8
If i append my parameter say(&referrer=xyz)at the end and i open this url in ios safari browser then it will prompt to download the application.
Confusion: will app store send my parameter(referrer) to my application on launch so that i can fetch it in my application and use it.
In case of Android play store link look like this: http://play.google.com/store/apps/details?id=&referrer=guid%3D%guid%
As you can see referrer parameter at the end of url. Once app is installed in device then play store will send this parameter to app using INSTALL_REFERRER broadcast receiver. We can use this parameter.
What i tried OR Other people doing for conversion tracking: Other people are simply sending static data to their server at the first time opening of app and maintain a flag in NSDefault to make sure that app does not send same data again. I can also do the same as well as alternate ways suggested in below links but i want to do something with custom parameter.
I have already seen below links:
iOS - track which ad campaigns my installs are coming from
Tracking iOS installs from multiple marketing sources
Please help me out.
As #Aditya said, for now, Apple is not sending any referrer (or params) from iTunes to installation.
The only way you have it's to use a third party sdk to get your installations.
I have been working on a own sdk to get this but the way to get any info it's really hard and not really confident to use it. So endly we used some third party which are using many techniques to getting this (as fingerprint data, App2App methods, etc...)
I have tested appsflyer sdk and facebook sdk, they work as expected, use this or any else you prefer.
Hope this helps

What options exist to create a shell app for iPhones that redirect to a website?

I have a client that needed to abandon their very poor native app and needs a temporary solution immediately. They have a mobile optimized website and we'd like to deploy an app in the store to replace the current one, and design it such that as soon as you launch it, it either hosts the site within a web browser control, or just redirects the user to a website in the iPhone Safari app. I realize there are subtle differences between the browser control and the actual Safari browsers.
Are there any tools or products that auto create such simple apps, and are there any problems with getting such simple apps approved by Apple?
Sounds like you want to make a hybrid app.
http://www.cocoacontrols.com/posts/a-primer-on-hybrid-apps-for-ios
Your app could just be a UIWebView that shows the website. It's possible that Apple might reject ithe app if there is nothing to it except a web view -- do some research on that possibility.

Resources