Messaging C2 from IOS using Objective-c / passing variables

0 favourites
  • 3 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • I am running into an issue which is explained in another post:

    Basically I want to pause a game when an iAd is triggered / touched.

    I believe a possible solution is to set a variable (for example: "AdActive") from objective-C when the banner is touched, that C2 can read as a condition.

    The code itself within Objective-C is:

    • (BOOL)bannerViewActionShouldBegin:(ADBannerView *)banner willLeaveApplication:(BOOL)willLeave

    {

    NSLog(@"Banner view is beginning an ad action");

    BOOL shouldExecuteAction = YES;

    if (!willLeave && shouldExecuteAction)

    {

    // stop all interactive processes in the app

    // ;

    // ;

    }

    return shouldExecuteAction;

    }

    • (void)bannerViewActionDidFinish:(ADBannerView *)banner

    {

    // resume everything you've stopped

    // ;

    // ;

    }

    But I cannot figure out what kind of variable I can set or how, that could be later read by C2..

    Any ideas, any Objective C and C2 gurus?

  • Is the game running inside Ejecta or Webkit ?

    For ejecta you would have to first bridge Obj-C with Javascript: http://impactjs.com/ejecta/extending-ejecta

    Then you need a bridge from Javascript to C2 objects. One solution would be creating a custom plugin:

    https://www.scirra.com/manual/15/sdk

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Cross_,

    Thank you for your answer.

    I need to try this now!

    And it is Ejecta!

    I am sure it will take me some time to figure it out!

    Thank again!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)