How do I pause ios app when notification, ect. comes in

0 favourites
  • 7 posts
From the Asset Store
"Easy Local Notifications" enhances games with customizable local notifications.
  • Ashley Kyatric

    Hey just had a question regarding how to pause my ios app when notification, phone-call, pop ad, pull down menu is used, multitasking(double tap home button), accessing siri(hold home button), game center request sign in pop up box and i am sure there are many more. Right now, on my app when these things are being used the app still runs. I did try the browser object but thats only works for when the app is exited or put completely in background(home button pressed).

    Example: I use pull down menu and i can still see that the app in running behind it.

    I do have a pause menu i made so if i can just have a way when these things happen to "call for it" so that when you return to game its there and i can resume

    Programs using: I export with cordova and build using Intel XDK

    Ps: i am not a coder (thats why i love construct 2) or anything so i do very much appreciate these thing being explained in "detail" if you can please.

  • The game automatically pauses if it goes in to the background (e.g. pressing home button).

    Notifications and other overlays do not pause the game by design. I'm not sure apps can actually detect these events anyway. You should probably just provide a way for the user to pause the game themselves.

  • Ashley

    I'm not sure apps can actually detect these events anyway. You should probably just provide a way for the user to pause the game themselves.

    They do, for example the original flappy bird did this. When ever the pull menu was used or app pop up even a phone call the game paused.

    I do have a pause menu that works great for my game but i just wanted it work for when ever stuff like this happened( pull down menu, phone call, ads, ect)

  • Hello BlackFalcon7842,

    Did you find a solution for this?

    I am currently trying to do the same with INTEL xdk and no luck so far,

    Thanks in advance for your help,

    BR

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • jonathanbencomo no i didnt did you?

  • BlackFalcon7842 yes I did solve this issue.

    I apologize for not posting it over here for the rest to see, I have been crazy busy with a project I am currently working on.

    So investigating about the issue I came across the following post:

    https://issues.apache.org/jira/browse/C ... 0~%20pause

    in there I found the following:

    "// register these after deviceready event fires

    document.addEventListener("resign", onResign, false);

    document.addEventListener("active", onActive, false);

    function onResign() {

    console.log("on resign");

    }

    function onActive() {

    console.log("on active");

    } "

    So put that line of code in the script part of your index.html file inside intel xdk develop tab and your game now should pause and resume when the menu bars are displayed in iOS - it worked perfectly for me.

    Also most of the issues I had when developing for iOS were solved once I started using the WKWEBVIEW exporting option in C2 and also using that plugin when building the app. I used to have audio issues with iOS 9 and some other issues but after installing that plugin everything went well (and also performance improved) / so I highly recomend you to use that plugin in your builds.

    I hope this helps you with your issue!

    BR

    Jonathan

  • jonathanbencomo wow thanks yea should work great takes ill try it out!

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