Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

203
Views
Why native function written in objective C is is not returning anything?

I am trying to get output from native function to use in frontend, here is the function,

RCT_EXPORT_METHOD(getActiveAudioDevice:
                 resolver:(RCTPromiseResolveBlock)resolve
                 rejecter:(RCTPromiseRejectBlock)reject)
{
  MediaDevice * _Nullable  devices = [meetingSession.audioVideo getActiveAudioDevice];
  NSLog(@"Hello Devices: %@", devices);
  
  if (!devices) {
    reject(@"event_failure", @"failed to list audio devices", nil);
  } else {
    resolve(devices);
  }

}

I am triggering it in JS like this ,

const selectedAudioDevice = useCallback(async() => { 

       const activeDevice= await NativeFunction.selectedDevice("")
       setActiveDevice(activeDevice) }

When I trigger this from frontend I can see in logs that Native function is returning a device but in JS all I get is undefined, any idea what I am doing wrong here ?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!