How to Resolve Rctpromiseresolveblock After Bftask

How to bridge a Swift Promise to React Native

Found the answer, Just had to add @escaping to the arguments:

@objc func fling(_ options: NSDictionary, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void {
...

ReactNative native-modules Promise passing field and in Swift

I was able to figure out how to get resolve the problem. Here is the solution for anyone who might need

GuidedTourInterfaceBridge.m

RCT_EXTERN_METHOD(readFile:(NSArray *)arr resolve:(RCTPromiseResolveBlock *)resolve reject:(RCTPromiseRejectBlock *)reject)

GuidedTourInterface.swift:

  func readFile(_ arr: NSArray, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) -> Void {

JS File:

var result = await guidedTourInterface.readFile([this.props.mapToShow+"/info.json"])
.then((result) => {


Related Topics



Leave a reply



Submit