如何使用vue js在android/ios中设置推送通知? [英] How to set push notifications in android/ios with vue js?

查看:233
本文介绍了如何使用vue js在android/ios中设置推送通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试设置firebase-cloud-messaging以向用户显示通知.使用Web通知,一切都会按预期进行.

I am trying to set up the firebase-cloud-messaging to display notifications to users. Using the web notification, everything works as intended.

但是,我也想通过应用程序发送它们,但是应用程序尚不能识别服务人员.

However, I also want to send them via app, but apps don't recognize service-workers yet.

我不能把头缠住它.如何使用vue.js android/ios应用程序接收推送通知?我应该使用插件吗?如果是的话,哪个插件?当前正在使用quasar,Vue.js,FCM.

I couldn't wrap my head around it. How to use vue.js android/ios apps to receive push notifications? Should I use plugins? If yes, which plugins? Currently using quasar, Vue.js, FCM.

推荐答案

实际上,您可以通过PWA的vue cli设置将推送通知发送到Web和Android,即开即用-iOS是像PWA一样作用于PWA的唯一保留方法他们的设备.因此,仅对于iOS,您需要在Apple上创建一个开发人员帐户,并支付99美元/年的价格,再加上所有购买收入的20%或30%...尽管有可能 围绕这个问题,但是我认为差距已经通过苹果公司最近的TOS更新而得到了弥补.有关更多信息,请参见iOS上本机应用程序的Netflix和WordPress问题以及与苹果的斗争.WP是最新的.

You can actually get push notifications to web and Android via vue cli setup for PWA, out of the box - iOS is the lone holdout on PWAs acting like PWAs on their devices. So, for iOS only, you'll need to create a developers account on Apple and pay $99/yr, plus 20% or 30% on all revenue on purchases...though there might be a way around that but I think that gap has been closed via recent TOS updates from Apple...for more see Netflix and WordPress issues with native apps on iOS and the fight with apple. WP being the most recent.

选择本机应用程序构建包,其中有React本机,nativescript vue,vue-native,expo,可能还有几十个.

Pick your choice of native app building bundles, there's React native, nativescript vue, vue-native, expo and probably a few dozen more out there.

从那里检查文档.Firebase拥有出色的文档,上面的其他软件包也都有出色的文档,并且它们都遵循相似的路径,因为iOS拥有您必须跳过的环以进行构建.

From there check the docs. Firebase has great documentation, other packages above have great documentation and they all follow a similar path since iOS has the hoops you have to jump through to get things to build.

这篇关于如何使用vue js在android/ios中设置推送通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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