1

I have an adobe AIR AS3 application for both Android and iOS. I have implemented all the necessary code with the help of revmob's great technical support team. My problem now is if the user originally was not connected to a wifi or cellular network, the session won't start, thus the banner won't show nor the video, which is normal.

The problem is, when the user switches back to connected, the banner won't show, so i'm guessing the session didn't start.

How can i keep trying to start the revmob session, depending on when the user gets connected? in other terms, how can i restart the session as soon as the user gets connected?

Elias Rahme
  • 2,226
  • 3
  • 28
  • 53

1 Answers1

2

You can see how to create a ConnectionChecker class to check for a internet connection in this link . After creating a ConnectionChecker instance, you can call it and call the startSession method when connection is successful.

Following the link, your code will look something like this:

var checker:ConnectionChecker = new ConnectionChecker();
checker.addEventListener(ConnectionChecker.EVENT_SUCCESS, checker_success);
checker.addEventListener(ConnectionChecker.EVENT_ERROR, checker_error);
checker.check();

private function checker_success(event:Event):void {

    // There is internet connection, so call startSession
    revmob = new RevMob(< YOUR_APP_ID>);
}

private function checker_error(event:Event):void {

    // There is no internet connection, do nothing
}

Best regards,

Community
  • 1
  • 1
Wilson Dong
  • 165
  • 8
  • This code works well on android devices, but does not work on iOS devices. I have tried to discuss this issue in another thread on SO and didn't find the way to make it work on iOS. And i tried to reach the person u linked me to several days ago, this code only worka for android, how can i use it for both? – Elias Rahme Oct 15 '16 at 08:44
  • Elias, unfortunately we have limited resources do deal with platform specific issues. I will have a look into this whenever possible. Hope you can understand – Wilson Dong Oct 17 '16 at 15:20