Blank "Square reader" screen after enabling bluetooth
Describe the issue
Both on my device and emulator running Android 12 I am getting the following screens.
(see screenshots)
To Reproduce
As you can see, when attempting to connect to the reader, I get asked the permission options (I have already granted the Bluetooth one when the app opens)
I enable each one, and on clicking on Enable Bluetooth I get the blank "Square reader" screen.
No reader ever appears to connect to, and there are no other options other than to close that screen and return to my RN app.
Expected behavior
I have had this repo running successfully on RN 0.62 for some time, so I know the app code is correct (and it matches your docs), but I needed to update to RN 0.69, and this is the last component that does not work.
On this screen I used to see information on how to connect the reader, and it would then connect to it when following the instructions, but now I only get a blank screen.
Environment (please complete the following information):
- platform: Android
- OS and version: Android 12
- dev environment: MacOS
- Reader SDK version: 1.7.1
System: OS: macOS 12.0.1 CPU: (12) x64 Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz Memory: 29.68 MB / 32.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 14.18.2 - ~/.nvm/versions/node/v14.18.2/bin/node Yarn: 1.22.19 - ~/.nvm/versions/node/v14.18.2/bin/yarn npm: 6.14.15 - ~/.nvm/versions/node/v14.18.2/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.3 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3 Android SDK: Not Found IDEs: Android Studio: 2021.1 AI-211.7628.21.2111.8139111 Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild Languages: Java: 14.0.1 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.0.0 => 18.0.0 react-native: 0.69.5 => 0.69.5 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Screenshots

Additional context
@CharmisG Is there any update on this? This is undermining our ability to release the Android app which processes millions of Dollars in revenue. Does this need escalating to our Square account manager?
@CharmisG Any update?
Has anyone else replicated this behavior on the latest version on an Android 12 device?
That this is about Bluetooth permissions and Android 12 is telling; Google changed how those work as of that Android release. It's supposed to work for Reader SDK 1.7.1, but that's new. If you can play with the target SDK level, at API 30 or less the old permission rules should apply, which might avoid this issue.
@fka3 I've tried building the quickstart app with targetSdkVersion set at 30 and result is the same. The screenshots are taken from the latest download of the quickstart app on an Android 12 device. Can you get it to run on an Android 12 device successfully?
Well, dang it, it did when I cut that branch, but no, didn't just now. [Unprintable words here.]
Ok, back to API31 for me. You might check; there are two Bluetooth permissions that matter, but "dangerous" (per Google, because they imply location data) and needing user confirmation. If you can grant--- and I don't know enough React to know if this is possible---both BLUETOOTH_CONNECT and BLUETOOTH_SCAN outside of Reader SDK, that should at least avoid the issue.
But I'll try to figure out what went wrong (and how it worked for me at first!)
No, actually, it does work for me; we just had the code with permissions set back to API 30's permissions.
Two questions:
- When you say you "tried building the quickstart app with targetSdkVersion set at 30," what did you edit? If you only changed the target SDK, it probably should have failed to compile because of the new permission names... but you should have to edit both AndroidManifest to remove the new permissions, and also build.gradle to set the target SDK; did you adjust both?
- Although I definitely suggest that we should explore with quickstart, the real target is your react app; is it possible to pull the final AndroidManifest from that? (Failing that, could you send me the .apk and I can pull it?). What I want to check is the targetSDK of the manifest and the permissions requested by it; they should be consistent. Either the targetSDK should be 30-or-less and the strings BLUETOOTH_CONNECT and BLUETOOTH_SCAN should not appear, or the target SDK should be 31-or-more and both should be requested.
Having realized that my test app was inconsistent, I'm now seeing working behavior targeting and running on 31/Android 12. I can do the test of targeting 30 while running on 31, if that's your target SDK?
@fka3 @mormrod is this problem resolved? Should we close this issue now?
I'd've liked the customer/developer to confirm, but yes, from what I observed, things work properly and the ticket can be closed. If @mormrod disagrees, we can reconsider.