Open henrikbjorn opened 5 years ago
React Native exposes a RCT_REMAP_METHOD which will give a resolve and reject function as argument in the obj c code. This can be used to clean up the js code
RCT_REMAP_METHOD
resolve
reject
RCT_REMAP_METHOD(getCodecs, getCodecsWithResolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) { NSDictionary *codecs = [[PjSipEndpoint instance] getCodecs]; resolve(codecs); }
class Endpoint { getCodecs() { return NativeModules.PjSipModule.getCodecs() } }
React Native exposes a
RCT_REMAP_METHOD
which will give aresolve
andreject
function as argument in the obj c code. This can be used to clean up the js code