Closed dfeng99 closed 7 years ago
Are you calling this from the main thread?
If not, make sure you wrap the call in a dispatch_async:
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// your code here
});
I tested your code with the demo app and it worked fine:
Yes, thanks! I wrap it in dispatch_async and it works now! Thank you!
Can you explain a little? Since the code in the block is already an async call. I won't head to this solution without your help.
Well, I only got one time lucky, it's weird! most of the time, when I click on the message, it just simply dismissed without dispatch the event in the block.
I finally resolve the issue by moving the code inside the block to a local method and call this method within the block.
Great!
The callback block is not called when tapped on the message. The code is like this:
[[TWMessageBarManager sharedInstance] showMessageWithTitle:title description:body type:TWMessageBarMessageTypeSuccess duration:5.0 callback:^{ NSLog(@"Message bar tapped!"); FREDispatchStatusEventAsync(myCtx, (uint8_t)"MSG_BAR_IS_TAPPED", (uint8_t)[action UTF8String]); }];