NAV

Introduction

Welcome to the Proximi.io iOS SDK reference. Use our library to hook into the new Proximi.io platform.

While this is only the iOS explanation, you can also find our Android reference here. You can view code examples in the dark area to the right.

This API documentation page was created with Slate.

Quick Start


//  OBJECTIVE-C CODE EXAMPLE

//Apply the delegate
@interface MAStorage : UIViewController <ProximiioDelegate>

//Implement the functions you want to use

// if proximiioHandlePushMessage method is not implemented in your delegate, Proximiio SDK will handle the push message automatically
- (BOOL)proximiioHandlePushMessage:(NSString*)title {
    NSLog(@"Received new push message: %@", title);
    return YES; 
}


- (void)proximiioPositionUpdated:(CLLocation*)location {
    NSLog(@"User position updated to: %@", location);
}

// call requestPermission if you want to handle location permission by Proximio.io SDK
- (void)onProximiioReady {
    [[Proximiio sharedInstance] enable]; // start scanning
    [[Proximiio sharedInstance] requestPermissions];    
}

//Set the delegate and authorize

- (void)viewDidLoad 
{
    [super viewDidLoad];

    //Set the delegate
    [[Proximiio sharedInstance] setDelegate:self];

    //Authorize the application
    [[Proximiio sharedInstance] authWithToken:AUTH_TOKEN];
}

//  SWIFT CODE EXAMPLE

    func proximiioPositionUpdated(_ location: ProximiioLocation) {
        NSLog("proximiioPositionUpdated: %@", location)
    }

    func proximiioEnteredGeofence(_ geofence: ProximiioGeofence!) {
        NSLog("proximiioEnteredGeofence: %@", geofence);
    }

    func proximiioExitedGeofence(_ geofence: ProximiioGeofence!) {
        NSLog("proximiioExitedGeofence: %@", geofence);
    }

    func proximiioHandleOutput(_ payload: NSObject!) {
        NSLog("proximiioHandleOutput: %@", payload);
    }

    override func viewDidLoad() {
        super.viewDidLoad()

        let token: String = "APPLICATION_AUTH_TOKEN";

        let proximiio = Proximiio.sharedInstance() as! ProximiioManager;
        proximiio.delegate = self;
        proximiio.auth(withToken: token) { (state : ProximiioState) in
            if (state == kProximiioReady) {
                proximiio.enable();
                NSLog("Proximi.io ready");
            } else {
                NSLog("Proximi.io auth failure");
            }
        }

    }

You can get started with Proximi.io iOS SDK in less than 5 minutes! All you need is a Proximi.io account and obviously the SDK itself.

  • Install Proximi.io Portal NPM
  • Use CocoaPods (if you don’t already have it installed, see the “Getting Started” guide) to easily install Proximi.io.
  • Simply add pod 'Proximiio' to your Podfile.
  • Open a terminal andn go the directory containing the Podfile.
  • Close Xcode and from now on use your project’s .xcworkspace file to open the project. open .xcworkspace
  • Install the pod with the command pod install.
  • Enable the background mode “locatio updates” in your projects capabilities.
  • Set Enable Bitcode to NO in the project settings.
  • In order to use location services you need to supply a string for the .plist entry NSLocationAlwaysUsageDescription. This string will be displayed in an alert when the SDK is first initialized.
  • Include the Proximiio SDK #include <Proximiio/Proximiio.h>
  • Implement the ProximiioDelegate in a class of your choice and set that class as the delegate of the Proximiio SDK.
  • Authorize either via auth token and application name or via email and password.

Done! You are ready to start using the Proximi.io SDK.

Access

Proximi.io utilizes a singleton pattern to coordinate all functions and events. It simplifies access from anywhere in your code to the Proximi.io functions.

To get a pointer to the singleton, simply call:

#import <Proximiio/Proximiio.h>

ProximiioManager *proximiio = (ProximiioManager *)[Proximiio sharedInstance];

Authentication

Proximi.io allows you to authenticate in two ways - via an auth token and an application name or by using your email and password. Both methods allow you to later change the application freely.

Authentitication only needs to be done once before using the API.

To authorize with your authentication token:

[[Proximiio sharedInstance] authWithToken:YOUR_AUTH_TOKEN];

To authorize with your email and password:

