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

Get help using Construct 2

Post » Tue Aug 11, 2015 6:03 pm

@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.
Check out my apps:Apple App Store!
B
12
S
5
G
1
Posts: 34
Reputation: 1,538

Post » Wed Aug 12, 2015 10:05 am

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.
Scirra Founder
B
395
S
233
G
88
Posts: 24,376
Reputation: 193,842

Post » Wed Aug 12, 2015 6:18 pm

@Ashley
Ashley wrote: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)
Check out my apps:Apple App Store!
B
12
S
5
G
1
Posts: 34
Reputation: 1,538

Post » Tue Jun 21, 2016 12:35 pm

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
B
9
S
3
Posts: 12
Reputation: 653

Post » Fri Aug 26, 2016 11:15 pm

@jonathanbencomo no i didnt did you?
Check out my apps:Apple App Store!
B
12
S
5
G
1
Posts: 34
Reputation: 1,538

Post » Sat Aug 27, 2016 6:06 pm

@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
B
9
S
3
Posts: 12
Reputation: 653

Post » Mon Sep 05, 2016 6:38 pm

@jonathanbencomo wow thanks yea should work great takes ill try it out!
Check out my apps:Apple App Store!
B
12
S
5
G
1
Posts: 34
Reputation: 1,538


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, R0J0hound, trance and 22 guests