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 / push notifications

Author
Message
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 22nd Nov 2017 21:11
i saw the example here but it seems to require more than tier 1, is there not a way to send a push notification from tier 1 only?
i'm trying to notify player's in a turn based game when it is their turn (if the app is not currently running), is this just not possible for me?
life's one big game
spec= 4ghz, 16gb ram, AMD R9 2700 gpu
Kevin Cross
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 22nd Nov 2017 21:51
That example does require a web server running PHP scripts but the example shows the PHP code. It all works on tier 1. I used that example to set it up in my app.

I did originally think the code needed updating because I was having problems with tokens being generated as blacklisted (https://forum.thegamecreators.com/thread/220825) but I found out that the blacklisted tokens were created from the bots Google use to check the app before it's published.
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 23rd Nov 2017 09:00
Yh, sorry, I saw that but I have no idea what a php web server is or how I would reference the function from within AppGameKit if its being run in a different program (if I try the function from within agk it returns lots of errors).
I was hoping there might be a way to call a similar function from within AppGameKit but I guess if there was then it would have been put in the example instead...
Or can we make agk run php code somehow?
life's one big game
spec= 4ghz, 16gb ram, AMD R9 2700 gpu
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 23rd Nov 2017 13:19
if you know what this php skript send to google, it could be possible from a tier1 app with Sockets from android or pc.
i believe the http commands can not modify the http header.


AGK (Steam) V2017.09.25 : Windows 10 Pro 64 Bit : AMD (17.11.2) Radeon R7 265 : Mac mini OS High Sierra (10.13)
Kevin Cross
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 23rd Nov 2017 13:42 Edited at: 23rd Nov 2017 13:44
I'm not aware of another way to notify another player that it's there turn if they're not on the same local network. Is this a mobile game, desktop or both? Do you already have something working where two players from across the world can play each other but you're just missing the notifications? If so how do you have that working? How are you sending data back and forth between the two players? I can't see how that would be possible without some server in the middle.

You could look at services that offer free PHP hosting and access to MySQL data where you can store the game data and the users tokens so that they can be notified. I did a quick search and found this one. I've heard of them but have never used them so you'd have to look into the small print to see if it's completely free and if it's only free for the first year or so etc.: https://www.000webhost.com/free-php-hosting I probably wouldn't use it for the final release of your game but it might be a good testing ground to get your head around the PHP files and databases etc.
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 23rd Nov 2017 13:56
it would be using the same wifi and ideally mobile.
normally in multiplayer i just use the normal network messages but of course these can only be received when the app/game is actually running.
i was hoping push notifications would be similar to local notifications (which work fine but have no way to be influenced by other players so they're only good for timed events, not the more active notification that i was looking to achieve) but able to be sent from the other player - it seems not.
life's one big game
spec= 4ghz, 16gb ram, AMD R9 2700 gpu
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 23rd Nov 2017 14:53
i saw there is an
old Google Cloud Messaging (GCM)
and
new Firebase Cloud Messaging (FCM)
notification system.

someone know if FCM also work with which Android version to AppGameKit?

https://developers.google.com/
AGK (Steam) V2017.09.25 : Windows 10 Pro 64 Bit : AMD (17.11.2) Radeon R7 265 : Mac mini OS High Sierra (10.13)
Kevin Cross
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 23rd Nov 2017 15:41
@smallg I'm not sure what options you have for this. Sorry

@Markus you can only set up FCM in the Play Console now I believe. I have FCM running in my app using the TGC example code. It was a little confusing working out what id's and keys to use setting it up (specifically on the Play Console side) but once done it works fine.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 23rd Nov 2017 17:07
@Kevin Cross
Quote: "you can only set up FCM in the Play Console now I believe."

ahh thanks i found it beside dev tools / services & apis
AGK (Steam) V2017.09.25 : Windows 10 Pro 64 Bit : AMD (17.11.2) Radeon R7 265 : Mac mini OS High Sierra (10.13)
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 23rd Nov 2017 17:27 Edited at: 23rd Nov 2017 17:32
here an example of self push i tested at android. its maybe useful if you limited the your turn time.
AGK (Steam) V2017.09.25 : Windows 10 Pro 64 Bit : AMD (17.11.2) Radeon R7 265 : Mac mini OS High Sierra (10.13)
CumQuaT
AGK Master
14
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 27th Nov 2017 07:50
But does the example listed in the original post support push notifications appearing on users' phones when the app isn't actively running, or is running in the background?
Help out a fellow dev! Download and rate my games! They're free!

Wizzed Off! - (Android) (iOS)
God of Thunder - (Android) (iOS)
Extreme Lawn Mowing - (Android) (iOS)
Drunken Heroes - (Android) (iOS)

And you can get Fluffy Knuckleduster merchandise at our new store!
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 27th Nov 2017 08:54
@CumQuat I'm certain push notifications will appear even if the app is not active or running in the background. It will become active when a user clicks on the notification.
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 27th Nov 2017 12:50
yep, same as local notifications, they don't require the app to be open (of course permission must be given by the user for this)
life's one big game
spec= 4ghz, 16gb ram, AMD R9 2700 gpu
CumQuaT
AGK Master
14
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 28th Nov 2017 01:22
Fair enough!
Help out a fellow dev! Download and rate my games! They're free!

Wizzed Off! - (Android) (iOS)
God of Thunder - (Android) (iOS)
Extreme Lawn Mowing - (Android) (iOS)
Drunken Heroes - (Android) (iOS)

And you can get Fluffy Knuckleduster merchandise at our new store!

Login to post a reply

Server time is: 2024-11-24 06:24:14
Your offset time is: 2024-11-24 06:24:14