[[Proximiio sharedInstance] authWithEmail:YOUR_EMAIL 
                              andPassword:YOUR_PASSWORD 
                             authCallback:^(BOOL success, int statusCode) {
        //Handle the authorization result.
    }];
//Set your desired application or the SDK will chose the first application it finds.
[[Proximiio sharedInstance] selectApplication:YOUR_APPLICATION_NAME];

Positioning Engine Control

You can manually trigger proximi.io sdk positionining engine by calling [[Proximiio sharedManager] enable] and [[Proximiio sharedManager] disable]

This will keep proximi.io instance in background and authorized, but it will not perform any location source updates, therefor is usefull in situation when constant position updates are not necessary and leads to more optimal battery usage.

Object Management

General

Example of a manage function and how to use its return value.

BOOL correctInput = [[Proximiio sharedInstance] updateFloor:EXISTING_FLOOR_ID
                                                       name:@"An updated Floor"
                                                    floorID:nil
                                                floorPlanID:nil
                                                      place:PARENT_PLACE
                                               withCallback:^(BOOL success, NSError* error) {
                                                  //Handle REST response.
                                               }];

if(!correctInput)
  //Check for wrong input.

You can add, edit and delete most network objects via the Proximi.io SDK. An exception are the actions and applications which can only be managed by the portal. It should be noted that you need to either utilize the user auth token or the email+password authentication to use the following functions.

The functions to create and update also return a BOOL that indicates if the function was called with valid parameters, i.e. all necessary parameters were non-nil.

Places

Read

NSArray *places = [[Proximiio sharedInstance] places];

The array of places can be accessed from the Proximi.io singleton.

@property (nonatomic, readonly) NSArray *places;

Add

[[Proximiio sharedInstance] addPlace:@"A New Place"
                            location:CLLocationCoordinate2DMake(52.1, 11.2)
                             address:@"Oxford Street 42, London"
                  indoorAtlasVenueID:nil
                                tags:@[@"My Tag 1", @"My Tag 2"]
                        withCallback:^(BOOL success, NSError* error) {
                            //Handle REST response.
                        }];

In order to add a place you need to supply a name, address, latitude and logitude. Additionally you can also put an array of tags and an Indoor Atlas venue ID.

- (BOOL) addPlace:(NSString*)name location:(CLLocationCoordinate2D)location address:(NSString*)address indoorAtlasVenueID:(NSString*)venueID tags:(NSArray*)tags withCallback:(void (^)(BOOL success, NSError* error))callback;

Update

[[Proximiio sharedInstance] updatePlace:EXISTING_PLACE_ID
                                   name:@"An updated Place"
                               location:CLLocationCoordinate2DMake(52.1, 11.2)
                                address:@"Oxford Street 42, London"
                     indoorAtlasVenueID:nil
                                   tags:@[@"My Tag 1", @"My Tag 2"]
                           withCallback:^(BOOL success, NSError* error) {
                               //Handle REST response.
                           }];

The update can be seen as an extension of the add function from the programmers perspective, as it has the same attributes plus a necessary ID that indentifies the place.

- (BOOL) updatePlace:(NSString*)ID name:(NSString*)name location:(CLLocationCoordinate2D)location address:(NSString*)address indoorAtlasVenueID:(NSString*)venueID tags:(NSArray*)tags withCallback:(void (^)(BOOL success, NSError* error))callback;

Parameter Type Description
ID NSString* The ID of this place. Note: Only for updating an existing place.
name NSString* The name of this place.
location CLLocationCoordinate2D The location, based on latitude and longitude, of this place.
address NSString* The address of this place.
venueID NSString* The Indoor Atlas venue ID of this place. Note: Not necessary for the iOS side of the SDK.
tags NSArray* An array of string tags.
callback Block The callback block that will be called containing the result from the REST api.

Delete

[[Proximiio sharedInstnace] deletePlace:EXISTING_PLACE_ID 
                           withCallback:^(BOOL success, NSError* error) {
                              //Handle REST response.
                           }];

Delete an existing place by his ID.

- (void) deletePlace:(NSString*)ID withCallback:(void (^)(BOOL success, NSError* error))callback;

Parameter Type Description
ID NSString* The ID of this place.
callback Block The callback block that will be called containing the result from the REST api.

Geofence Metadata

geofence metadata is available under “metadata” property on geofence objects, if metadata is not present, property is set to nil

Floors

Read

