John Davidson

php - How to hide the address bar in android app using trusted web activity

0 comments
Message:


I have tried to convert codeigniter application into android app using trusted web activity .I have generated debug and release APK .I cannot hide address bar in app. I have put assetlinks.json file in .well known folder of application . It is not working .


This is my assetlinks.json


    [{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.consultantnext.dmatri",
"sha256_cert_fingerprints":
["37:A8:DB:2C:EC:43:65:A9:3C:2A:60:88:16:8A:7A:07:BA:59:A7:7C:63:8C:57:4E:E2:52:40:46:DA:0E:65:AE"]
}
},
{
"relation": ["delegate_permission/common.get_login_creds"],
"target": {
"namespace": "web",
"site": "https://dmatri.consultantnext.com"
}
},
{
"relation": ["delegate_permission/common.get_login_creds"],
"target": {
"namespace": "android_app",
"package_name": "com.consultantnext.dmatri",
"sha256_cert_fingerprints":
["37:A8:DB:2C:EC:43:65:A9:3C:2A:60:88:16:8A:7A:07:BA:59:A7:7C:63:8C:57:4E:E2:52:40:46:DA:0E:65:AE"]
}
}]

I need to hide the address bar before uploading it into playstore. How to hide the address bar?



My Answer:
To hide the address bar in an Android app using Trusted Web Activity, you can add the following meta tag in the head section of your HTML file:

html



This will set the background color of the address bar to black, effectively hiding it. Make sure to replace `#000000` with the desired color code.

Additionally, make sure that your assetlinks.json file is correctly configured and placed in the .well-known folder of your web server. The assetlinks.json file should contain the necessary information for the Android app to establish a trusted relationship with your website.

After making these changes, rebuild your APK and test it to see if the address bar is now hidden. If everything is set up correctly, the address bar should be hidden when the app is launched.

Rate this post

3 of 5 based on 9779 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us