On my iPhone, I'm running an app called Caissa Chess. After registering the app with the manufacturer (this is optional) I received an email, containing a chess puzzle. The crucial part of the mail message, showing a chess diagram looks like this:
<img src="cid:image1">
Tapping the diagram displayed by this URL quits Mail.app and opens Caissa Chess, that then displays the diagram, and allows you to solve the puzzle.
How does this work?I want to make a little app for the iPhone, that will need an external file, sent by email. I will fist need to understand what's going on.
chess:// how and where is defined what application will be opened?
what does the rest of the URL mean? Would it be referring to a local file, or will it be resolved by the app as a live http: url? The email message body contains an image attachment.
I'm sure that this mechanism is documented somewhere, but the books I have don't describe it, and Google didn't help me either.
Thank you in advance
Sjakelien
You have to register the protocol in your app. I've seen a few tutorials before, including this one.
http://iosdevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html
It's called a URL protocol handler. This blog entry details how to implement it. Basically, you need to:
Register the protocol you want (like chess://). You can do this directly in the Info.plist file - check out the blog entry for more info.
Handle the request. For this, accept the application: handleOpenURL: message in your application delegate.
Related
I have implemented deeplink for my ionic v1 application and also implemented universal link for same. I also checked so many links to implement App store redirection functionality.
Most of the link suggest to implement javascript code which first check device and based on ios/adnroid/window it will redirect to particular store but let say I will create that javascript code look like below
const iOS = !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform);
if (iOS) {
window.location.href = "temp://itunes.apple.com/us/app/...";
}
but where should I put this file so when user click on deeplink it should redirect to particular this file and redirect to App Store/Play Store?
Let say I want to give my deeplink to some other server for which i don't have any access then what?
is there any other param or attribute we can set like fallback url by which when app is not installed it will automatically going to that particular link?
Any answer would be great help.
Thanks.
Usually it works that way:
You place a link on the website where you want to advertise your app. That link has a click tracking domain that points to your server. e.g. click.example.com/....
Upon clicking, if the app is installed, Universal Links would ensure that the app is opened. This is done by iOS (only if you configured Universal Links correctly, see https://developer.apple.com/ios/universal-links/). If the app is not installed, a redirect is done to your click tracking domain. This is where your Javascript logics should apply, so basically you need to reply to the request with a 302 redirect to an HTML file that contains the redirection logics (as in the example above). In that server response you can handle any fallback URL you want to use.
By the way, to make Universal Links work, anyway you had to host the AASA file, so you probably already created a server, so you can use it for the case where the app is not installed.
Has anyone been able to successfully embed a custom url scheme in an SMS (for example someApp://), such that the iPhone upon receiving the SMS creates a clickable link to launch an app?
There are various questions similar to this out here, however, I have not seen a working solution.
Thanks
In general a custom URL scheme is the way to solve this problem. However, this is complicated by the fact that in iOS 5 (and up through iOS 5.1.1 based on my recent testing), Apple introduced a bug into their Messages app so that custom URLs received via SMS are not recognized as links.
See Custom URL scheme not recognized as link in SMS app(only in iphone 4 iOS 5.0)
You have to create URL scheme which starts with http, https or www.
but http:// and https:// will not work in URL scheme, so If you want create a click able link, you have to set your URL scheme with www.
For eg. www.myapp then the link which can open your app will be www.myapp:// but in this case only www.myapp will be click able and :// will not be click able.
For this use this format for URL scheme
www.<characters1>.<characters2>
www.my.app //example
Now use this format to open your app with click able URL:-
www.<characters1>.<characters2>://<anyThingYouWantToAppend>
www.my.app://open //example
www..:// is enough to open your app, but we are appending anyThingYouWantToAppend to create click able URL.
In my case on iOS 6, the link is not blue if sent from a custom sender ie text instead of a number. As soon as we started using a shortnumber as sender instead of a custom name, it was recognized as a link.
Assuming you have defined a custom url scheme as someApp:// you create a link in an SMS as follows:
"someApp://Myurl"
Don't know on how to ask this in another way, so here it goes!
This is what I want;
When you view the details of a contact, you have the option of direct calling the phonenumber, send an email or lookup someones address within the Maps App of the iPhone.
I am also creating an App which shows some detailed information about a location.
The information shown in the detailed view:
Phonenumber (when choosing this it needs to call the number)
Emailaddress (when choosing this it needs to open the emailapp)
Address (When choosing this it needs to open the default MapApp of the iPhone)
Do I achieve this with actions which are available (somewhere)? If so, can anyone point me in the right direction?
I would help me alot!
With kind regards,
Douwe
iOS uses url schemes to allow communication between apps. You'd need to implement openURL:"yourformattedurlhere" in your button clicks with a properly formed URL to send data to the appropriate app.
You can check Apple's URL Scheme Reference for the details on the formatting.
in titanium, i'm using the webview to display a wordpress blog page, that is already formatted for mobile browser. instead of writing my own interface, this works as a good work around. the apps sole focus isn't the browser.
but my issue lies, when the user clicks a link outside of the initial displayed domain. i only want the main domain to be displayed in the apps browser. if any other link is clicked, that takes the user outside of that domain, i want to have it open in the phones default browser.
can anyone point me in a direction for this. i tried adding a listener to try and catch link clicks, however, i've been unsuccessful.
thanks
in this blog posting I show how to find links in a webpage and change the link behavior. Using the same method, you can intercept the links and redirect to opening the URL in the devices default browser
One solution would be to catch the onclick() Event by Javascript inside the WebView (your blog code) and handle this by a custom handler. Maybe you can inject the javascript event handler code into the running WebView through Titanium.
Another solution is to make your blogposts readable for app technology and create a new data interface. This is the way I would do. For that I would use some kind of JSON data format and a simple REST Interface to get the data.
I don't think bove solutions are that simple. If you want an app with "great feeling", you'll have to handle the events by your own. Maybe Phonegap would be a better solution four your problem. But there you will still need a kind of REST/JSON interface for your blog data. The idea behind an app is, that the main code is in your app and you get the content from a remote source. This way you'll get an advantage compared to a simple browser optimized site.
I need a way to transfer a bunch of information (1-10kb) from an email in the Mail application to my iPhone app.
I was thinking I could craft a custom URL in the body of the email that, when clicked, would transfer the information through a custom URL handler to my app.
However, it's a lot of data. Can I pass that much data in the custom URL handler? e.g. myapp://load?var1=[lotsofdata]&var2=[lotsofdata]
Or, is there some better way I can transfer info from the Mail app to my app?
I don't know what the maximum length is, but I do know that you can have very long data-urls in Safari, which let you store image or other file data in the url itself. If the limits are similar, then you are in luck.
The usual limit for a GET should not be longer than 2083 characters to be on the safe side.
But also it should be a method to read the email directly from your own app, but I'm not very familiar with this solution.
Instead of a link in the email, you could probably just create a form that posts the information instead of sending a get request to your site; that would get around your length limitation (if there is one)
That last answer assumes you have a site to put the data on. If you're trying to keep things purely in email it would be nice to stick the data in the mail message. You can embed images in an email anyway, so why not?
Doing some research, I came across two blog posts that claim to have created large URLs that have worked, although one is using the data: URL scheme and the other is using mailto: .
Your best bet is to probably just try it out: Create a link using myapp:// with a large amount of data, stick it in an email and see if your app reads the entire thing.