如何从渐进式 Web 应用程序中获取设备信息 [英] How to fetch device information from a progressive web app

查看:49
本文介绍了如何从渐进式 Web 应用程序中获取设备信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从渐进式网络应用中获取设备信息(Google 广告 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 无法访问浏览器中运行的渐进式网络应用程序,因此安装的 PWA.

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

也就是说,您可以使用 Android 服务(这是获取 Google 广告 ID 的本机代码)将其提供给已安装的 PWA 并将其传递给您的 PWA 使用深层链接s,通过使用 URL 和 PWA 设置缩进过滤器将在您的本机代码中检索到的 ID 传递给查询段 (URL) 中的网络应用.

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 代码 来检索设备标识符并将其包装为 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.

这篇关于如何从渐进式 Web 应用程序中获取设备信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