Skip to main content
July 25, 2012
Answered

Calling FREDispatchStatusEventAsync from my IOS native extension goes nowhere. What do i do?

  • July 25, 2012
  • 7 replies
  • 2857 views

I'm stuck at this point. We've developed a native extension so that our product can run on the desktop and on android, but on IOS.... i can't get any data back to the flex side.

The function i use is:

void SendMessageToFlex(const char* type, const char* msg) {

     FREResult res;

     res = FREDispatchStatusEventAsync(_ctx, (const uint8_t *)type, (const uint8_t *) msg);

     if (res == FRE_INVALID_ARGUMENT) {

          NSLog(@"Error: FREDispatchStatusEventAsync");

     } else if (res == FRE_OK) {

          NSLog(@"OK: FREDispatchStatusEventAsync");

     } else {

          NSLog(@"???: FREDispatchStatusEventAsync");

     }

{

also... the project is here:

http://www.4shared.com/zip/y6MHvPh9/UDPSocketiOSLibrary.html?refurl=d1url

This topic has been closed for replies.
Correct answer mbhagya

ah... weird... i found out they were coming in... just the "level" property on the status event... on the flex side.... had a value of "A?" ??? is it passing the pointer?


The variable you're passing as an argument to the level parameter is a NSString.

[UDPSocketAdapter.m] Line 221 sends 'msg' (which is a NSString) as the second argument to 'sendFunc' which is incorrect. It should be a 'const char *'.

Please send "[msg UTF8String]" as the second argument to sendFunc instead.

7 replies

July 25, 2012

weird... just noticed that the status events do eventually propogate up to flex.... just not immediately. anybody have any idea why?

mbhagya
Participating Frequently
July 26, 2012

Hey,

I looked at  your project and it looks like you're calling the FREDispatchStatusEventAsync method only when it receives a particular type of message (REPORT).

It might be a network issue or it might be that the "REPORT" kind of packet is delivered after some time.

As of today, the method FREDispatchStatusEventAsync should work fine.

-mayank

July 26, 2012

well.... i'm able to watch the console when i run it... and i can see FREDispatchStatusEventAsync getting kicked off by the nslog statements showing up. so... it's getting kicked off.... just doesn't show up on the flex side till later. i wonder if it's getting queued somehow and that queue is not being processed in a timely manner..... :/