This is Angular application which handle exchange link routing for (Microblink API UI component (microblink-js))[https://github.com/microblink/microblink-js].
This application should be opened at smartphone when desktop-to-mobile feature is requested by user at desktop in microblink-js
.
- Create two (
production
andstaging/dev
) Firebase projects at your Google account
2 .Change credentials at files:
./apps/public/scan-client/src/environments/environment.prod.ts
./apps/public/scan-client/src/environments/environment.staging.ts
./apps/public/scan-client/src/environments/environment.ts
Configure Firebase hosting with your custom domain where this single-page application will be deployed.
https://console.firebase.google.com/u/0/project/<FIREBASE_PROJECT_ID>/hosting/main
For shorting generated exchange URL it is recommended to use Firebase Dynamic Links
.
https://console.firebase.google.com/u/0/project/<FIREBASE_PROJECT_ID>/durablelinks
URL which should be shortened is https://<CUSTOM_DOMAIN>/scans/<SCAN_ID>?key<SECRET_ENCRYPTION_KEY>
This short URL will be also generated in microblink-js
in QR code.
Public API key for your Firebase project
firebase functions:config:set applinks.key="<FIREBASE_PROJECT_KEY>"
Prefix of your application where Angular APP ./apps/public/scan-client
will be deployed + /scans
route where scan-page.component
will handle exchange link.
firebase functions:config:set applinks.redirect_url_prefix="https://scan.microblink.com/scans"
Add Firebase Dynamic links domain at: https://console.firebase.google.com/u/0/project/<FIREBASE_PROJECT_ID>/durablelinks
firebase functions:config:set applinks.link="https://mbe.page.link/"
To take effect of ENV variables change deploy Firebase functions
firebase use <FIREBASE_PROJECT_ID>
firebase deploy --only functions
- Edit
./deploy.sh
with your<FIREBASE_PROJECT_IDs>
- Run deploy script
SKIP_FUNCTIONS=true ./deploy production