Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ untyped-import
untyped-type-import

[version]
^0.203.1
^0.259.1
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ jobs:
matrix:
configurations:
[
{ react_native_version: '0.72.6', node_version: 18 },
{ react_native_version: '0.71.14', node_version: 18 },
{ react_native_version: '0.70.13', node_version: 18 }
{ react_native_version: '0.77.0', node_version: 18 },
{ react_native_version: '0.76.6', node_version: 18 },
# { react_native_version: '0.75.4', node_version: 18 }
]
env:
TURBO_CACHE_DIR: .turbo/android
Expand Down Expand Up @@ -116,9 +116,9 @@ jobs:
matrix:
configurations:
[
{ react_native_version: '0.72.6', node_version: 18 },
{ react_native_version: '0.71.14', node_version: 18 },
{ react_native_version: '0.70.13', node_version: 18 }
{ react_native_version: '0.77.0', node_version: 18 },
{ react_native_version: '0.76.6', node_version: 18 },
{ react_native_version: '0.75.4', node_version: 18 }
]
env:
TURBO_CACHE_DIR: .turbo/ios
Expand Down
2 changes: 1 addition & 1 deletion __tests__/BleManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ test('BleManager properly monitors characteristic value', async () => {
subscription.remove()
expect(listener).toHaveBeenCalledTimes(2)
expect(Native.BleModule.cancelTransaction).toBeCalledWith('x')
expect(Native.BleModule.monitorCharacteristicForDevice).toBeCalledWith('id', 'aaaa', 'bbbb', 'x')
expect(Native.BleModule.monitorCharacteristicForDevice).toBeCalledWith('id', 'aaaa', 'bbbb', 'x', undefined)
})

test('BleManager properly handles errors while monitoring characteristic values', async () => {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/Characteristic.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe("Test if Characteristic is properly calling BleManager's utility functi
test('monitor', async () => {
const listener = jest.fn()
await characteristic.monitor(listener, 'id')
expect(bleManager._monitorCharacteristic).toBeCalledWith('cId', listener, 'id')
expect(bleManager._monitorCharacteristic).toBeCalledWith('cId', listener, 'id', undefined)
})

test('readDescriptor', async () => {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/Device.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe("Test if Device is properly calling BleManager's utility function:", ()
test('monitorCharacteristicForService', async () => {
const listener = jest.fn()
await device.monitorCharacteristicForService('aaaa', 'bbbb', listener, 'id')
expect(bleManager.monitorCharacteristicForDevice).toBeCalledWith('id', 'aaaa', 'bbbb', listener, 'id')
expect(bleManager.monitorCharacteristicForDevice).toBeCalledWith('id', 'aaaa', 'bbbb', listener, 'id', undefined)
})

test('readDescriptorForService', async () => {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/Service.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe("Test if Service is properly calling BleManager's utility function:", (
test('monitorCharacteristic', async () => {
const listener = jest.fn()
await service.monitorCharacteristic('bbbb', listener, 'id')
expect(bleManager._monitorCharacteristicForService).toBeCalledWith('serviceId', 'bbbb', listener, 'id')
expect(bleManager._monitorCharacteristicForService).toBeCalledWith('serviceId', 'bbbb', listener, 'id', undefined)
})

test('readDescriptorForCharacteristic', async () => {
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}

dependencies {
classpath "com.android.tools.build:gradle:7.2.1"
classpath "com.android.tools.build:gradle:8.8.0"
}
}

Expand Down
10 changes: 5 additions & 5 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
BlePlx_kotlinVersion=1.7.0
BlePlx_minSdkVersion=23
BlePlx_targetSdkVersion=31
BlePlx_compileSdkVersion=31
BlePlx_ndkversion=21.4.7075529
BlePlx_kotlinVersion=2.0.21
BlePlx_minSdkVersion=24
BlePlx_targetSdkVersion=34
BlePlx_compileSdkVersion=35
BlePlx_ndkversion=26.1.10909125
9 changes: 5 additions & 4 deletions example/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 2.6.10"

# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
# bound in the template on Cocoapods with next React Native release.
gem 'cocoapods', '>= 1.13', '< 1.15'
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
gem 'xcodeproj', '< 1.26.0'
gem 'concurrent-ruby', '< 1.3.4'
21 changes: 11 additions & 10 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ apply plugin: "com.facebook.react"
*/
react {
/* Folders */
// The root of your project, i.e. where "package.json" lives. Default is '..'
// root = file("../")
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
// reactNativeDir = file("../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
// codegenDir = file("../node_modules/@react-native/codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
// cliFile = file("../node_modules/react-native/cli.js")
// The root of your project, i.e. where "package.json" lives. Default is '../..'
// root = file("../../")
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
// reactNativeDir = file("../../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
// codegenDir = file("../../node_modules/@react-native/codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
// cliFile = file("../../node_modules/react-native/cli.js")

/* Variants */
// The list of variants to that are debuggable. For those we're going to
Expand Down Expand Up @@ -49,6 +49,9 @@ react {
//
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
// hermesFlags = ["-O", "-output-source-map"]

/* Autolinking */
autolinkLibrariesWithApp()
}

/**
Expand Down Expand Up @@ -114,5 +117,3 @@ dependencies {
implementation jscFlavor
}
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
3 changes: 2 additions & 1 deletion example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
android:supportsRtl="true">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.facebook.react.ReactPackage
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.soloader.OpenSourceMergedSoMapping
import com.facebook.soloader.SoLoader

class MainApplication : Application(), ReactApplication {
Expand All @@ -34,7 +35,7 @@ class MainApplication : Application(), ReactApplication {

override fun onCreate() {
super.onCreate()
SoLoader.init(this, false)
SoLoader.init(this, OpenSourceMergedSoMapping)
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
load()
Expand Down
14 changes: 7 additions & 7 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
buildscript {
ext {
buildToolsVersion = "34.0.0"
minSdkVersion = 23
compileSdkVersion = 34
buildToolsVersion = "35.0.0"
minSdkVersion = 24
compileSdkVersion = 35
targetSdkVersion = 34
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.22"
kotlinVersion = "2.0.21"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.22"
classpath('com.android.tools.build:gradle')
classpath('com.facebook.react:react-native-gradle-plugin')
classpath('org.jetbrains.kotlin:kotlin-gradle-plugin')
}
}

Expand Down
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 5 additions & 2 deletions example/android/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
6 changes: 4 additions & 2 deletions example/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
plugins { id("com.facebook.react.settings") }
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
rootProject.name = 'BlePlxExample'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')
includeBuild('../node_modules/@react-native/gradle-plugin')
30 changes: 30 additions & 0 deletions example/ios/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import UIKit
import React
import React_RCTAppDelegate
import ReactAppDependencyProvider

@main
class AppDelegate: RCTAppDelegate {
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
self.moduleName = "BlePlxExample"
self.dependencyProvider = RCTAppDependencyProvider()

// You can add your custom initial props in the dictionary below.
// They will be passed down to the ViewController used by React Native.
self.initialProps = [:]

return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}

override func sourceURL(for bridge: RCTBridge) -> URL? {
self.bundleURL()
}

override func bundleURL() -> URL? {
#if DEBUG
RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
#else
Bundle.main.url(forResource: "main", withExtension: "jsbundle")
#endif
}
}
Loading
Loading