NSArray *floors = [[Proximiio sharedInstance] floors];

The array of floors can be accessed from the Proximi.io singleton.

@property (nonatomic, readonly) NSArray *floors;

Add

[[Proximiio sharedInstance] addFloor:@"Floor Name"
                             floorID:nil
                         floorPlanID:nil
                               place:PARENT_PLACE
                        withCallback:^(BOOL success, NSError* error) {
                            //Handle REST response.
                        }];

In order to add a floor you need to supply a name and a pointer to the place it should be assigned to. Additionally you can also put an Indoor Atlas floor ID and floorplan ID.

- (BOOL) addFloor:(NSString*)name floorID:(NSString*)floorID floorPlanID:(NSString*)floorPlanID place:(ProximiioPlace*)place withCallback:(void (^)(BOOL success, NSError* error))callback;

Update

[[Proximiio sharedInstance] updateFloor:EXISTING_FLOOR_ID
                                   name:@"An updated Floor"
                                floorID:nil
                            floorPlanID:nil
                                  place:PARENT_PLACE
                           withCallback:^(BOOL success, NSError* error) {
                               //Handle REST response.
                           }];

The update can be seen as an extension of the add function from the programmers perspective, as it has the same attributes plus a necessary ID that indentifies the floor.

- (BOOL) updateFloor:(NSString*)ID name:(NSString*)name floorID:(NSString*)floorID floorPlanID:(NSString*)floorPlanID place:(ProximiioPlace*)place withCallback:(void (^)(BOOL success, NSError* error))callback;

Parameter Type Description
ID NSString* The ID of this floor. Note: Only for updating an existing floor.
name NSString* The name of this floor.
floorID NSString* The Indoor Atlas floor ID of this floor.
floorplanID NSString* The Indoor Atlas floorplan ID of this floor. Note: Not necessary for the iOS side of the SDK.
place ProximiioPlace* The place this floor is associated to.
callback Block The callback block that will be called containing the result from the REST api.

Delete

[[Proximiio sharedInstnace] deleteFloor:EXISTING_FLOOR_ID 
                           withCallback:^(BOOL success, NSError* error) {
                              //Handle REST response.
                           }];

Delete an existing floor by his ID.

- (void) deleteFloor:(NSString*)ID withCallback:(void (^)(BOOL success, NSError* error))callback;

Parameter Type Description
ID NSString* The ID of this floor.
callback Block The callback block that will be called containing the result from the REST api.

Departments

Read

NSArray *departments = [[Proximiio sharedInstance] departments];

The array of departments can be accessed from the Proximi.io singleton.

@property (nonatomic, readonly) NSArray *departments;

Add

[[Proximiio sharedInstance] addDepartment:@"A new Apartment"
                                    floor:PARENT_FLOOR
                                     tags:@[@"Floor Tag"]
                             withCallback:^(BOOL success, NSError* error) {
                                 //Handle REST response.
                             }];

In order to add a department you need to supply a name and a pointer to the floor it should be assigned to. Additionally you can also attribute tags in form of an array of strings.

- (BOOL) addDepartment:(NSString*)name floor:(ProximiioFloor*)floor tags:(NSArray*)tags withCallback:(void (^)(BOOL success, NSError* error))callback;

Update

[[Proximiio sharedInstance] updateDepartment:EXISTING_DEPARTMENT_ID
                                        name:@"An updated Department"
                                       floor:PARENT_FLOOR
                                        tags:@[@"Floor Tag"]
                                withCallback:^(BOOL success, NSError* error) {
                                    //Handle REST response.
                                }];

The update can be seen as an extension of the add function from the programmers perspective, as it has the same attributes plus a necessary ID that indentifies the department.

- (BOOL) updateDepartment:(NSString*)ID name:(NSString*)name floor:(ProximiioFloor*)floor tags:(NSArray*)tags withCallback:(void (^)(BOOL success, NSError* error))callback;

Parameter Type Description
ID NSString* The ID of this department. Note: Only for updating an existing department.
name NSString* The name of this department.
floor ProximiioFloor* The floor this department is associated to.
tags NSArray* An array of string tags.
callback Block The callback block that will be called containing the result from the REST api.

Delete

[[Proximiio sharedInstnace] deleteDepartment:EXISTING_DEPARTMENT_ID 
                                withCallback:^(BOOL success, NSError* error) {
                                  //Handle REST response.
                                }];

