Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fetch device information from a progressive web app

How to fetch device information (Google Advertising Id or IDFA) from a progressive web app

https://developers.google.com/web/progressive-web-apps/

like image 769
Rpj Avatar asked Aug 11 '16 07:08

Rpj


People also ask

Can Progressive Web Apps access the device hardware features?

A PWA can still work when the device is offline. PWAs can be installed on the operating system. PWAs support push notifications and periodic updates. PWAs can access hardware features.

Is Google Drive a progressive web app?

With Google moving from Chrome apps, Progressive Web Apps (PWAs) seem to be rapidly replacing them. YouTube Music, Google Maps, and Google Photos have all joined the ranks, and now Google Drive is on the list as well.

Is a progressive web app a mobile app?

Progressive Web Apps are something between a responsive website and a mobile app. They are mobile sites built with modern JavaScript frameworks, designed to work like a native app. They can be added to a mobile device's home screen with an icon. Like apps, they offer a full-screen experience to engage users.


1 Answers

Google Advertising ID is not accessible to progressive web app running in browser and so the installed PWA.

Said that, you can make it available to your installed PWA using an Android service(which is a native code getting the Google Advertising ID) and passing it to your PWA using Deep links, by setting a Indent filter to your PWA with a URL and have the ID retrieved in your native code passed to web app in the query para (URL).

You can refer to this java code to retrieve device identifiers and wrap it as a Android service, which calls your PWA using deep links.

like image 190
Anand Avatar answered Oct 17 '22 00:10

Anand