Android "push-notification" and possibility to run game in background [GMS 2]

C

c0dycZ

Guest
Hi, 2 questions from a beginner to get to know if GMS 2 is the right IDE for my Android-Game idea.

I want to make a game that can send push-notifications to the smartphone if the attention of the player is required for a specific action. Therefore a found push_local_notification() in the helpfile.

My first problem is that the helpfile uses var fireTime = date_inc_day(date_current_datetime(), 1);
to set the day and time to appear, but how should i write it to appear at same day with a specific time of day?

My second, bigger problem i think, is that some processes of the game should still run in the background if the game is not in foreground or the smartphone is locked while game is running. (To call specific event in the game if the user didn't pay attention for a while)

Is there a switch or variable in GMS 2 to deactivate the automatic pause of the game when user lock the smartphone or minimize the app?

Thanks for every help!
Greets, Chris
 
I

iam1me

Guest
It's been a little while since I've messed with Android development, but I'm pretty sure that to solve #2 you are going to need to create a background service - which I wouldn't expect GMS2 to be directly capable of (since GMS is designed to be single-threaded). However, you might be able to get around this via native coding.

EDIT: Alternatively, try recording and checking the time span between iterations of your main loop. You can adjust your actions based upon the amount of time that has passed.
 
C

c0dycZ

Guest
hi, thxs for you reply!

The idea with work off the actions by passed time was my alternative, too. But i have concerns that in worst case the user is inactive for few days and the actions may take to long to proceed or even are not good to realize. But i will give it a try if anyone hasn't a good alternative. ;)
 
Top