Skip to content

Commit

Permalink
1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieugerard committed May 20, 2019
1 parent e441220 commit 803f94a
Show file tree
Hide file tree
Showing 45 changed files with 2,206 additions and 2 deletions.
11 changes: 11 additions & 0 deletions Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'polestar-indoor-location-provider-ios' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
use_frameworks!
pod 'IndoorLocation'
pod 'MapwizeUI'
# Pods for polestar-indoor-location-provider-ios

end
13 changes: 13 additions & 0 deletions PolestarIndoorLocationProvider.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Pod::Spec.new do |s|
s.name = "PolestarIndoorLocationProvider"
s.version = "1.0.0"
s.license = { :type => 'MIT' }
s.summary = "Allows to use polestar to provide indoorlocation"
s.homepage = "https://github.com/IndoorLocation/polestar-indoor-location-provider-ios"
s.author = { "Indoor Location" => "[email protected]" }
s.platform = :ios
s.ios.deployment_target = '8.0'
s.source = { :git => "https://github.com/IndoorLocation/polestar-indoor-location-provider-ios", :tag => "#{s.version}" }
s.source_files = "polestar-indoor-location-provider-ios/IndoorLocationProvider/*.{h,m}"
s.dependency "IndoorLocation", "~> 1.0"
end
49 changes: 47 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,47 @@
# polestar-indoor-location-provider-ios
COMING SOON - IndoorLocationProvider for PoleStar beacon-based Indoor Positioning System
# Polestar IndoorLocation Provider for iOS

This modules allows you to use the Indoor Location provided by [Pole Star](https://www.polestar.eu/) and connect it to [Mapwize](https://www.mapwize.io/) in one line of code.

Using this provider requires you to be both a Mapwize and a Pole Star customer. You can sign up for a free Mapwize account at [www.mapwize.io](https://www.mapwize.io/). To purchase the Pole Star solution, please visit [www.polestar.eu/](https://www.polestar.eu/).

## Use

Instanciate the provider using your credentials:

```c
provider = [[ILPolestarIndoorLocationProvider alloc] initWithPolestarKey:@"POLESTAR API KEY"];
```

Set the provider in your Mapwize SDK:

```c
[self.mapwizePlugin setIndoorLocationProvider:provider];
```

The Pole Star locationHandle is available as property of the provider so developers can access it directly.

## Manage altitude

The locations provided by Polestar manages altitude in meters while in IndoorLocation, the elevation is in floors. The default conversion is to divide the altitude by 5 to get the floor. If you need more granularity in the conversion, you can use `floorByAltitude` to specify your mapping. The map takes altitudes (NSNumber) as keys and floors (NSNumber) as values.

## Demo app

A simple demo application to test the provider is available in this project.

You will need to set your Mapwize credentials in the `info.plist` file and your Pole Star key in `ViewController.m`.

Please make sure to call `pod install` before running the app.

## Contribute

Contributions are welcome. We will be happy to review your PR.

## Support

For any support with this provider, please do not hesitate to contact [[email protected]](mailto:[email protected]) and [[email protected]](mailto:[email protected])

## License

This IndoorLocation Provider is made available under the MIT.

Mapwize and Pole Star SDKs used in this project are proprietary of their respective suppliers and are not open-source.
534 changes: 534 additions & 0 deletions polestar-indoor-location-provider-ios.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
17 changes: 17 additions & 0 deletions polestar-indoor-location-provider-ios/AppDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// AppDelegate.h
// polestar-indoor-location-provider-ios
//
// Created by Etienne Mercier on 15/02/2018.
// Copyright © 2018 Etienne Mercier. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;


@end

51 changes: 51 additions & 0 deletions polestar-indoor-location-provider-ios/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//
// AppDelegate.m
// polestar-indoor-location-provider-ios
//
// Created by Etienne Mercier on 15/02/2018.
// Copyright © 2018 Etienne Mercier. All rights reserved.
//

#import "AppDelegate.h"

@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
return YES;
}


- (void)applicationWillResignActive:(UIApplication *)application {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}


- (void)applicationDidEnterBackground:(UIApplication *)application {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}


- (void)applicationWillEnterForeground:(UIApplication *)application {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}


- (void)applicationDidBecomeActive:(UIApplication *)application {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}


- (void)applicationWillTerminate:(UIApplication *)application {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}


@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" systemVersion="17A277" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
43 changes: 43 additions & 0 deletions polestar-indoor-location-provider-ios/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="cj8-Uz-m7S" customClass="MGLMapView">
<rect key="frame" x="0.0" y="20" width="375" height="647"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="cj8-Uz-m7S" secondAttribute="trailing" id="9xV-NI-POB"/>
<constraint firstItem="cj8-Uz-m7S" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" id="NR3-tH-jw3"/>
<constraint firstItem="cj8-Uz-m7S" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" id="vBm-4T-Hv2"/>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="bottom" secondItem="cj8-Uz-m7S" secondAttribute="bottom" id="yQi-X4-dwa"/>
</constraints>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
<connections>
<outlet property="mglMapView" destination="cj8-Uz-m7S" id="Qxv-av-TZD"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#import <IndoorLocation/IndoorLocation.h>
#import "NAOLocationHandle.h"
#import "NAOLocationHandleDelegate.h"
#import "NAOSyncDelegate.h"
#import "NAOSensorsDelegate.h"
#import "DBNAOERRORCODE.h"
#import "DBTNAOFIXSTATUS.h"

@interface ILPolestarIndoorLocationProvider : ILIndoorLocationProvider <NAOSyncDelegate, NAOLocationHandleDelegate, NAOSensorsDelegate>

@property (nonatomic, strong) NAOLocationHandle * locationHandle;
@property (nonatomic, strong) NSDictionary<NSNumber*,NSNumber*>* floorByAltitude;

- (instancetype)initWithPolestarKey:(NSString*) apiKey;

@end
Loading

0 comments on commit 803f94a

Please sign in to comment.