How do I make an app run in background?

  • Hi

    I would like to make a tamagotchi style game for android but my problem is that the app gets paused when it's not active. That means that I can't trigger events every X minutes. Is there a way to make sure the app is still running even if it's in background?

    Thank you

  • This gets asked a lot and unfortunately you can't do it. It's possible to do something with variables/time to compare how long has passed since you closed it but other than that it will just be suspended.

  • Thank you for your reply, but what about apps like Viber? I get notifications (with sound) even if my screen is locked...

  • We actually have those features in the Construct Master Collection. Although, since this is funded by the supporters, it's not free.

    You are looking for the Mobile Sleep and Mobile Notifications plugins.

    You can take a look here, if you want: construct.net/en/forum/construct-3/plugin-sdk-10/construct-master-collection-en-139046

    Have a nice day.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • plinkie's reply.

    This gets asked a lot and unfortunately you can't do it. It's possible to do something with variables/time to compare how long has passed since you closed it but other than that it will just be suspended.

    This should do the rest for the other features when you get back from the game. You compare the time and date rather than make your game run in the background to save power like how most apps do. You can use Server Time where you use an online time to avoid cheating where PlayFab can help you there implement it easily.

    But if you want it offline, you can use the local device time.

    I hope that helps.

  • Mobile Notifications

    I believe this is what you meant by in-background notifications with sounds even when locked seen on messaging apps like Viber.

  • Yeah that will be Push Notifications usually based on something ready in the app or a 24 hour delay. I've used Urban Airship before where you can send Push to users whenever you want.

    chadorireborn ooo you have plugins to do this that's nice, there is some hope then for people who keep asking this question ^^

  • Yeah that will be Push Notifications usually based on something ready in the app or a 24 hour delay. I've used Urban Airship before where you can send Push to users whenever you want.

    Yep. Although, you still have many options in this plugin I've made.

    (Rich Media Features)

    You have Local Notifications (Offline Background Events), Rich Media, Messaging and the regular Push Notifications. There should be more of those but for those who want them have to experiment it themselves.

  • Dam they look well worth the $100, good stuff :) What does 'Mobile Sleep' do? Maybe that resolves some problem OP is having.

  • The Master Collection looks amazing :) My problem is I would only like the mobile part of it. As far as I can tell it's not possible to buy just one part. But is it perhaps possible to split the Master Collection to different accounts? For example, I get the Mobile Master and a friend of mine gets everything else.

    Thank you

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