Delete an existing department by his ID.

- (void) deleteDepartment:(NSString*)ID withCallback:(void (^)(BOOL success, NSError* error))callback;

Parameter Type Description
ID NSString* The ID of this department.
callback Block The callback block that will be called containing the result from the REST api.

Geofences

Read

NSArray *geofences = [[Proximiio sharedInstance] geofences];

The array of geofences can be accessed from the Proximi.io singleton.

@property (nonatomic, readonly) NSArray *geofences;

Add


[[Proximiio sharedInstance] addGeofence:@"A new Geofence"
                             department:PARENT_DEPARTMENT
                               location:CLLocationCoordinate2DMake(52.34, 11.33)
                                 radius:50
                                address:@"Oxford Circus 123"
                           withCallback:^(BOOL success, NSError* error) {
                              //Handle REST response.
                           }];

In order to add a geofence you need to supply a name, a pointer to the department it should be assigned to, an address, a latitude and longitude defining the location and a radius in meters.

- (BOOL) addGeofence:(NSString*)name department:(ProximiioDepartment*)department location:(CLLocationCoordinate2D)location radius:(double)radius address:(NSString*)address withCallback:(void (^)(BOOL success, NSError* error))callback;

Update

[[Proximiio sharedInstance] updateGeofence:EXISTING_GEOFENCE_ID
                                      name:@"An updated Geofence"
                                department:PARENT_DEPARTMENT
                                  location:CLLocationCoordinate2DMake(52.34, 11.33)
                                    radius:50
                                   address:@"Oxford Circus 321"
                              withCallback:^(BOOL success, NSError* error) {
                                //Handle REST response.
                              }];

The update can be seen as an extension of the add function from the programmers perspective, as it has the same attributes plus a necessary ID that indentifies the geofence.

- (BOOL) updateGeofence:(NSString*)ID name:(NSString*)name department:(ProximiioDepartment*)department location:(CLLocationCoordinate2D)location radius:(double)radius address:(NSString*)address withCallback:(void (^)(BOOL success, NSError* error))callback;

Parameter Type Description
ID NSString* The ID of this geofence. Note: Only for updating an existing geofence.
name NSString* The name of this geofence.
department ProximiioDepartment* The department this geofence is associated to.
location CLLocationCoordinate2D The location, based on latitude and longitude, of this place.
radius double The radius of this geofence in meters.
address NSString* The address of this place.
callback Block The callback block that will be called containing the result from the REST api.

Delete

[[Proximiio sharedInstnace] deleteGeofence:EXISTING_GEOFENCE_ID 
                              withCallback:^(BOOL success, NSError* error) {
                                 //Handle REST response.
                              }];

Delete an existing geofence by his ID.

- (void) deleteGeofence:(NSString*)ID withCallback:(void (^)(BOOL success, NSError* error))callback;

Parameter Type Description
ID NSString* The ID of this geofence.
callback Block The callback block that will be called containing the result from the REST api.

Inputs (General)

Information

While all inputs are saved within the same class ProximiioInput, the managing system to add and update them differentiate between their types (iBeacon, Eddystone, Custom). Since the reading and deletion is the same, this section will cover these two functions.

Read

NSArray *inputs = [[Proximiio sharedInstance] inputs];

The array of inputs can be accessed from the Proximi.io singleton.

@property (nonatomic, readonly) NSArray *inputs;

Delete

[[Proximiio sharedInstnace] deleteInput:EXISTING_INPUT_ID 
                           withCallback:^(BOOL success, NSError* error) {
                              //Handle REST response.
                           }];

Delete an existing input by his ID.

- (void) deleteInput:(NSString*)ID withCallback:(void (^)(BOOL success, NSError* error))callback;

Parameter Type Description
ID NSString* The ID of this input.
callback Block The callback block that will be called containing the result from the REST api.

Inputs (iBeacon)

Add

[[Proximiio sharedInstance] addiBeaconInput:@"iBeacon Input Name"
                                 department:PARENT_DEPARTMENT
                                   location:CLLocationCoordinate2DMake(52.134, 10.998)
                                       uuid:YOUR_IBEACON_UUID
                                      major:YOUR_IBEACON_MAJOR
                                      minor:YOUR_IBEACON_MINOR
                        triggersFloorChange:YES
                        triggersPlaceChange:NO
                                    floorID:FLOOR_CHANGE_ID
                                    placeID:nil
                               withCallback:^(BOOL success, NSError* error) {
                                  //Handle REST response.
                               }];

