Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When assembling app as Release startNotification does not work, when as Debug - works well (Oppo Reno 5 Android 13) #1267

Open
muramidaza opened this issue Oct 1, 2024 · 1 comment

Comments

@muramidaza
Copy link

muramidaza commented Oct 1, 2024

IF I BUILD AN APP AS "DEBUG" - IT WORKS WELL, IF I BUILD AN APP AS A RELEASE - IT DO NOT WORK

I use a smartphone Oppo Reno 5 with Android 13 for testing.
How to reproduce the bug:

  • Scanning working well - BleManager.scan([], 20, true)
  • The device (smartwatch) connects - BleManager.connect(this.deviceID!)
  • BleManager.retrieveServices(this.deviceID!)
  • Ыubscription to notifications - this.BLEService.startNotification(this.device.id, appConfig.UUID_S, appConfig.UUID_C_1);
    (the BleManager.write command is successful - connection well)
  • build app as Release

Events do not come - this.bleManagerEmitter.addListener('BleManagerDidUpdateValueForCharacteristic', ({value, device, characteristic, service}, ...)

My AndroidManifest:

<uses-permission android:name="android.permission.INTERNET" />
<uses-feature android:name="android.hardware.bluetooth_le" android:required="true" />
<uses-permission android:name="android.permission.BLUETOOTH" tools:remove="android:maxSdkVersion" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" tools:remove="android:maxSdkVersion" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" android:maxSdkVersion="28" />
<uses-permission-sdk-23 android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />

If I build app as Debug - this working well - BleManagerDidUpdateValueForCharacteristic events working correctly

Im use react-native-ble-manager 11.5.5

@muramidaza
Copy link
Author

muramidaza commented Oct 3, 2024

When disabling proguard - everything works fine.

I edited the file proguard-rules.pro - add string

-keep class it.innove.** { *; }

Work well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant