How to use Inner Linking in Mobile Applications

Mobterest Studio
4 min readMar 19, 2023

--

How to use Inner Linking on Mobile Applications

Inline linking is a design pattern that allows developers to include links within the text content of a mobile application.

There are several reasons why you may want to use inline links in mobile apps:

  1. Improved navigation: Inline links allow users to quickly and easily navigate to related content within an app or to external websites. By providing links within the text content, developers can guide users to relevant sections of the app and create a more intuitive navigation experience.
  2. Increased efficiency: By including links within the text content, users can quickly access relevant content within the app without having to manually search for it. This can save users time and increase the overall efficiency of the app.
  3. Enhanced user engagement: Inline links can help to increase user engagement within an app. By providing links to related content, users are more likely to explore different sections of the app and spend more time interacting with it. This can lead to a more engaging and immersive user experience, which can improve retention rates and drive business growth.
  4. Streamlined user experience: Inline links can help to create a more seamless and efficient user experience. By eliminating the need for users to switch between different pages or screens to access related content, developers can create a more streamlined user experience, which can enhance overall user satisfaction and retention rates.
  5. Improved accessibility: Inline links can also make content more accessible for users with disabilities, such as those who use screen readers or other assistive technologies. By including descriptive link text, developers can ensure that all users are able to understand the context and purpose of each link.

This is how Instagram uses inner links:

  1. Hashtags: When users add hashtags to their posts or search for hashtags within the app, Instagram creates clickable inline links that allow users to quickly navigate to related content within the app. This allows users to explore different topics and discover new content within the Instagram community.
  2. Usernames: When users mention other users in their posts or comments, Instagram creates clickable inline links to those users’ profiles. This allows users to quickly view other users’ content and engage with them within the app.
  3. Links in bios: Instagram allows users to add a clickable link to their profile bio. This allows users to easily navigate to external websites or to related content within the app.
  4. Sponsored posts: When users view sponsored posts within the app, Instagram creates clickable inline links to the advertiser’s website or to related content within the app. This allows advertisers to drive traffic to their website or to promote their products within the Instagram community.

Let’s explore how to use inner linking in the different mobile frameworks, libraries and languages.

In Kotlin

  1. First, create a TextView in your layout XML file:
<TextView
android:id="@+id/link_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Visit https://www.google.com for more information" />

2. Next, use the Linkify class to automatically detect and link URLs in the text:

val linkText: TextView = findViewById(R.id.link_text)

Linkify.addLinks(linkText, Linkify.WEB_URLS)

In React Native

  1. Import the Linking API
import { Linking } from 'react-native';

2. Create a Text component

<Text style={styles.linkText} onPress={() => Linking.openURL('https://www.google.com')}>
Click here to visit Google
</Text>

In Ionic Framework

  1. First, create an ion-text andion-anchor components
<ion-text>
Click <ion-anchor href="https://www.google.com">here</ion-anchor> to visit Google.
</ion-text>

2. Customise the appearance

ion-anchor {
color: blue;
text-decoration: underline;
}

In Swift iOS

  1. Create a UILabel component in your code
let label = UILabel(frame: CGRect(x: 0, y: 0, width: 200, height: 100))
label.numberOfLines = 0
view.addSubview(label)

2. Create an attributed string with a hyperlink using the NSAttributedString class

let attributedString = NSMutableAttributedString(string: "Click here to visit Google")
let range = NSRange(location: 0, length: attributedString.length)
attributedString.addAttribute(.link, value: "https://www.google.com", range: range)
label.attributedText = attributedString

3. Finally handle the hyperlink when the user taps on it.

let tapGesture = UITapGestureRecognizer(target: self, action: #selector(handleTap(_:)))
label.addGestureRecognizer(tapGesture)

In Flutter

  1. Import the flutter_linkify package and the url_launcher package
import 'package:flutter_linkify/flutter_linkify.dart';
import 'package:url_launcher/url_launcher.dart';

2. Use the Linkify widget to wrap your text

Linkify(
onOpen: (link) async {
if (await canLaunch(link.url)) {
await launch(link.url);
} else {
throw 'Could not launch ${link.url}';
}
},
text: 'Click here to visit Google: https://www.google.com',
)

In conclusion, inline linking is a powerful design pattern that can enhance the user experience in mobile applications. By allowing users to access external resources without interrupting their workflow, inline links can help increase engagement and improve overall satisfaction.

In this article, we’ve provided step-by-step guides for implementing inline links in different mobile development frameworks, including Kotlin, React Native, Ionic, Swift, and Flutter.

We hope this article has provided you with a solid understanding of the benefits and implementation of inline links in mobile applications. Stay tuned for more informative articles on mobile app development best practices.

Don’t forget to follow for more updates and tips on mobile app development.

--

--

No responses yet