In order to add an iBeacon input you need to supply a name, a pointer to the department it should be assigned to, a latitude and longitude defining the location of the iBeacon, the UUID/major/minor of the beacon. Furthermore you need to define if the input should trigger floor and/or a place change, and if so, you also need to define the ID of that place/floor.

- (BOOL) addiBeaconInput:(NSString*)name department:(ProximiioDepartment*)department location:(CLLocationCoordinate2D)location uuid:(NSString*)uuid major:(int)major minor:(int)minor triggersFloorChange:(BOOL)triggersFloorChange triggersPlaceChange:(BOOL)triggersPlaceChange floorID:(NSString*)floorID placeID:(NSString*)placeID withCallback:(void (^)(BOOL success, NSError* error))callback;

Update

[[Proximiio sharedInstance] updateiBeaconInput:EXISTING_IBEACON_INPUT_ID
                                          name:@"iBeacon Input Name"
                                    department:PARENT_DEPARTMENT
                                      location:CLLocationCoordinate2DMake(52.134, 10.998)
                                          uuid:YOUR_IBEACON_UUID
                                         major:YOUR_IBEACON_MAJOR
                                         minor:YOUR_IBEACON_MINOR
                           triggersFloorChange:YES
                           triggersPlaceChange:NO
                                       floorID:FLOOR_CHANGE_ID
                                       placeID:nil
                                  withCallback:^(BOOL success, NSError* error) {
                                    //Handle REST response.
                                  }];

The update can be seen as an extension of the add function from the programmers perspective, as it has the same attributes plus a necessary ID that indentifies the geofence.

- (BOOL) updateiBeaconInput:(NSString*)ID name:(NSString*)name department:(ProximiioDepartment*)department location:(CLLocationCoordinate2D)location uuid:(NSString*)uuid major:(int)major minor:(int)minor triggersFloorChange:(BOOL)triggersFloorChange triggersPlaceChange:(BOOL)triggersPlaceChange floorID:(NSString*)floorID placeID:(NSString*)placeID withCallback:(void (^)(BOOL success, NSError* error))callback;

Parameter Type Description
ID NSString* The ID of this geofence. Note: Only for updating an existing geofence.
name NSString* The name of this geofence.
department ProximiioDepartment* The department this geofence is associated to.
location CLLocationCoordinate2D The location, based on latitude and longitude, of this place.
uuid NSString* The uuid of the beacon that is associated with this input.
major int The major of the beacon that is associated with this input.
minor int The minor of the beacon that is associated with this input.
triggersFloorChange BOOL Defines if this input triggers a floor change.
triggersPlaceChange BOOL Defines if this input triggers a place change.
floorID NSString* The ID of the floor that this beacon will change to. Note: Only if this input triggers a floor change.
placeID NSString* The ID of the place that this beacon will change to. Note: Only if this input triggers a place change.
callback Block The callback block that will be called containing the result from the REST api.

Inputs (Eddystone)

Add

[[Proximiio sharedInstance] addEddystoneInput:@"iBeacon Input Name"
                                   department:PARENT_DEPARTMENT
                                     location:CLLocationCoordinate2DMake(52.134, 10.998)
                                  namespaceID:YOUR_EDDYSTONE_NAMESPACE
                                   instanceID:YOUR_EDDYSTONE_INSTANCEID
                          triggersFloorChange:YES
                          triggersPlaceChange:NO
                                      floorID:FLOOR_CHANGE_ID
                                      placeID:nil
                                 withCallback:^(BOOL success, NSError* error) {
                                     //Handle REST response.
                                 }];

In order to add an Eddystone input you need to supply a name, a pointer to the department it should be assigned to, a latitude and longitude defining the location of the Eddystone, the namespace/instance ID of the beacon. Furthermore you need to define if the input should trigger floor and/or a place change, and if so, you also need to define the ID of that place/floor.

- (BOOL) addEddystoneInput:(NSString*)name department:(ProximiioDepartment*)department location:(CLLocationCoordinate2D)location namespaceID:(NSString*)namespaceID instanceID:(NSString*)instanceID triggersFloorChange:(BOOL)triggersFloorChange triggersPlaceChange:(BOOL)triggersPlaceChange floorID:(NSString*)floorID placeID:(NSString*)placeID withCallback:(void (^)(BOOL success, NSError* error))callback;

