Search code examples
iosobjective-cadsmopub

MOPUB, how can i create js event that talk to my native code (iOS)


I'm trying to create MOPUB ad that some things will be trigged by object-c method. Don't know how i can do that. I added mraid.addEventlistener('text', textEvent);

and

function textEvent(state){

alert("I am an alert box!" + state);

}

to js. So now its listening to textEvent event, but how can i trigger this from objective-C code so i can get that alert.


Solution

  • There is no standard way to do it. The only way is to customize sdk to listen to your custom event. This is what i got from MOPUB support.