如何从渐进式Web应用程序中获取设备信息

问题描述:

如何从渐进式网络应用中获取设备信息(Google Advertising ID或IDFA)

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

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

Google广告ID无法访问

说,您可以使用Android服务(获取Google广告ID的本机代码)将其提供给已安装的PWA并将其传递给您的使用深层链接的PWA ,通过使用URL为您的PWA设置缩进过滤器,并将您的本机代码中检索到的ID传递给查询段(URL)中的Web应用程序。

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).

您可以参考到这个 java code 检索设备标识符并将其包装为Android服务,该服务使用深层链接调用您的PWA。

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.