Update

[[Proximiio sharedInstance] updateEddystoneInput:EXISTING_IBEACON_INPUT_ID
                                            name:@"iBeacon Input Name"
                                      department:PARENT_DEPARTMENT
                                        location:CLLocationCoordinate2DMake(52.134, 10.998)
                                     namespaceID:YOUR_EDDYSTONE_NAMESPACE
                                      instanceID:YOUR_EDDYSTONE_INSTANCEID
                             triggersFloorChange:YES
                             triggersPlaceChange:NO
                                         floorID:FLOOR_CHANGE_ID
                                         placeID:nil
                                    withCallback:^(BOOL success, NSError* error) {
                                        //Handle REST response.
                                    }];

The update can be seen as an extension of the add function from the programmers perspective, as it has the same attributes plus a necessary ID that indentifies the geofence.

- (BOOL) updateEddystoneInput:(NSString*)ID name:(NSString*)name department:(ProximiioDepartment*)department location:(CLLocationCoordinate2D)location namespaceID:(NSString*)namespaceID instanceID:(NSString*)instanceID triggersFloorChange:(BOOL)triggersFloorChange triggersPlaceChange:(BOOL)triggersPlaceChange floorID:(NSString*)floorID placeID:(NSString*)placeID withCallback:(void (^)(BOOL success, NSError* error))callback;

Parameter Type Description
ID NSString* The ID of this geofence. Note: Only for updating an existing geofence.
name NSString* The name of this geofence.
department ProximiioDepartment* The department this geofence is associated to.
location CLLocationCoordinate2D The location, based on latitude and longitude, of this place.
namespace NSString* The namespace of the beacon that is associated with this input.
instance ID NSString* The namespace of the beacon that is associated with this input.
triggersFloorChange BOOL Defines if this input triggers a floor change.
triggersPlaceChange BOOL Defines if this input triggers a place change.
floorID NSString* The ID of the floor that this beacon will change to. Note: Only if this input triggers a floor change.
placeID NSString* The ID of the place that this beacon will change to. Note: Only if this input triggers a place change.
callback Block The callback block that will be called containing the result from the REST api.

Inputs (Custom)

Add

[[Proximiio sharedInstance] addCustomInput:@"iBeacon Input Name"
                                department:PARENT_DEPARTMENT
                                  location:CLLocationCoordinate2DMake(52.134, 10.998)
                       triggersFloorChange:YES
                       triggersPlaceChange:NO
                                   floorID:FLOOR_CHANGE_ID
                                   placeID:nil
                              withCallback:^(BOOL success, NSError* error) {
                                  //Handle REST response.
                              }];

In order to add a custom input you need to supply a name, a pointer to the department it should be assigned to and a latitude and longitude defining the location of the input. Furthermore you need to define if the input should trigger floor and/or a place change, and if so, you also need to define the ID of that place/floor.

- (BOOL) addCustomInput:(NSString*)name department:(ProximiioDepartment*)department location:(CLLocationCoordinate2D)location triggersFloorChange:(BOOL)triggersFloorChange triggersPlaceChange:(BOOL)triggersPlaceChange floorID:(NSString*)floorID placeID:(NSString*)placeID withCallback:(void (^)(BOOL success, NSError* error))callback;

Update

[[Proximiio sharedInstance] updateCustomInput:EXISTING_IBEACON_INPUT_ID
                                         name:@"iBeacon Input Name"
                                   department:PARENT_DEPARTMENT
                                     location:CLLocationCoordinate2DMake(52.134, 10.998)
                          triggersFloorChange:YES
                          triggersPlaceChange:NO
                                      floorID:FLOOR_CHANGE_ID
                                      placeID:nil
                                 withCallback:^(BOOL success, NSError* error) {
                                     //Handle REST response.
                                 }];

The update can be seen as an extension of the add function from the programmers perspective, as it has the same attributes plus a necessary ID that indentifies the geofence.

- (BOOL) updateCustomInput:(NSString*)ID name:(NSString*)name department:(ProximiioDepartment*)department location:(CLLocationCoordinate2D)location triggersFloorChange:(BOOL)triggersFloorChange triggersPlaceChange:(BOOL)triggersPlaceChange floorID:(NSString*)floorID placeID:(NSString*)placeID withCallback:(void (^)(BOOL success, NSError* error))callback;

