Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for issue #4 feat: add PWA support, service-worker, masked icon #109

Merged
merged 1 commit into from Oct 2, 2022

Conversation

theonly1me
Copy link
Contributor

Fix for Issue #4 : add PWA support, service-worker, masked icon

Description

  • Update manifest to include masked icon for iOS and Android
  • Update index.html to add manifest
  • Add service-worker, using a Network First StaleWhileRevalidate policy
  • Add serviceWorkerRegistration helper to register service-worker in 'prod' environment

Related Issue
Fix #4

@bjarneo the Hemmelig.app can now be used as a PWA, here are the details of the functionality that has been added:

  • Users will be able to see cached app in case of network connectivity failure
  • The Add to home screen prompt appears on Android devices (screenshot below from my testing)
  • Unfortunately, iPhones do not allow a prompt since Apple has restricted that behavior. However, users will still be able to click the Share button on 'Safari' and click add to Home Screen to add the PWA to their home screen.
  • Since the service-worker only kicks in in the production environment, I have deployed the UI on netlify at https://pwa.atchyut.dev and enabled SSL so that it can be tested via mobile devices and tablets. (Please Note: I will be deleting this deployment from Netlify once you test it from your end and are good with the functionality)

Add to Home Screen Prompt on Android:
WhatsApp Image 2022-10-02 at 9 00 13 PM

add PWA support by adding a service-worker and serviceWorkerRegistration helper. Update manifest, index.html
@sonarcloud
Copy link

sonarcloud bot commented Oct 2, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@theonly1me
Copy link
Contributor Author

@bjarneo Oh and the Sign In button gets hidden behind the Sign Up button on mobile devices. I've seen this happen on iPhone 12 Mini, iPhone SE 2020 and Samsung Galaxy s9. So that probably needs fixing too 😄

Copy link
Member

@bjarneo bjarneo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but I have a few questions :)

public/robots.txt Show resolved Hide resolved
src/service-worker.js Show resolved Hide resolved
src/serviceWorkerRegistration.js Show resolved Hide resolved
@bjarneo
Copy link
Member

bjarneo commented Oct 2, 2022

@bjarneo Oh and the Sign In button gets hidden behind the Sign Up button on mobile devices. I've seen this happen on iPhone 12 Mini, iPhone SE 2020 and Samsung Galaxy s9. So that probably needs fixing too 😄

You are correct. Here is an issue for this :) #105

Thanks for this PR!

Copy link
Member

@bjarneo bjarneo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's go!

@bjarneo bjarneo merged commit 0ed74ae into HemmeligOrg:main Oct 2, 2022
@bjarneo
Copy link
Member

bjarneo commented Oct 3, 2022

Updated the PR with hacktoberfest-accepted, @theonly1me

@theonly1me
Copy link
Contributor Author

thanks a lot @bjarneo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PWA install prompt
2 participants