Skip to main content
Jul 25, 2012 4:23 PM UTC
Answered

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

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 is closed to new replies. Start a new post to keep the conversation going.
mbhagya
mbhagyaCorrect answer
Participating Frequently
Jul 26, 2012 3:24 PM UTC

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

Jul 25, 2012 10:56 PM UTC

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

Translate
mbhagya
Participating Frequently
Jul 26, 2012 9:29 AM UTC

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

Translate
Jul 26, 2012 11:39 AM UTC

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..... :/

Translate