Parameter Type Description
ID NSString* The ID of this geofence. Note: Only for updating an existing geofence.
name NSString* The name of this geofence.
department ProximiioDepartment* The department this geofence is associated to.
location CLLocationCoordinate2D The location, based on latitude and longitude, of this place.
triggersFloorChange BOOL Defines if this input triggers a floor change.
triggersPlaceChange BOOL Defines if this input triggers a place change.
floorID NSString* The ID of the floor that this beacon will change to. Note: Only if this input triggers a floor change.
placeID NSString* The ID of the place that this beacon will change to. Note: Only if this input triggers a place change.
callback Block The callback block that will be called containing the result from the REST api.

AppStore Submission

The SDK architectures for Simulator need to be removed before submitting your app. Go to your Project Settings => Build Phases and click the + located on top left part of the window to Add Run Script Phase.

paste following code into script body of the created Run Script Phase

APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"

# This script loops through the frameworks embedded in the application and
# removes unused architectures.
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"

EXTRACTED_ARCHS=()

for ARCH in $ARCHS
do
echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME"
lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
done

echo "Merging extracted architectures: ${ARCHS}"
lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}"
rm "${EXTRACTED_ARCHS[@]}"

echo "Replacing original executable with thinned version"
rm "$FRAMEWORK_EXECUTABLE_PATH"
mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH"

done

Make sure the created Run Script Phase is located below “Embed Frameworks” Phase.

Extras

Scan Triggering

[[Proximiio sharedInstance] startUpdating];
[[Proximiio sharedInstance] stopUpdating];

You can turn Proximii.io locationing on/off by using these methods.

iBeacon

//Kontakt.io's standard beacon UUID
[[Proximiio sharedInstance] addCustomiBeaconUUID:@"F7826DA6-4FA2-4E98-8024-BC5B71E0893E"];

You can add custom UUIDs that will be scanned for to the internal Proximi.io beacon scanner. This way the standard beacon delegate can be utilized further.

- (void) addCustomiBeaconUUID:(NSString*)uuid;

Delegate

The delegate ProximiioDelegate of the Proximi.io base class plays a huge role in the use of the SDK.

Geofence

An event will be send when the user entered or exited a defined ProximiioGeofence.

- (void)proximiioEnteredGeofence:(ProximiioGeofence*)geofence;

- (void)proximiioExitedGeofence:(ProximiioGeofence*)geofence;

Position

An event will be send whenever the user position is updated through an input.

- (void)proximiioPositionUpdated:(CLLocation*)location;

iBeacon

An event will be send when an iBeacon is found, updated or lost.

- (void)proximiioFoundiBeacon:(ProximiioBeacon*)beacon isRegistered:(BOOL)registered;

- (void)proximiioUpdatediBeacon:(ProximiioBeacon*)beacon isRegistered:(BOOL)registered;

- (void)proximiioLostiBeacon:(ProximiioBeacon*)beacon isRegistered:(BOOL)registered;

Eddystone

An event will be send when an Eddystone Beacon is found, updated or lost.

- (void)proximiioFoundEddystoneBeacon:(ProximiioEddystoneBeacon*)beacon isRegistered:(BOOL)registered;

- (void)proximiioUpdatedEddystoneBeacon:(ProximiioEddystoneBeacon*)beacon isRegistered:(BOOL)registered;

- (void)proximiioLostEddystoneBeacon:(ProximiioEddystoneBeacon*)beacon isRegistered:(BOOL)registered;

Management

An event will be send when a network object is created, updated or deleted.

- (void)proximiioUpdatedApplications;

- (void)proximiioUpdatedPlaces;

- (void)proximiioUpdatedFloors;

- (void)proximiioUpdatedDepartments;

- (void)proximiioUpdatedInputs;

- (void)proximiioUpdatedGeofences;

Output

An event will be send when there is an output to handle. A general output will be send whenever any type of output is received.

- (void)proximiioHandleOutput:(NSObject*)payload;

When the output is a push output the user can decide if he wants to handle it himself, or if he wants the SDK to handle it. The sdk will use the default local notification feature if the app is in the background and will show a custom notification that resembles the iOS notification design if the app is in foreground.

- (BOOL)proximiioHandlePushMessage:(NSString*)title;