how to close guides?How to not display the guidance process for the second time?
FairyWorld opened this issue · 1 comments
FairyWorld commented
how to close guides?How to not display the guidance process for the second time?
philfung commented
hi @FairyWorld .
how to close guides
- Set flag allowUserToCloseModal to true.
- The user can then click outside of the modal (ie in the black region) to close the modal.
Please note that (from experience), allowing the user to close the modal will decrease the home screen installation rate.
How to not display the guidance process for the second time?
Ive just added a new flag maxModalDisplayCount . you can set this to 1 to show the modal at most once, 2 to show the modal at most 2 times, etc
Note again that this will decrease the home screen installation rate.
document.addEventListener('DOMContentLoaded', function () {
window.AddToHomeScreenInstance = new window.AddToHomeScreen(
{
appName: 'Aardvark', // Name of the app
appIcon: 'apple-touch-icon.png', // App icon link (square, at least 40 x 40 pixels)
assetUrl: 'https://cdn.jsdelivr.net/gh/philfung/add-to-homescreen@1.4/dist/assets/img/', // Link to directory of library image assets
showErrorMessageForUnsupportedBrowsers: true, // Should we prompt users on non-compliant browsers (like IOS Firefox) to switch to compliant one (like Safari) Default: true.
allowUserToCloseModal: true, // Allow user to close the 'Add to Homescreen' message? Not allowing will increase installs. Default: false.
maxModalDisplayCount: 1 // If set, the modal will only show this many times.
// Default is -1 (no limit). (Debugging: Use this.clearModalDisplayCount() to reset the count)
}
);
ret = window.AddToHomeScreenInstance.show(); // show "add-to-homescreen" instructions to user, or do nothing if already added to homescreen
});
Thank you.