Facebook AppLinks/Deeplinks (fb.me links) in messenger do not redirect to specific product in app or play store (when user does not have the app installed)
I am sure , many of us encountered this issue, and due to security issues in messenger in-app browser the user experience is not nice to go out of messenger window to an external browser.
So how to make sure that the FB app links work ? Well, below is a legal hack to do it.
As usual with other blogs , I will categorize the business case and the solution
Business case :
You want give a user experience via FB messenger and a deeplink (fb.me links) to buy a specific product on your app or to download your mobile app (in case user clicks and doesn't have the app installed) . You do not have a web-hosting ( or a website ) or you do not want to host the deeplinks on your web-hosting and want to use FB Mobile Hosting instead.
User experience:
When user clicks the deeplink, he is not able to open the product inside the app, gets page not found and if he does not have your app, he is not re-directed to Google playstore, so he does not have a good user experience.
Pre-requisite :
1. You know how to create FB app links. the steps are very clearly mentioned on FB here https://developers.facebook.com/docs/applinks/hosting-api ( this needs you to create FB app in process, and you will have a FB App Id during this process, or you can use existing FB app)
2. You have already added the deep-link scheme in the activity (either welcome or any other main activity) in the manifest file of your mobile app code.
Solution: In short the solution is the introduce a PhP file in between and launch the product or redirect to playstore using PhP and the client side invocation of the activity.
How to do it?
1. When you make the deeplinks for the products , make sure you follow a generic standard and modify something in the suffix of the URL e.g. abc://productid=1234, abc://productid=4567.
So the variable is the number, 1234 or 4567 etc. The pattern before that is fixed i.e. abc://productid=
2. Once this convention is followed and you did the changes in your mobile app activity in manifest file. Make a php file (lets say documentation.php and you hosted it on free hosting like novare.com) and note all important info for this file.
So how to make sure that the FB app links work ? Well, below is a legal hack to do it.
As usual with other blogs , I will categorize the business case and the solution
Business case :
You want give a user experience via FB messenger and a deeplink (fb.me links) to buy a specific product on your app or to download your mobile app (in case user clicks and doesn't have the app installed) . You do not have a web-hosting ( or a website ) or you do not want to host the deeplinks on your web-hosting and want to use FB Mobile Hosting instead.
User experience:
When user clicks the deeplink, he is not able to open the product inside the app, gets page not found and if he does not have your app, he is not re-directed to Google playstore, so he does not have a good user experience.
Pre-requisite :
1. You know how to create FB app links. the steps are very clearly mentioned on FB here https://developers.facebook.com/docs/applinks/hosting-api ( this needs you to create FB app in process, and you will have a FB App Id during this process, or you can use existing FB app)
2. You have already added the deep-link scheme in the activity (either welcome or any other main activity) in the manifest file of your mobile app code.
Solution: In short the solution is the introduce a PhP file in between and launch the product or redirect to playstore using PhP and the client side invocation of the activity.
How to do it?
1. When you make the deeplinks for the products , make sure you follow a generic standard and modify something in the suffix of the URL e.g. abc://productid=1234, abc://productid=4567.
So the variable is the number, 1234 or 4567 etc. The pattern before that is fixed i.e. abc://productid=
2. Once this convention is followed and you did the changes in your mobile app activity in manifest file. Make a php file (lets say documentation.php and you hosted it on free hosting like novare.com) and note all important info for this file.
- andriodurl - this will be the scheme e.g. abc/productid=
- andriod class - the main activity path
- andriod package - your app package
- fb app id - your fb app id
The code for php file will look as below in the figure.
Do all inside <html><body> tags
3. While creating FB links choose this field to map scheme as below. This is the hack to link the PhP file you hosted and to redirect to correct link. On the window while creating FB app links wizard, use the below
Thats it, Hope you liked it and you will resolve the issue !
Comments
Post a Comment