用户进入特定区域提供的ios时如何获取本地通知 [英] How to get local notification when user enters into specific region provided ios

查看:82
本文介绍了用户进入特定区域提供的ios时如何获取本地通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从事这样一个项目,其中应用程序执行以下操作:

I am working on such a project where apps do the following things:

1。获取用户当前位置。
2.当用户进入或在我提供的特定位置附近时获取本地通知。

1.Getting user current location. 2. Get local notifications when user enters or nearby the particular locations i provided.

我所做的是:

我已经下载了区域示例代码(提供了苹果),并使用IOS核心定位框架找到了我的当前位置。它工作正常,下面的代码如下:

I have downloaded the regions sample code(apple provided) to find out my current location using IOS corelocation framework.It works fine.here's the code below:

//基于地图视图的中心创建一个新区域。

// Create a new region based on the center of the map view.

CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(regionsMapView.centerCoordinate.latitude, regionsMapView.centerCoordinate.longitude);
CLRegion *newRegion = [[CLRegion alloc] initCircularRegionWithCenter:coord radius:2.0  identifier:[NSString stringWithFormat:@"%f, %f", regionsMapView.centerCoordinate.latitude, regionsMapView.centerCoordinate.longitude]];

现在,我的问题是如何使用纬度和幅度添加特定区域经度得到通知?

Now, my question is how to add specific regions with latitude& longitude to get notified?

非常感谢您的帮助。任何人都知道任何示例或教程。

Help is highly appreciated.Anybody knows any example or tutorial.

推荐答案

探索iOS核心位置框架提供的基于位置的服务。

Explore the location-based services provided by the iOS Core Location framework.

这里有一些很好的教程。可能会对您有帮助

here are some good tutorials. It may help you

  • Geofencing with Core Location
  • Geofencing on iOS
  • iOS Geofencing API Tutorial Using Core Location Framework

这篇关于用户进入特定区域提供的ios时如何获取本地通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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