Android - how can I send notifications from the game I made to the user’s device
I don’t think it’s possible with normal events. You may have to try it with javascript (sorry I don’t know it so I can’t help with that) but there is an extension called popups, where you can make popups/errors appear on the screen.
I made this extension, it does exactly what you want, you can send device notifications and in app notifications using Onesignal
I tried it without success. It does not create a user on the site and does not subscribe
Did you turn on notifications in the app settings on your phone? It’s required for android 13 and i think 12 devices.
Okay, I’d take a look at it again. Also did you add the action to initialize the extension, and did you place your key in there?
yes🙏 i add the extension, and i place my key, thanks you!
How can I request permission for an notifications from the user as soon as enter to the application?
Hey, I just updated the extension, it now uses one signal 5.0.0, I’ve added the action you requested.
You can download the update in the PR or in this gist →
Hello,
Thank you for your amazing contribution.
I am trying to integrate the extension but somehow I am not able to register new subscribers.
I followed the guide bellow
1/ Activate Firebase Cloud Messaging API (V1)
2/ Generate a Private Key JSON file (Node.js)
3/ Activate the platform Google Android (FCM) in OneSignal (In the part “Select SDK” I tried both Native android and Cordova)
4/ Download and import the extention in Gdevelop (Onesignal GDevelop Extension · GitHub)
5/ Integrate it as follow :
Beginning of the first scene >
- Request Notification Permission : TRUE
- Initialize Onesignal (My app ID + user must consent TRUE)
I tried the application using mobile manual build and mobile One-click packaging. I tested the .apk in a real phone and in android studio virtual devices (with playstore installed).
I checked, the notification is allowed.
But still, when I launch the application no new subscriber is registered in OneSignal.
Thank you in advance for your precious time.
Hello, I also cannot seem to get this to work… Would you possibly be able to make a video on this topic that we can follow? It would be greatly appreciated. I specifically would want a push notification to be sent to one phone if someone on a different phone sneds them something. I understand your time is valueable so if you cannot make a video on this topic it is not a problem.
Even if I did get this to work, I’m not sure I understand how to even send a push notification with the actions available with the extension… is this extension capeable of sending push notifications in IOS/ Andriod when a player is completely offline? I would like the push notifications to be sent out if another player initiated it (like you could “nudge” your friend to get on). Any guidance on this topic would be very appreciated and I appreciate the work youve already done in the Gdevelop community
Hello, I think the platform “oneSignal” made some major changes recently. I doubt this extension would work.
At the time of creating the extension, you could not send push notifications when the player was offline, sending notifications required you to make use of the one signal dashboard.
I can take a look and fix the extension.
Hi there, just showing my interest in this extension. I’m afraid I can’t help in making it work as my coding knowledge is really poor, but if I can help with testing I’ll be happy to. I’m currently making a Tamagotchi-like game so push notifications would be a must, ideally even when the app is closed but as far as I know it is not possible right ?
Thanks for the response! I was wondering if you had the chance to take a look into this? I’ve made a pretty complex app/game (at least on my standards) and really need this feature or else the game will loose a lot of value. If you haven’t looked into it that’s no problem but would you have any suggestions on starting points or ideas for me to dive into this and get a way to send notification that one player can send another. It could be via text message but ideally it could be via a push notification.
Hello, @Cosmic!
So… I’ve finished my Toast and Supabase extensions and am working on a local notification extension.
I used cordova-plugin-local-notification
… and it works:
Since I’m busy, it might take time and I can’t put any deadlines + for mobile exports only!
This looks like great progress! A lot better than what I managed to do… any idea once your complete (no rush) if you will be able to send a push notification to a one device based off the actions of the actions of a different device. For example, if I beat my friends high score on a game, could it notify my friend? Again great work!
Sorry but local notifications, the extension I work on, don’t work like that.
What you are asking for requires a server and I expect that the OneSignal extension could do this if Gem Dev have updated it.
My extension may be used to send a notification when a player regains lives, a reminder to play or an event on a specific date, etc.
You can download it from the pull request but it is kinda primitive:
Thanks, I really appreciate the information and what you have will definitely still be very useful. I have a server set up and it works great for sending things between two or more players, unfortunately, I just can’t seem to send push notifications in a similar way. I’ve looked into the one signal however, I can’t seem to get it to work and even if I could, I don’t think it would do what I need it to do. I’ll keep looking into this and hopefully this feature will be added soon! Thanks for all your help again.