How to make my iOS application handle web links - iphone

I have to make my application handel web like (juste like a web browser).
I add CFBundleURLTypes to my plist file and then in CFBundleURLSchemes I put http and CFBundleURLName com.mydomaine.myapp.
Then I tried to send a SMS with a web link : It's stil open Safari when I clicked the received link !
This work great with a custom schema : myapp://mylink.com ! but the problem is : I have to send SMS with links to my app users and then they can click those links and open myapp who do stuff flowing links contente ! the Message app dont recognize cutome url schema as a clickable link ! So the only solution I found is to make this operation using http link !
(I know that my problem can be solved using APN! but for some reasons I cant use it !)
Thank you for your help !

You can't override http links to redirect to your app; that would break a lot of other pieces of the system.
You should send them a http link which goes to a server you set up. That server can then redirect the users to your custom link scheme, or offer to let them download the app, etc.

Related

App Store/Play Store redirection if App is not installed on ionic App

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.

flex mobile project : send emails

I want to send email that contains form as a body from my mobile app. I am searching in internet , but I am able to find help only for desktop or web applications. I came to know that I can use "mailto" protocol,but I dont know how can I use it for mobile project.
Please help me with some examples or tutorials.
This works the same as it does inside a regular flex application. In your send method add something like this:
var urlRequest:URLRequest = new URLRequest("mailto:youremailhere#yourdomain.com");
navigateToURL(urlRequest);
I did notice that the mailto is case sensitive (mailTo worked in the emulator but not on the device, so make sure that it is "mailto"

HTTPS url in UIWebview is not working in iphone / ipad

Im new to iphone development . trying to make sample browser application where i have used HTTPS url in UIWebview is not working in iphone / ipad.(https.example.com).
when im tried in safari i gave me the following error message :
""CAN NOT VERIFY SERVER IDENTITY - SAFARI CANT VERIFY THE IDENTITY WOULD YOU LIKE TO CONTINUE ANY WAY"".. when i pressed continue.it was working
but in my browser app its not working can any one help me in this.
Thanks in advance
As far as I know, you need to download the web page manually and use loadData:MIMEType:textEncodingName:baseURL: - there's no way to adjust the trust settings of a UIWebView's internal requests.
I'm not sure how this will work for any https resources (images, css, etc) on the same domain though. Hopefully it will work fine.

Custom URL scheme embedded in an SMS on iPhone

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"

titanium webview - go to default browser when clicking links

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.