Skip to content

Commit

Permalink
remove dependency of google play services
Browse files Browse the repository at this point in the history
  • Loading branch information
henrybluecats committed Nov 24, 2015
1 parent 8998939 commit f391ec9
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 10 deletions.
20 changes: 12 additions & 8 deletions plugin.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<plugin xmlns="http://cordova.apache.org/ns/plugins/1.0"
id="com.bluecats.beacons"
version="1.0.2">
version="1.14.0-preview">

<!-- This plugin requires Cordova version 3.1.0 or newer. -->
<engines>
<engine name="cordova" version=">=3.1.0" />
</engines>

<name>BlueCats BLE API</name>

<!--
<dependency id="org.apache.cordova.android-support-library" url="https://github.com/savs/android-support-library" />

-->
<js-module src="blueCatsSDKCDVPlugin.js" name="BlueCatsSDKCDVPlugin">
<clobbers target="com.bluecats.beacons" />
</js-module>
Expand Down Expand Up @@ -82,9 +82,9 @@

<config-file target="AndroidManifest.xml" parent="/manifest/application">
<activity android:name="com.blueCats.BlueCatsSDKCDVPlugin.BlueCatsSDKCDVPluginLocalNotificationReveiverActivity" android:launchMode="singleInstance" />

<meta-data android:name="com.google.android.gms.version" android:value="7895000" />

<!--
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
-->
<service android:name="com.bluecats.sdk.BlueCatsSDKService" />

<receiver android:name="com.bluecats.sdk.BlueCatsSDKServiceReceiver" >
Expand All @@ -103,7 +103,11 @@
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
</config-file>

<framework src="push.gradle" custom="true" type="gradleReference" />
<!--
<framework src="com.android.support:support-v13:23+" />
<framework src="com.google.android.gms:play-services:+" />
-->
<source-file src="src/android/BlueCatsSDKCDVPlugin.java" target-dir="src/com/blueCats/BlueCatsSDKCDVPlugin" />
<source-file src="src/android/BlueCatsSDKCDVPluginLocalNotificationReveiverActivity.java" target-dir="src/com/blueCats/BlueCatsSDKCDVPlugin" />

Expand All @@ -115,7 +119,7 @@
<source-file src="src/android/libs/x86/libbluecats_sdk.so" target-dir="libs/x86" />
<source-file src="src/android/libs/x86_64/libbluecats_sdk.so" target-dir="libs/x86_64" />
<source-file src="src/android/libs/bluecats_sdk.jar" target-dir="libs" />
<source-file src="src/android/libs/google-play-services.jar" target-dir="libs" />

<source-file src="src/android/libs/gson-2.2.4.jar" target-dir="libs" />
</platform>

Expand Down
21 changes: 21 additions & 0 deletions push.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import java.util.regex.Pattern

def doExtractStringFromManifest(name) {
def manifestFile = file(android.sourceSets.main.manifest.srcFile)
def pattern = Pattern.compile(name + "=\"(.*?)\"")
def matcher = pattern.matcher(manifestFile.getText())
matcher.find()
return matcher.group(1)
}

android {
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
}
}

defaultConfig {
applicationId = doExtractStringFromManifest("package")
}
}
4 changes: 2 additions & 2 deletions src/android/BlueCatsSDKCDVPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -551,8 +551,8 @@ private String getSDKOptionForKey(String sdkOption) {
return BlueCatsSDK.BC_OPTION_MONITOR_BLUE_CATS_REGION_ON_STARTUP;
} else if (sdkOption.equals("monitorAllAvailableRegionsOnStartup")) {
return BlueCatsSDK.BC_OPTION_MONITOR_ALL_AVAILABLE_REGIONS_ON_STARTUP;
} else if (sdkOption.equals("useEnergySaverScanStrategy")) {
return BlueCatsSDK.BC_OPTION_USE_ENERGY_SAVER_SCAN_STRATEGY;
//} else if (sdkOption.equals("useEnergySaverScanStrategy")) {
// return BlueCatsSDK.BC_OPTION_USE_ENERGY_SAVER_SCAN_STRATEGY;
} else if (sdkOption.equals("crowdSourceBeaconUpdates")) {
return BlueCatsSDK.BC_OPTION_CROWD_SOURCE_BEACON_UPDATES;
} else if (sdkOption.equals("useLocalStorage")) {
Expand Down
Binary file modified src/android/libs/bluecats_sdk.jar
Binary file not shown.

0 comments on commit f391ec9

Please sign in to comment.