This repository has been archived by the owner on May 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
462 additions
and
183 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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
|
||
.DS_Store | ||
node_modules |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
|
||
{ | ||
"predef": [ | ||
"document", | ||
|
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
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
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
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
|
||
machine: | ||
environment: | ||
ANDROID_NDK_HOME: $ANDROID_NDK | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
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,18 @@ | ||
console.log("Running hook to install push notifications pre-requisites"); | ||
|
||
module.exports = function (context) { | ||
var child_process = context.requireCordovaModule('child_process'), | ||
deferral = context.requireCordovaModule('q').defer(); | ||
|
||
var output = child_process.exec('npm install', {cwd: __dirname}, function (error) { | ||
if (error !== null) { | ||
console.log('exec error: ' + error); | ||
deferral.reject('npm installation failed'); | ||
} | ||
else { | ||
deferral.resolve(); | ||
} | ||
}); | ||
|
||
return deferral.promise; | ||
}; |
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,17 @@ | ||
{ | ||
"dependencies": { | ||
"xcode":"^0.8.3", | ||
"xmldom":"0.1.15", | ||
"xmlbuilder": "2.2.1", | ||
"util-deprecate": "1.0.0", | ||
"stream-buffers": "~0.2.3", | ||
"simple-plist": "0.0.4", | ||
"plist": "1.1.0", | ||
"pegjs": "0.6.2", | ||
"node-uuid": "1.3.3", | ||
"lodash-node": "~2.4.1", | ||
"bplist-parser": "0.0.6", | ||
"bplist-creator": "0.0.4", | ||
"base64-js": "0.0.6" | ||
} | ||
} |
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
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
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,46 @@ | ||
package com.cowbell.cordova.geofence; | ||
|
||
import android.content.BroadcastReceiver; | ||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.content.SharedPreferences; | ||
import android.location.LocationManager; | ||
|
||
/** | ||
* Created by domingosgomes on 11/01/17. | ||
*/ | ||
public class LocationProviderChangedReceiver extends BroadcastReceiver { | ||
private String GpsPreferences = "GpsPreferences"; | ||
private String GpsSharePreferences = "GpsHasEnable"; | ||
|
||
@Override | ||
public void onReceive(Context context, Intent intent) { | ||
boolean isGpsEnabled; | ||
if (intent.getAction().matches("android.location.PROVIDERS_CHANGED")) | ||
{ | ||
LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); | ||
isGpsEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); | ||
Boolean GpsHasEnable = getGpsState(context); | ||
//Start your Activity if location was enabled: | ||
if (isGpsEnabled && !GpsHasEnable) { | ||
Logger.setLogger(new Logger(GeofencePlugin.TAG, context, false)); | ||
GeoNotificationManager manager = new GeoNotificationManager(context); | ||
manager.loadFromStorageAndInitializeGeofences(); | ||
} | ||
setGpsState(isGpsEnabled,context); | ||
} | ||
} | ||
|
||
public void setGpsState(Boolean state, Context context){ | ||
SharedPreferences sharedPref = context.getSharedPreferences(GpsPreferences,Context.MODE_PRIVATE); | ||
SharedPreferences.Editor editor = sharedPref.edit(); | ||
editor.putBoolean(GpsSharePreferences, state); | ||
editor.commit(); | ||
} | ||
|
||
public Boolean getGpsState(Context context){ | ||
SharedPreferences sharedPref = context.getSharedPreferences(GpsPreferences,Context.MODE_PRIVATE); | ||
Boolean gpsState = sharedPref.getBoolean(GpsSharePreferences,true); | ||
return gpsState; | ||
} | ||
} |
Binary file not shown.
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
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,9 @@ | ||
// | ||
// Use this file to import your target's public headers that you would like to expose to Swift. | ||
// | ||
|
||
#import <Cordova/CDV.h> | ||
#import <Cordova/CDVAvailability.h> | ||
#import <CoreLocation/CoreLocation.h> | ||
#import "sqlite3.h" | ||
#import "GeofenceHelper.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 |
---|---|---|
|
@@ -2148,4 +2148,4 @@ extension String { | |
|
||
return nsSt.stringByAppendingPathExtension(ext) | ||
} | ||
} | ||
} |
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
Empty file.
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
Empty file.
Empty file.
Empty file.
Empty file.
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
|
||
{ | ||
"predef": [ | ||
"document", | ||
|
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,69 @@ | ||
var child_process = require('child_process'), | ||
fs = require('fs'), | ||
path = require('path'); | ||
|
||
module.exports = function(context) { | ||
var COMMENT_KEY = /_comment$/, | ||
CORDOVA_VERSION = process.env.CORDOVA_VERSION; | ||
|
||
if (!process.env.FIX_PARAMEDIC) { | ||
return; | ||
} | ||
|
||
run(); | ||
|
||
function run() { | ||
var cordova_util = context.requireCordovaModule('cordova-lib/src/cordova/util'), | ||
ConfigParser = CORDOVA_VERSION >= 6.0 | ||
? context.requireCordovaModule('cordova-common').ConfigParser | ||
: context.requireCordovaModule('cordova-lib/src/configparser/ConfigParser'), | ||
projectRoot = cordova_util.isCordova(), | ||
platform_ios, | ||
xml = cordova_util.projectConfig(projectRoot), | ||
cfg = new ConfigParser(xml), | ||
projectName = cfg.name(), | ||
platform_ios = CORDOVA_VERSION < 5.0 | ||
? context.requireCordovaModule('cordova-lib/src/plugman/platforms')['ios'] | ||
: context.requireCordovaModule('cordova-lib/src/plugman/platforms/ios'), | ||
iosPlatformPath = path.join(projectRoot, 'platforms', 'ios'), | ||
iosProjectFilesPath = path.join(iosPlatformPath, projectName), | ||
xcconfigPath = path.join(iosPlatformPath, 'cordova', 'build.xcconfig'), | ||
xcconfigContent, | ||
projectFile, | ||
xcodeProject, | ||
bridgingHeaderPath; | ||
|
||
projectFile = platform_ios.parseProjectFile(iosPlatformPath); | ||
xcodeProject = projectFile.xcode; | ||
|
||
|
||
var configurations = nonComments(xcodeProject.pbxXCBuildConfigurationSection()), | ||
config, buildSettings; | ||
|
||
for (config in configurations) { | ||
buildSettings = configurations[config].buildSettings; | ||
buildSettings['SWIFT_VERSION'] = '2.3' | ||
} | ||
console.log('IOS project Swift Version changed to 2.3 ...'); | ||
|
||
projectFile.write(); | ||
} | ||
|
||
function nonComments(obj) { | ||
var keys = Object.keys(obj), | ||
newObj = {}, | ||
i = 0; | ||
|
||
for (i; i < keys.length; i++) { | ||
if (!COMMENT_KEY.test(keys[i])) { | ||
newObj[keys[i]] = obj[keys[i]]; | ||
} | ||
} | ||
|
||
return newObj; | ||
} | ||
|
||
function unquote(str) { | ||
if (str) return str.replace(/^"(.*)"$/, "$1"); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,8 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="cordova-plugin-geofence-test" version="0.5.0"> | ||
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="cordova-plugin-geofence-test" version="0.6.0"> | ||
<name>Geofence plugin Tests</name> | ||
<license>Apache 2.0</license> | ||
|
||
<js-module src="tests.js" name="tests"> | ||
</js-module> | ||
|
||
<platform name="ios"> | ||
<hook type="before_run" src="hooks/fix-swift-paramedic.js" /> | ||
</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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
|
||
exports.defineAutoTests = function () { | ||
var fail = function (done, reason) { | ||
if (reason) { | ||
|
Oops, something went wrong.