Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / the app is in the background

Author
Message
Engineer
9
Years of Service
User Offline
Joined: 16th Jul 2014
Location:
Posted: 24th Aug 2014 14:59 Edited at: 25th Aug 2014 00:34
Привет, для моего приложения требуется работа в фоновом режиме - оно должно получать сообщения от сетевого сервера постоянно. Как мне реализовать это в AppGameKit ?

Mod Edit: Please only ask questions in english. Google translate suggests this "Hi, my application requires work in the background - it should receive messages from the network server constantly. How do I implement this in AppGameKit?"
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 25th Aug 2014 08:19
Apps built with AppGameKit must be in the foreground for processes to happen. It is primarily a game engine and not built to run processes while minimized or in the background, though it will do so on Windows.

If you mean that the app should be constantly talking to the network to get data then you can do this with the SendHTTPRequestAsync() command. The online documentation provides examples as well as my blog (blog.naplandgames.com), which provides examples for sending files to the server. Also for a larger, real-world example, you could look at the AppGameKit Community Ad Network API which can be found via my blog as well.

Good luck!

Engineer
9
Years of Service
User Offline
Joined: 16th Jul 2014
Location:
Posted: 26th Aug 2014 19:46
the desired receive messages in the background from other players. as in Skype, when turn off the screen or is Facebook, but reports are coming in Skype and he makes a sound
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 26th Aug 2014 19:53
AGK has push notifications, but nothing more complex than that. Push notifications do not require that the app is active in the background. The online documentation tells how to set it up.
You'll also need a server capable of sending out the push messages.

Good luck!

Engineer
9
Years of Service
User Offline
Joined: 16th Jul 2014
Location:
Posted: 26th Aug 2014 21:36
as I understand, the notification mechanism works within the device and does not transmit the notification over the network.
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 26th Aug 2014 22:08
that's not true of push notifications
with pus notifications the message is PUSHED to the device via a network.

there are local notifications for iOS via AppGameKit, but I don't know if they work.

if you plan to create a multiplayer game the notification would be transmitted over a network... there is no other way to communicate between multiple devices, maybe blutooth or local network, but AppGameKit does not have the framework for notifications in that scenario

Engineer
9
Years of Service
User Offline
Joined: 16th Jul 2014
Location:
Posted: 26th Aug 2014 22:25
may be you are talking about the message and not about the notifications?
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 26th Aug 2014 22:36
I'm not sure what the difference is.
If you are talking about a push notification that appears in the notification bar on the android device there is no separation between "message" and "notification" they are the same thing.

There are 2 types of notifications on Android devices:
push notifications - you download an app, the app registers with the OS that it will receive push notifications, a server sends out notifications to the Google Cloud Messaging service, that service sends the notification to the devices over a wifi or mobile network.

local notifications - the app runs in the background and creates a notification when it receives certain information from a network or a timed event such as "it has been 24 hours since you played your health is restored". This is unavailable via AppGameKit for Android.

Both types require network connectivity. How else would one player communicate to another?

Facebook Messenger uses a hybrid, I believe. It receives a push notification with special data that wakes the app, the app then turns that data into a local notification with pretty overlays and such.

Most applications use only push notifications. It is composed of a notification that appears in the notifications bar and a message. Then when you tap the notification it will launch the app. The app will then look at the notification data and interpret it, usually it is a signal to obtain message text that was sent. Unfortunately with AppGameKit, we can just do a push message and the app cannot do anything with the data.

In my game, Wordspionage, we use push notifications to tell players that they've been invited to games, it is their turn, and other events. When they tap the notification it opens the app. When the app opens the app has to connect to our server to download the correct information.

If this is not what you are talking about please be more specific and I'll do what I can to explain further.

Engineer
9
Years of Service
User Offline
Joined: 16th Jul 2014
Location:
Posted: 26th Aug 2014 22:51
it's too good to be true

Login to post a reply

Server time is: 2024-04-26 08:03:56
Your offset time is: 2024-04-26 08:03:56