diff --git a/BluetoothSerialExample/android/app/build.gradle b/BluetoothSerialExample/android/app/build.gradle index 528a62e..bd7a493 100644 --- a/BluetoothSerialExample/android/app/build.gradle +++ b/BluetoothSerialExample/android/app/build.gradle @@ -126,11 +126,11 @@ android { } dependencies { - compile project(':react-native-bluetooth-serial') - compile project(':@remobile/react-native-toast') - compile fileTree(dir: "libs", include: ["*.jar"]) - compile "com.android.support:appcompat-v7:23.0.1" - compile "com.facebook.react:react-native:+" // From node_modules + implementation project(':react-native-bluetooth-serial') + implementation project(':@remobile/react-native-toast') + implementation fileTree(dir: "libs", include: ["*.jar"]) + implementation "com.android.support:appcompat-v7:23.0.1" + implementation "com.facebook.react:react-native:+" // From node_modules } // Run this once to be able to run the application with BUCK diff --git a/android/build.gradle b/android/build.gradle index 385ae9e..72038ea 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,24 +1,23 @@ buildscript { repositories { + google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.1.0' + classpath 'com.android.tools.build:gradle:3.4.0' } } apply plugin: 'com.android.library' android { - compileSdkVersion 23 - buildToolsVersion "23.0.1" + compileSdkVersion 28 + buildToolsVersion "28.0.3" defaultConfig { minSdkVersion 16 - targetSdkVersion 22 - versionCode 1 - versionName "1.0" + targetSdkVersion 28 ndk { abiFilters "armeabi-v7a", "x86" } @@ -26,6 +25,7 @@ android { } repositories { + google() mavenCentral() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm @@ -34,5 +34,5 @@ repositories { } dependencies { - compile 'com.facebook.react:react-native:+' + implementation 'com.facebook.react:react-native:+' } \ No newline at end of file diff --git a/android/gradle.properties b/android/gradle.properties index d230714..8f0509b 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -13,4 +13,4 @@ # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true #Thu Nov 24 08:03:52 CET 2016 -android.useDeprecatedNdk=true +#android.useDeprecatedNdk=true diff --git a/android/src/main/java/com/rusel/RCTBluetoothSerial/RCTBluetoothSerialPackage.java b/android/src/main/java/com/rusel/RCTBluetoothSerial/RCTBluetoothSerialPackage.java index 3ae4831..0e3648d 100644 --- a/android/src/main/java/com/rusel/RCTBluetoothSerial/RCTBluetoothSerialPackage.java +++ b/android/src/main/java/com/rusel/RCTBluetoothSerial/RCTBluetoothSerialPackage.java @@ -20,7 +20,6 @@ public List createNativeModules(ReactApplicationContext reactConte return modules; } - @Override public List> createJSModules() { return Collections.emptyList(); } diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..6fc1b7e --- /dev/null +++ b/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for @secullum/react-native-bluetooth-serial +// Project: https://github.com/rusel1989/react-native-bluetooth-serial +// Definitions by: Rodrigo Weber +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7.2 +declare module '@secullum/react-native-bluetooth-serial' { + import * as React from "react"; + import * as ReactNative from "react-native"; + + class Buffer { + constructor(data: number[]); + } + + namespace BluetoothSerial { + const on: (eventName: string, handler: () => void) => void + const removeListener: (eventName: string, handler: () => void) => void + const write: (data: Buffer | string) => Promise; + const list: () => Promise>; + const isEnabled: () => Promise; + const connect: (id: string) => Promise; + const disconnect: () => Promise; + const isConnected: () => Promise; + } + + export = BluetoothSerial +} \ No newline at end of file diff --git a/package.json b/package.json index 02f2ae5..7656f2d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "react-native-bluetooth-serial", - "version": "1.0.0-rc1", - "description": "'Bluetooth serial for react native'", + "name": "@secullum/react-native-bluetooth-serial", + "version": "1.1.0", + "description": "Bluetooth serial for react native", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1"