如何使用地图在特定地点附近接收推送通知? [英] How to receive a push notification when you are near a specific place using a map?

查看:106
本文介绍了如何使用地图在特定地点附近接收推送通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Ionic的新手,我想知道你是否可以给我一些指导。我正在使用Ionic 1.我看过教程,他们使用谷歌或一个信号。但它们总是基本的教程,我有很多疑问。我希望iOS和Android都可以这样做。

I'm new to Ionic, and I'd like to know if you can give me some guidance. I am using Ionic 1. I have seen tutorials, and they use Google or one signal. But they are always basic tutorials and I have many doubts. I hope to do this for both iOS and Android.

我的应用程序在数据库中有一些坐标,我通过Web服务获取它们。我希望当我靠近某个地方时,我会收到推送通知。我目前正在使用Google地图插件 cordova-plugin-googlemaps 和地理位置插件 cordova-plugin-geolocation

My application has some coordinates in the database, I get them with a web service. I would like that when I'm near a place I get a push notification. I am currently using the Google Maps plugin cordova-plugin-googlemaps and the geolocation plugin cordova-plugin-geolocation.


  • 我希望你给我建议,或者你有过这样的经历。

  • I would like you to give me advice or if you have had the experience of doing something like this.

我也想知道这样做是否有任何费用。

I also want to know if doing this has any cost.

我正在使用Ionic 1和数据库是使用PHP在MySQL中构建的。我认为推送通知是从后端生成的?

I am using Ionic 1 and the database is built in MySQL using PHP. I think the push notification is generated from the back-end?

当我点击通知时,它是否可以包含一个iconor重定向到我的特定位置app?

When I tap on the notification, can it contain an iconor redirect to a specific place in my app?

结论:

什么是最佳选择?我想到了一些插件,当我的位置发生变化时会在后台检测到这种情况发生时(cordova-plugin-geolocation是否会这样做?)验证我是否接近某个地方并发送本地通知。例如,当我点击此通知时,我可以获取该地点的ID并重定向到我的应用中的某个位置。

What is the best alternative? I was thinking of some plugin that detects in the background when my location changes and when this happens (does the cordova-plugin-geolocation do it?) verify if I'm close to a certain place and send a local notification. For example, and when I tap on this notification I can get the id of that place and redirect to a place in my app.

推荐答案

我认为你应该试试地理围栏

repo link

示例链接:

https:/使用Ionic框架构建的/github.com/cowbell/ionic-geofence

https://github.com/tsubik/ionic2-geofence

这篇关于如何使用地图在特定地点附近接收推送通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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