Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First draft version of the Ubudu Cordova plugin with iOS platform sup…
…port only.
- Loading branch information
Showing
15 changed files
with
1,296 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Copyright (c) 2011-2015, UBUDU SAS | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2011-2015, UBUDU SAS | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
* Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
--> | ||
|
||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" | ||
id="com.ubudu.cordova.sdk" | ||
version="0.1-dev"> | ||
<name>UbuduSDK</name> | ||
<description>Cordova Ubudu SDK Plugin</description> | ||
<license>BSD License</license> | ||
<keywords>cordova,ubudu,sdk,beacon,ibeacon</keywords> | ||
<js-module src="www/UbuduSDK.js" name="UbuduSDK"> | ||
<clobbers target="UbuduSDK" /> | ||
</js-module> | ||
<platform name="ios"> | ||
<config-file target="config.xml" parent="/*"> | ||
<feature name="UbuduSDKCordova"> | ||
<param name="ios-package" value="UbuduSDKCordova"/> | ||
</feature> | ||
</config-file> | ||
<header-file src="src/ios/UbuduSDKCordova.h" /> | ||
<source-file src="src/ios/UbuduSDKCordova.m" /> | ||
<framework src="Foundation.framework" weak="true" /> | ||
<framework src="CoreGraphics.framework" weak="true" /> | ||
<framework src="UIKit.framework" weak="true" /> | ||
<framework src="SystemConfiguration.framework" weak="true" /> | ||
<framework src="MobileCoreServices.framework" weak="true" /> | ||
<framework src="CoreData.framework" weak="true" /> | ||
<framework src="CoreLocation.framework" weak="true" /> | ||
<framework src="CoreBluetooth.framework" weak="true" /> | ||
<framework src="PassKit.framework" weak="true" /> | ||
<framework src="src/ios/UbuduSDK.framework" custom="true" /> | ||
</platform> | ||
</plugin> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Versions/Current/Headers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Versions/Current/UbuduSDK |
49 changes: 49 additions & 0 deletions
49
src/ios/UbuduSDK.framework/Versions/A/Headers/UbuduAuthorizationDelegate.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// | ||
// UbuduAuthorizationDelegate.h | ||
// UbuduSDK | ||
// | ||
// Copyright (c) 2011-2014, UBUDU SAS | ||
// All rights reserved. | ||
// | ||
// Redistribution and use in source and binary forms, with or without | ||
// modification, are permitted provided that the following conditions are met: | ||
// | ||
// * Redistributions of source code must retain the above copyright notice, this | ||
// list of conditions and the following disclaimer. | ||
// | ||
// * Redistributions in binary form must reproduce the above copyright notice, | ||
// this list of conditions and the following disclaimer in the documentation | ||
// and/or other materials provided with the distribution. | ||
// | ||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@protocol UbuduAuthorizationDelegate <NSObject> | ||
|
||
@optional | ||
|
||
/* | ||
* Methods used to inform you that the status of one of the feature of the UbuduSDK changed. | ||
*/ | ||
- (void)ubuduBeaconsServiceStatusDidChange:(BOOL)isEnabled; // Beacons service is enabled if UbuduSDK.beaconsEnabled is YES and that UbuduSDK is currently running. | ||
- (void)ubuduGeofencesServiceStatusDidChange:(BOOL)isEnabled; // Geofences service is enabled if UbuduSDK.geofencesEnabled is YES and that UbuduSDK is currently running. | ||
|
||
/* | ||
* Methods used to inform you that the status of a service used by the UbuduSDK has changed. | ||
*/ | ||
- (void)locationServiceStatusDidChange:(BOOL)isEnabled; // Global or app-specific location service status changed. | ||
- (void)bluetoothStatusDidChange:(BOOL)isEnabled; | ||
- (void)backgroundRefreshStatusDidChange:(BOOL)isEnabled; | ||
|
||
@end |
57 changes: 57 additions & 0 deletions
57
src/ios/UbuduSDK.framework/Versions/A/Headers/UbuduAuthorizationManager.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// | ||
// UbuduAuthorizationManager.h | ||
// UbuduSDK | ||
// | ||
// Copyright (c) 2011-2014, UBUDU SAS | ||
// All rights reserved. | ||
// | ||
// Redistribution and use in source and binary forms, with or without | ||
// modification, are permitted provided that the following conditions are met: | ||
// | ||
// * Redistributions of source code must retain the above copyright notice, this | ||
// list of conditions and the following disclaimer. | ||
// | ||
// * Redistributions in binary form must reproduce the above copyright notice, | ||
// this list of conditions and the following disclaimer in the documentation | ||
// and/or other materials provided with the distribution. | ||
// | ||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import <CoreBluetooth/CoreBluetooth.h> | ||
|
||
#import "UbuduAuthorizationDelegate.h" | ||
|
||
@interface UbuduAuthorizationManager : NSObject | ||
|
||
@property (nonatomic, readonly, getter = isUbuduBeaconsServiceEnabled) BOOL ubuduBeaconsServiceEnabled; // YES if UbuduSDK.beaconsEnabled is set to YES and UbuduSDK is currently running. | ||
@property (nonatomic, readonly, getter = isUbuduGeofencesServiceEnabled) BOOL ubuduGeofencesServiceEnabled; // YES if UbuduSDK.geofencesEnabled is set to YES and UbuduSDK is currently running. | ||
@property (nonatomic, readonly, getter = isLocationServiceEnabled) BOOL locationServiceEnabled; // YES if both global and app-specific location services are enabled. | ||
@property (nonatomic, readonly, getter = isBluetoothEnabled) BOOL bluetoothEnabled; | ||
@property (nonatomic, readonly, getter = isBackgroundRefreshEnabled) BOOL backgroundRefreshEnabled; | ||
|
||
/* Delegate to receive notifications when the value of one of the above properties changes. */ | ||
@property (nonatomic, weak) id<UbuduAuthorizationDelegate> authorizationDelegate; | ||
|
||
/* Shows an alert with a button that redirects to Settings app, directly on Bluetooth view. */ | ||
- (void)showEnableBluetoothAlert; | ||
|
||
/* Opens app settings on iOS 8, shows an alert with instructions to enable location service on iOS 7 and below. | ||
*/ | ||
- (void)showEnableLocationServiceUI; | ||
|
||
/* Opens app settings on iOS 8, shows an alert with instructions to enable background refresh on iOS 7 and below. | ||
*/ | ||
- (void)showEnableBackgroundRefreshUI; | ||
|
||
@end |
78 changes: 78 additions & 0 deletions
78
src/ios/UbuduSDK.framework/Versions/A/Headers/UbuduErrorCodes.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
// | ||
// UbuduErrorCodes.h | ||
// UbuduSDK | ||
// | ||
// Copyright (c) 2011-2014, UBUDU SAS | ||
// All rights reserved. | ||
// | ||
// Redistribution and use in source and binary forms, with or without | ||
// modification, are permitted provided that the following conditions are met: | ||
// | ||
// * Redistributions of source code must retain the above copyright notice, this | ||
// list of conditions and the following disclaimer. | ||
// | ||
// * Redistributions in binary form must reproduce the above copyright notice, | ||
// this list of conditions and the following disclaimer in the documentation | ||
// and/or other materials provided with the distribution. | ||
// | ||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
// Error returned as the domain to NSError from Ubudu. | ||
#define kUbuduErrorDomain @"UbuduErrorDomain" | ||
|
||
typedef NS_ENUM(NSUInteger, UbuduErrorCodes) { | ||
UbuduError_None = 0, | ||
UbuduError_UnknownError = 1, | ||
UbuduError_SDKNotStarted = 2, | ||
UbuduError_SDKAlreadyStarted = 3, | ||
UbuduError_DataInitializationError = 4, | ||
UbuduError_DeviceDoesNotSupportRegionMonitoring = 5, | ||
UbuduError_DeviceDoesNotSupportBeacons = 6, | ||
UbuduError_NamespaceNotSet = 7, | ||
UbuduError_GeofencesDisabled = 8, | ||
UbuduError_BeaconsDisabled = 9, | ||
|
||
UbuduError_Actions_Error = 200, | ||
UbuduError_Actions_NoDataFoundForRegionEntered = 201, // Odd error. Happens when there is no data for a region which was registered which means that it was in the data storage before. Could've been removed in the meantime. | ||
UbuduError_Actions_DataForRegionNotYetAvailableDueToStartDate = 202, | ||
UbuduError_Actions_DataForRegionNotAvailableDueToEndDateExpiration = 203, | ||
UbuduError_Actions_DataForRegionNotAvailableDueToSchedule = 204, | ||
|
||
UbuduError_API_Error = 400, | ||
UbuduError_API_ParamError = 401, | ||
UbuduError_API_ResponseParsingError = 402, | ||
UbuduError_API_SecondGeofencesRequestsLaunched = 403, | ||
UbuduError_API_RegionsDownloadResponseCodeNot200 = 404, | ||
UbuduError_API_RequestServerBadParam = 405, // Received invalid JSON from HTTP request for notify_server action | ||
|
||
UbuduError_Data_Error = 600, | ||
UbuduError_Data_NSPersistentStoreOldVersionMigrationError = 601, | ||
UbuduError_Data_NSPersistentStoreOldVersionRemovalError = 602, | ||
UbuduError_Data_NSPersistentStoreOpeningError = 603, | ||
UbuduError_Data_NSPersistentStoreDirectoryCreationError = 604, | ||
UbuduError_Data_NSPredicateParseError = 605, | ||
UbuduError_Data_AttemptedToModifyDataWhileAnotherRequestIsPerformed = 606, | ||
UbuduError_Data_UnableToAddNilRuleAndAction = 607, | ||
UbuduError_Data_UnableToAddNilAction = 608, | ||
UbuduError_Data_RemovingLocalDataFailed = 609, | ||
|
||
UbuduError_Location_Error = 800, | ||
UbuduError_Location_LocationUnavailable = 801, | ||
UbuduError_Location_RegionMonitoringUnavailable = 802, | ||
|
||
UbuduError_Beacon_Error = 1000, | ||
UbuduError_Beacon_AlreadyStarted = 1001, | ||
UbuduError_Beacon_NotStarted = 1002 | ||
}; |
Oops, something went wrong.