Vite and React: A Speedy Duo for Modern Web Development
Introduction: The Need for Speed in Web Development In the fast-paced world of web development, speed and efficiency are paramount. To meet these demands, we
This blog discusses the approach and solution to open specific content in an app by scanning a QR code. The following examples give use cases of opening specific content in the app
Example 01:
There is a science text book and the same publisher also has an android app that has all the related information and much more. In a particular chapter of the book, there is a QR code. When this QR code is scanned, it should open the app and take the user to the related chapter content on the app.
Example 02:
An app vendor has a website to promote the app. In the google search results, when someone searches for a relevant keyword and comes to the website, easy access has to be given to the relevant content in the app. The use case can be that the user clicks on a link in the mobile or scans a QR code on the website and has to be taken to some specific page in the app.
We can make use of the firebase dynamic links feature to achieve this.
With Dynamic Links, you can seamlessly transition users from your mobile website to the equivalent content within your app. And because the links survive the app install process, even new users can pick up where they left off on your mobile site without missing a beat.
Deep links let you redirect users to a specific destination inside your app which provides a better user experience.
A deep link is a URL that navigates to a specific destination in your app. When you click a deep link, Android:
Consider the deep link https://www.aksharaontech.com/test/code=abcd. It has the following parts:
To add deep link & use of this feature we have to add dynamic link support to the app.
You may want to check out the blog link below to add dynamic link support to the app and the setup process.
If you are done with setup, add intent filters in the android manifest file.
you must add a new intent filter to the activity that handles deep links for your app.
<intent-filter>
<action android:name=”android.intent.action.VIEW”/>
<category android:name=”android.intent.category.DEFAULT”/>
<category android:name=”android.intent.category.BROWSABLE”/>
<data
android:host=”example.com”
android:scheme=”https”/>
</intent-filter>
The intent filter is required for your app to receive the Dynamic Link data after it is installed/updated from the Play Store and one taps on the Continue button. The intent filter catches deep links of your domain, since the Dynamic Link will redirect to your domain if your app is installed.
When users open a Dynamic Link with a deep link to the scheme and host you specify, your app will start the activity with this intent filter to handle the link.
To receive the deep link, call the getDynamicLink() method:
FirebaseDynamicLinks.getInstance()
.getDynamicLink(getIntent())
.addOnSuccessListener(this, new OnSuccessListener() {
@Override
public void onSuccess(PendingDynamicLinkData pendingDynamicLinkData) {
// Get deep link from result (may be null if no link is found)
Uri deepLink = null;
if (pendingDynamicLinkData != null) {
deepLink = pendingDynamicLinkData.getLink();
}
// Handle the deep link. For example, open the linked
// content.
}
})
.addOnFailureListener(this, new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Log.w(TAG, “getDynamicLink:onFailure”, e);
}
});
You must call getDynamicLink() in every activity that might be launched by the link, even though the link might be available from the intent using getIntent().getData(). Calling getDynamicLink() retrieves the link and clears that data so it is only processed once by your app.
You normally call getDynamicLink() in the main activity as well as any activities launched by intent filters that match the link.
Here in the above deep link url we are passing host and required parameters separated with ampersand to access a particular content directly without being following the normal app flow.
We will parse the host-aksharaontech.com and different parameters which we can use to do appropriate action(In this case we can use courseid, chapterid, subchapterid, contenttype and contentid and open the particular content on the launch of the app) inside the app.
After accessing the deep link URL(created earlier while creating dynamic links using firebase console) on launch of app you can parse the URL so you can get your required parameters from it and can use your own execution to open the linked content.
This solution is based on firebase dynamic links feature and can be used in multiple user scenarios and cases. The capability to open specific content in the app improves the user experience in terms of improved efficiency to reach the desired content. In Techpearl, we got enhanced user experience results and better customer satisfaction by applying the above solution.
Introduction: The Need for Speed in Web Development In the fast-paced world of web development, speed and efficiency are paramount. To meet these demands, we
Introduction The power of conversational AI has become a transformational force in a world where technology continues to alter how people live, work, and communicate.
Introduction In the ever-evolving landscape of web development, the concept of reusability has become a cornerstone for efficiency and productivity. Web components have emerged as
Copyrights © 2024 All Rights Reserved by Techpearl Software Pvt Ltd.
Cookie | Duration | Description |
---|---|---|
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |