iOS - Broken iMessage Link Sharing - ios

I am trying to share an URL via iMessage.The problem is when I sent it the URL breaks up into domains & remaining URL and some URL works properly
Link 1
https://www.americanexpress.com/india/mumbai/dmVyc2lvbj0xO3RpdGxlPUludmFsaWRlbnN0cmElQzMlOUZlKzExNDtsYXQ9NTIuNTMwNzQ7bG9uPTEzLjM4NDI2O3N0cmVldD1JbnZhbGlkZW5zdHJhJUMzJTlGZTtob3VzZT0xMTQ7Y2l0eT1CZXJsaW47cG9zdGFsQ29kZT0xMDExNTtjb3VudHJ5PURFVTtkaXN0cmljdD1NaXR0ZTtzdGF0ZUNvZGU9QmVybGluO2NvdW50eT1CZXJsaW47Y2F0ZWdvcnlJZD1idWlsZGluZztzb3VyY2VTeXN0ZW09aW50ZXJuYWw
Link 2
https://www.google.com/india/mumbai/search?q=stackoverflow
Screenshot
As you can see Link 1 breaks into 2, while link 2 is sent properly
Is the link preview broken or am I doing something wrong?

I was not able to find the reason or fix the issue but found a workaround to send links. Send the links in the following manner
<SOME_PREFIX>
In this way, the Link Preview doesn't work and the link can be shared without breaking the text
Eg:
Check this Amex Card:\n
https://www.americanexpress.com/india/mumbai/dmVyc2lvbj0xO3RpdGxlPUludmFsaWRlbnN0cmElQzMlOUZlKzExNDtsYXQ9NTIuNTMwNzQ7bG9uPTEzLjM4NDI2O3N0cmVldD1JbnZhbGlkZW5zdHJhJUMzJTlGZTtob3VzZT0xMTQ7Y2l0eT1CZXJsaW47cG9zdGFsQ29kZT0xMDExNTtjb3VudHJ5PURFVTtkaXN0cmljdD1NaXR0ZTtzdGF0ZUNvZGU9QmVybGluO2NvdW50eT1CZXJsaW47Y2F0ZWdvcnlJZD1idWlsZGluZztzb3VyY2VTeXN0ZW09aW50ZXJuYWw

Related

Deep linking in iOS 10 not working

I have an app that relies on deep linking using a custom scheme ://appName for some user email verification. The way it currently works is:
User enters email in app and hits send
Email is sent to user, user taps on "activate" button
Button opens valid website url which then redirects to deep link url, i.e ://appName/auth/tokenId
All was good, and this worked flawlessly on iOS 9 devices, but iOS 10 seemed to break it.
After further investigation:
appName://id=123 opens in iOS9, but in iOS10 safari displays that “the url can’t be shown” for the exact same URL.
They will both work however for the URL scheme alone (appName://)
You can even test this on your devices/simulator to see. Perhaps the change is in safari?
More investigation:
Almost sure its related to Safari.
Any ideas on how to resolve this?
Eventually tracked down this issue and got a response from the CEO of Branch. He said:
Ah interesting find! I just tested a few ways and it seems to reject
typed-in URI schemes with a deep link host & path, but you can still
trigger them in JS and click them on page. You just can't type it in
for some reason.
So beware of this if you are using deep linking in such a way on iOS 10!
I personally ended up just giving the direct deep link URL in the email, rather than embedding a redirect in a nice button. Something like this appName://gotoHere/here

Link to open up iOS app from facebook and twitter page and other ios app?

Hi I have a requirement in my app. From my ios Application(myapp),i share a link to facebook. Then I opened up my facebook account in browser or Facebook application and clicked the link, link should open in myapp if myapp is installed in the device otherwise link should open in browser. How can I achieve this ? Please suggest me step by step. Thanks in advance for your consideration and help.
I am not sure if this is possible. I have looked at various questions including
Is it possible to register a http+domain-based URL Scheme for iPhone apps, like YouTube and Maps?
as I am sure you might have already done but these questions target their own app, mainly web app, but you want that behavior to occur from an app that is not yours like twitter or facebook. But what you can do is show them two links on facebook/twitter, if they have installed press link 1 and if they want to install, press link 2 and you can pass parameters in link 1 as you might already know.
I will also keep checking answer of this question if some one comes and gives a better solution.
There is an option called custom URL scheme in iOS. It will help you to create a URL scheme which identifies your application. You can post link with this URL scheme and when you tap on this link on your iOS device it will open up your mobile app. Please see the link below to know how to setup this.
Custom URL Scheme in iOS
This is called 'deep URL linking'. Facebook have built a service called 'App Links', which seems pretty cool.
https://developers.facebook.com/docs/ios/app-links

Post link to Facebook including app URL scheme - iOS 6

I'm using the UIActivityViewController to share an image and url from within my app.
I'm having trouble formatting the facebook post. I attach an image using a subclassed UIActivityItemProvider and provide the text for the post in the same way.
I want to add a url, but it needs my apps custom url scheme in front of it like this
myurl://image?url=http://imageurl.com
The problem is, when this is posted, only the last half of the url is clickable (from http:// onwards). Which means it doesn't open my app with the url.
Is there another way to do this?
I know I can create an app on Facebook, but how can I tie the two together using the UIActivityViewController?
Thanks
You have 2 options :
Create a simple server-side web service that will redirect from http://yourserver.com/linkToApp/image to myurl://image .
It could even show a different page/preview if the app is not installed/if you're not on an ios device.
Create a facebook app and use "Deep linking" (it will basically do the same for you..)

custom URL Scheme in iOS 6 not working?

My app uses a custom URL scheme so i send a link to my users in an email which when clicked, launches my app installed on their devices. This was working seamlessly till iOS 6 came into picture.
Now when the users click on the link or even type the address manually in the safari they get an error saying "Safari cannot open the page because it is a local file."
Wondering if anyone else encountered the same or if someone has any pointers in this regard !!
Any help much appreciated...
Update: it works if I only give my app's custom url without any parameters.. e.g. if I do "reader-app://" it launches my app but if i do "reader-app://doc=xyz" it doesn't !
try: reader-app://?doc=xyz (add a question mark after //) this way you'll specify a query string. It works for me, but it presents an alertdialog asking the user if she wants to open the url with my application
Try to remove the - sign from reader-app://.
My URL was not working until I removed underscore sings from URL.
Ex:
my_app:// is not working.
myapp:// is working.
That is just a guess.

TWTweetComposeViewController doesn't show link preview

When I add a link to a tweet in the TWTweetComposeViewController, I see the link attached correctly:
But unlike when I do so in Safari, the link doesn't show a preview of the URL like Safari (or Youtube) does:
Do you know if it's a hidden feature or if it depends on the Link added to the tweet?
Thank you!
This has been my experience as well, if you attach a URL the TWTweetComposeViewController will not automatically add a preview image.
I was curious so I took a look at the private runtime headers for Twitter.framework and I found a few interesting methods, including - (BOOL)addURL:(id)arg1 withPreviewImage:(id)arg2;. Using this in my app I found it worked exactly as expected, the tweet view showed a link along with the image I included. Unfortunately this doesn't help too much, since it's a private method your app will almost certainly be rejected if you try to use it in the App Store.

Resources