PWLocalpoint 2.6.3.2

PWLocalpoint 2.6.3.2

测试已测试
Lang语言 Obj-CObjective C
许可证 自定义
发布最后发布2016年9月

Illya BusiginSam OdomShashank ThummalapalliShiv VenkatramanXiangwei Wang维护。



PWLocalpoint 2.6.3.2

iOS Localpoint SDK

版本 2.6.3.2

这是Phunware的iOS SDK,用于位置营销,一个基于位置和通知的系统。访问http://maas.phunware.com/获取更多详情和注册信息。

文档

需求

  • iOS 6.0或更高版本
  • Xcode 5或更高版本

安装

Phunware建议使用CocoaPods来集成框架。只需将pod 'PWLocalpoint'添加到您的Podfile中。

或者,您可以按以下步骤操作

  1. 将Localpoint.framework添加到您的Xcode项目中。
  2. 在您的构建设置中,确认Framework Search Paths中有一个指向Localpoing.framework文件夹的条目。例如:$(PROJECT_DIR)/Vendor/Phunware/Localpoint

  3. 以下iOS框架是必需的

CoreLocation.framework
CoreGraphics.framework
libsqlite3.lib

设置

将以下关键/值添加到您的app Info.plist文件中

  • 必需的后台模式
    • App registers for location updates 这个值将允许应用在后台运行时向用户告知其位置。
    • App downloads content from the network 这个值将允许应用定期从网络下载并处理小量的内容。添加这个值只为我们的SDK的2.4.0+版本必需。
  • LPServer : 您将工作的环境。这个值可以用sandbox进行测试,用api进行生产。
  • LPAppID : 与服务器选择匹配的应用ID。
  • LPBrand : 您的品牌名称。
  • NSLocationAlwaysUsageDescription: 当用户授予应用使用位置服务权限时,您要在提示警报中显示的消息。

文档

Localpoint文档包括在仓库的Documents文件夹中,同时有HTML和.docset格式。您也可以在这里找到最新文档:http://phunware.github.io/maas-localpoint-ios-sdk/

集成

Localpoint SDK始终在后台运行。SDK中不包含任何UI元素。

启动Localpoint服务

// Include the Localpoint header file
#import <Localpoint/Localpoint.h>

// Get Localpoint instance
LPLocalpointService *lpService = [LPLocalpointService instance];

// Start it
[lpService start];

// That's it!

订阅位置事件回调

Localpoint提供了一个ILPLocationListener协议。您可以创建一个实现该协议的监听器,并将您的监听器注册到Localpoint SDK的位置提供程序。

LPLocationListener *locationListener = [[LPLocationListener alloc] init];

// Register your location listener
[[lpService getLocationProvider] addListener:locationListener];

订阅消息事件回调

Localpoint提供了一个ILPMessageListener协议。您可以创建一个实现该协议的监听器,并将您的监听器注册到Localpoint SDK的消息提供程序。

LPMessageListener *messageListener = [[LPMessageListener alloc] init];

// Register your message listener
[[lpService getMessageProvider] addListener:messageListener];

自定义本地通知回调

Localpoint提供了一个ILPLocalNotificationListener协议。您可以创建一个实现该协议的监听器,并在LPLocalpointService实例中设置该监听器。

LPLocalNotificationListener *localNotificationListener = [[LPLocalNotificationListener alloc] init];

// Register your local notification listener
[lpService setLocalNotificationListener:localNotificationListener];

停止Localpoint服务

// Stop Localpoint service
[lpService stop];