lavas-project / pwa-doc Goto Github PK
View Code? Open in Web Editor NEWLavas PWA documents
Home Page: https://lavas.baidu.com/doc
Lavas PWA documents
Home Page: https://lavas.baidu.com/doc
RT。
谢谢!
//使用 webpush.sendNotification 发起通知,报下面错误:
{ Error: read ECONNRESET
at exports._errnoException (util.js:1022:11)
at TLSWrap.onread (net.js:569:26) code: 'ECONNRESET', errno: 'ECONNRESET', syscall: 'read' }
开了翻墙,服务器为express,代码如下,为本地开发localhost访问环境,没有https,请问有办法处理吗?
//之前保存的pushSubscription
let pushSubscription = JSON.parse(fs.readFileSync('pushSubscription.txt'));
var body = '谢谢关注';
var iconUrl = 'http://localhost:8087/images/huiju.png';
webpush.sendNotification(pushSubscription,
JSON.stringify({
msg: body,
url: 'http://localhost:8087',
icon: iconUrl,
type: 'register'
}))
.then(result => {
console.log(result);
res.send({status:0,mes:"发送成功"});
})
.catch(err => {
console.log(err);
});
windowClients
对象并不能获取到。需要在clients.matchAll().then 的回调参数中使用。
https://lavas.baidu.com/pwa/engage-retain-users/notification/notification-pattern
启动画面 如何调试 速度太快了·
https://mp.weixin.qq.com/s/BiAYM-Ia5lYf0qv3DHmPjg
随着 iOS 11.3 的发布,iOS + PWA 的时代终于来了!本文对 iOS 中 PWA 的能力进行了分析,并将其与 iOS 上的 Native App、Android 上的 PWA 进行了深度对比,是值得收藏的一篇好文。
PWA天气链接不存在。
Uncaught (in promise) DOMException: Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.
天气 PWA,该链接已失效。提示【500 Internal Server Error】。
https://weatherpwa.baidu.com/ 该示例网站无法打开,是不是域名过期了?
function subscribe(serviceWorkerReg) {
serviceWorkerReg.pushManager.subscribe({ // 2. 订阅
userVisibleOnly: true,
applicationServerKey: urlBase64ToUint8Array('')
})
.then(function (subscription) {
// 3. 发送推送订阅对象到服务器,具体实现中发送请求到后端api
sendEndpointInSubscription(subscription);
})
.catch(function () {
if (Notification.permission === 'denied') {
// 用户拒绝了订阅请求
}
});
}
这段代码,为什么我怎么操作不都能执行到【 // 3. 发送推送订阅对象到服务器】这一步,求解,谢谢!
ios11.3版本已经支持,希望可以更新一下底部安卓真机debug
lavas官网教程中图片加载失败。
{"code":"NoSuchBucket","message":"The specified bucket does not exist.","requestId":"27da8d24-8c3d-401c-b8fb-d9347b2c49a0"}
related_applications的图标google官方文档要求是192x192,而不是144x144.见地址:https://developers.google.com/web/fundamentals/app-install-banners/?hl=en#native_app_install_banners
可以参照这边文章来搭建本地 https 服务。快速搭建本地 node https 服务
上面写的是Service Worker 安装成功后,install 事件被触发,但是接着下面ExtendableEvent.waitUntil() 方法——这会确保 Service Worker 不会在 waitUntil() 里面的代码执行完毕之前安装完成。
觉得这里有点矛盾啊,按理说是通过install注册回调函数,当install成功,也就是servece worker注册成功之后,才会执行回调,但是这里为什么写的是ExtendableEvent.waitUntil() 方法——这会确保 Service Worker 不会在 waitUntil() 里面的代码执行完毕之前安装完成呢?有些不解。
隐身窗口这样的名词,不太常用,最好多加解释一下;service worker安装这一块描述了安装步骤,最好讲解一下为什么这么做,有哪些其他api等等。会不明白这些操作都是在干什么,我还能做其他的事情吗。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.