Sharing iOS custom url links - ios

I have a Mobile App with a custom url scheme registered. The App also has social sharing enabled to allow users to share deep links within the App on Facebook, Twitter and email.
My question related to this is how to handle situations cleanly where this custom iOS url is opened on a non-ios device like a PC or a Android device.

Detect the device and change the URL scheme based on that device. If you're using HTML you can use a jQuery plugin. See this link: What is the best way to detect a mobile device in jQuery?

Related

Create iOS app store links for social media and messaging? Error: Safari cannot open the page because the address is invalid

This answer is similar but doesn't address how to create links that can be shared and opened via iMessage, email, or social media.
The Apple documentation suggests URLs of the format http://appstore.com/companyname (e.g., http://appstore.com/gameloft) if the goal is to list all apps by a company.
However, opening links like this generate an error in Safari, specifically that
Safari cannot open the page because the address is invalid
1) What iOS App Store URL format will display all the apps from a company, and works from both mobile iOS and desktop?
2) What iOS App Store URL format will display a single app, and works from both mobile iOS and desktop?
The easiest way for creating links to iTunes content is to use the iTunes Link Maker, https://linkmaker.itunes.apple.com/.
You can select your country and the content type, e.g. app, music, etc, and search for the content you want, and then you will recieve valid links for different purposes...
But you can generate only links to content, not to a company
Make sure you're not testing on the OS Simulator because it doesn't come with an app store, so your links will return invalid. Instead, try testing the links on an actual iOS device.

Firebase dynamic links does not work on iOS gmail

I have setup a firebase dynamic link like explained here https://www.youtube.com/watch?v=sFPo296OQqk
When I tap on my dynamic link via Notes app, it opens my app as expected.
But when I tap on the dynamic link via gmail app on iOS - it just open the Chrome Browser on iOS and redirects me to the fallback web URL. It does not open the app.
Any help is appreciated.
I believe the iOS Gmail app allows you to select whether links will open in Chrome or Safari. When Chrome is selected, Universal Links (which is what Firebase dynamic links piggyback on) do not work. You'll need to somehow open a web page with the link and then present a button for users to click that will open your app. At Branch.io, we use our deepviews feature for this.
For more info, see this list of apps that support Universal Links.
You should follow the below link.This will definitely fulfill your query.
Firebase dynamic link doesnt work in safari swift

Opening an app from URL schema

This may sounds crazy but just curious to know how a deep link/ URL schema reaches to an app to open it up in the device. Searched for an article but all contain how to make it work technically which I completely experienced, but could not find one how the handshake works.
If anybody can share if known, much appreciated!
Thanks.
The best information I could find so far on the subject is Wikipedia:
Unlike the Web, where the underlying technology of HTTP and URLs allow
for deep linking by default, enabling deep linking on mobile apps
requires these apps be configured to properly handle a uniform
resource identifier (URI). Just like a URL is an address for a
website, a URI is the address for an app on a mobile device. Examples
of URIs that launch a mobile app:
twitter:// is the iOS URI to launch Twitter’s mobile app
YouTube:// is
the iOS URI to launch YouTube’s mobile app
The format of the URI used
to trigger or deep link an app is often different depending on the
mobile operating system. Android devices work through intents,
BlackBerry 10 devices works through BB10's invocation framework,
Firefox OS devices works through Web Activities, iOS devices works
through the openUrl application method, and Windows Phone 8 devices
works through the UriMapper class.
fb://profile/33138223345 is an example of a mobile deep link. The URI
contains all the information needed to launch directly into a
particular location within an app, in this case the profile with id
'33138223345', i.e. the Wikipedia page, within the Facebook app,
instead of simply launching the Facebook app fb://. eBay's apps
demonstrate the use of different schemes by platform.
eBay://launch?itm=360703170135 is the URI that deep links into eBay’s
iOS app while eBay://item/view?id=360703170135 links into eBay’s
Android app
Basically the URL matching starts at the OS level.
iOS will use the settings in your apps plist file for a whole bunch of other things outside the app. One of them being the deep linking.
You declare your URL scheme in the plist, and whenever the OS encounters a URL matching this scheme (usually when user taps a button or link), it will open your app and pass the URL information on. It's then your responsibility to determine what to do with this information.
Does it jump into a profile page? A particular product? That's all left up to you.

Display all the apps that support sending messages (Chatting)

I want display all the apps in my app that support chatting. Actually I need to send the selected text via message applications (i.e., WhatsApp, WeChat, etc..) those are installed in my iOS device.
I have gone through UIDocumentInteractionController but it allow to share files only. But here in my case I want to share just text.
Is this possible. Please help me out, thanks.
iOS does not have a single option for sharing text, the UIActivityViewController can be used and will show the iOS integrated social networks.
You will be able to add you own service to this dialog, as long a the app has a URL scheme to support its.
A example of a Whatsapp UIActivity: https://github.com/jberlana/JBWhatsAppActivity
If you know the URL schemes (if the chatting app provides one) of the app, you can check if a app exists or not using -canOpenURL: of UIApplication class. If they support url schemes, you can send text in the format that those app supports.

How to publish link from iOS app to Facebook app with custom URL scheme?

I am creating an iOS app (using Adobe AIR) and I want to put a share button to my game that will allow the player to share a link to my game. I can do it with Graph API using my app's token, but I don't want a story published by my app. I want the native Facebook app to open and bring a share dialog. All my research concluded me to use the custom URL scheme such as fb://publish/?text=my_text but I couldn't get it working. I tried typing exactly that in Safari, it brings the native Facebook app, but no publish dialog or anything. All the sources online tells this, but it is not working. What could I be possibly doing wrong?

Resources