NetTalk Central

Author Topic: NTWS 12.63-App shortcut in mobile's home screen  (Read 2610 times)

hectorp

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
NTWS 12.63-App shortcut in mobile's home screen
« on: January 12, 2024, 05:39:52 AM »
I like to give my app the ability to place a shortcut in the mobile's home screen of who ever access it through the browser.

Just for the very first time the app is accessed or if the shortcut does not exists in the mobile's home screen.

Is such a feature available or doable?

If yes, how can it be done?

TIA

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NTWS 12.63-App shortcut in mobile's home screen
« Reply #1 on: January 14, 2024, 10:36:49 PM »
Both iOS and Android allow you to "pin" a web site as an app. As long as a manifest.json, serviceworker.js and so on long exist.
The creation of these is part of NetTalk Apps. Which Level of NetTalk are you using?

Poul Jensen

  • Full Member
  • ***
  • Posts: 191
    • View Profile
    • Email
Re: NTWS 12.63-App shortcut in mobile's home screen
« Reply #2 on: January 14, 2024, 11:27:56 PM »
Hi,

It can be done manually.

1) Go to a site like this and create your icon images:  https://realfavicongenerator.net/
2) In the app, Webhandler, SetCustomHTMLHeaders you place this:

Code: [Select]
self.MetaHeaders = '  ' & |
    '<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">' & |
    '<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">' & |
    '<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">' & |
    '<link rel="manifest" href="/site.webmanifest">' & |
    '<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">' & |
    '<meta name="msapplication-TileColor" content="#da532c">' & |
    '<meta name="theme-color" content="#ffffff">'

3) Distribute the created icon images and files in the web folder.
4) The user then opens your app, and creates the shortcut from the menu, Add to home Screen:

/Poul




hectorp

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
Re: NTWS 12.63-App shortcut in mobile's home screen
« Reply #3 on: January 18, 2024, 01:21:51 PM »
Hi Bruce,

Web App Server.
« Last Edit: January 18, 2024, 07:49:04 PM by hectorp »