Closed tiagotwistag closed 3 years ago
getConnectedDevices
is a new method that was added in the latest version, so I must have missed adding the rejecter
parameter to the method parameters.
@objc
func getConnectedDevices(
resolver resolve: RCTPromiseResolveBlock,
rejecter reject: RCTPromiseRejectBlock
) -> Void {
rejecter is there.
RCT_EXTERN_METHOD(getConnectedDevices: (RCTPromiseResolveBlock)resolve
rejecter: (RCTPromiseRejectBlock)reject)
rejecter is there.
It looks like it's calling the method with just the rejecter and not the resolver. This is probably because of the FIRST parameter thing in swift/objective c (which I can't stand). It probably needs to be updated to _
so that it picks up the right one.
Looking at getBondedDevices
it has the correct structure:
@objc
func getBondedDevices(
_ resolve: RCTPromiseResolveBlock,
rejecter reject: RCTPromiseRejectBlock
) -> Void {
I'm assuming getConnectedDevices
just needs this format.
Hey, thank you so much for the fast awnser
I edit the RNBluetoothClassic.swift directly on the node modules and tried to run the project again and seems that the problem persists, I'm not sure if I'm missing something
func getConnectedDevices( _ resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock ) -> Void {
I'm not sure - I'm definitely not an IOS developer and I don't particularly like the Objective C or Swift languages. I also don't have time at this point to fire it up and play around to try and get it working (I apologize).
If you can sort it out I'll definitely accept a pull request.
Otherwise you'll have to wait until I get time to play around with it some more.
Mobile Device Environment Provide a list of operating systems on which this issue is relevant.
Application Environment Provide information about your development environment:
Describe the bug When running the project on iOS the following error pops when calling the method getConnectedDevices,
After some testing I noticed that only this method seems to be having problems to run iOS(also it works fine on android), any clue what could be the issue or the fix here?
Expected behavior The method to be available and working iOS