Comments (24)
@ViRGiL175 I'm sure that in Godot 3.2.4-stable will be new convient iOS plugin support. I'm going to update all my plugins to the new way when stable godot was released.
This new system will add some comfortable control to the plugin user, but it will not solve much plugin developing problems. My plugins code is very OS dependent and very often I should develop two different plugins with the same (or similar) interface to make their usage more simple.
@TIBI4 Yes, remote notifications for Android is not clear now. At first I'm going to make firebase-notifications plugin (because I use it for my projects) and later may be I will make more universal solution for android push notifications.
from godot-local-notification.
@tigz19 Hello!
For scheduled notifications you should use method show(message: String, title: String, time_delay_in_seconds: int, tag: int)
. When your app is closed the OS will fire notification in system tray. The user can tap on notification and your app will be opened by it.
For remote (push) notifications the algorithm is dependent on using OS.
For iOS you should do:
- check if notifications
is_inited
, it means that application requested permissions from user. - call
init
if app didn’t requested it yet. - catch signal
enabled
or check methodis_enabled
. It will returnfalse
if user didn’t grant you permission. - get device token (
get_device_token
) for push notifications or catch signaldevice_token_received
- send your device token to the server side.
That’s all. Sending notifications processed by your server, receiving notifications processed by OS.
For Android of course the best notification solution is Firebase messaging. But I didn’t make new plugin for it yet.
Now I only have old C++ module for Godot 3.1 https://github.com/DrMoriarty/godot-firebase but I’m not sure that it will compile for newest Godot.
from godot-local-notification.
Thanks for your nice libraries, @DrMoriarty
I see the documentation for Android plugins, I know the Android SDK, and it looks good for bundling Android and Godot functionality.
Do you know anything about the status of Godot's iOS plugin support?
As far as I understand, it will be much more convenient to create cross-platform libraries if such plugins are available for all platforms.
from godot-local-notification.
I have seen that you made this awesome plugin, DrMoriarty.
But the only thing I don't know how to do is a remote notification, and how will it work on Android. I know there is a register_remote_notification function, but I dont know it's parameters. Can you update the Usage section of the repository and add some example case (Firebase/custom)?
Maybe I haven't seen the documentation, but it doesn't seem to be one though. If there is one, can you share it with us?
Thanks in advance!
from godot-local-notification.
@DrMoriarty HI, the token that I can get with this module is a token that I can use with Cloud messaging to send a notification to that device? Or the token that use FCM is other token?I mena is a registered token?
from godot-local-notification.
Do you have firebase-notifications plugin already? @DrMoriarty I tried with the firebase-core and cloud messaging, but it doesn't seem to work
from godot-local-notification.
I just released https://github.com/DrMoriarty/godot-firebase-cloudmessaging
try it
from godot-local-notification.
@DrMoriarty That´s only on Android?
from godot-local-notification.
@DrMoriarty from native it say that is on Android and iOS but it is crashing on iOS, Installing firebase cloud messaging plugin from native and connecting the methods it should be enough? Also the framework in xcode is not there
from godot-local-notification.
@DrMoriarty on Android:
from godot-local-notification.
@martinpelli Put file google-services.json
in folder android/build
from godot-local-notification.
@martinpelli it is for Android now. iOS version will be ready soon. Now I'm updating all my iOS plugins for support new godot 3.2.4 (with new iOS plugins interface). I hope plugins will be available during the week or so on.
from godot-local-notification.
@DrMoriarty Thanks so much for this great library, much time saver
from godot-local-notification.
@DrMoriarty I am getting these errors:
**ERROR**: Condition "err" is true. Returned: err
03-15 14:32:11.843 3691 3771 E godot : At: modules/gdscript/gdscript.cpp:829:load_source_code() - Condition "err" is true. Returned: err
03-15 14:32:11.843 3691 3771 E godot : **ERROR**: Cannot load source code from file 'res://Scripts/messaging.gd'.
03-15 14:32:11.843 3691 3771 E godot : At: modules/gdscript/gdscript.cpp:2315:load() - Condition "err != OK" is true. Returned: RES()
03-15 14:32:11.844 3691 3771 E godot : **ERROR**: Failed loading resource: res://Scripts/messaging.gd. Make sure resources have been imported by opening the project in the editor at least once.
03-15 14:32:11.844 3691 3771 E godot : At: core/io/resource_loader.cpp:279:_load() - Condition "found" is true. Returned: RES()
03-15 14:32:11.844 3691 3771 E godot : **ERROR**: Can't autoload: res://Scripts/messaging.gd
03-15 14:32:11.844 3691 3771 E godot : At: main/main.cpp:1766:start() - Condition "res.is_null()" is true. Continuing.
03-15 14:32:18.572 3691 3771 E godot : **SCRIPT ERROR**: Invalid call. Nonexistent function 'connect' in base 'Nil'.
03-15 14:32:18.573 3691 3771 E godot : At: res://Scripts/Reserve_Script2.gdc:57:_ready() - Invalid call. Nonexistent function 'connect' in base 'Nil'.
the weird thing is that on windows I am not getting this errors, the autoload is there on res://Scripts/messaging.gd and the script is there so I don´t understand
from godot-local-notification.
As I said I am not getting the errors when executing on Windows
Using Messaging.connect('token_received', self, '_on_token_received')
from godot-local-notification.
It seems that you have issue with upper case symbols in folder name. Usually plugins install their gd-wrapper to scripts
folder (all lower case). In Windows there are no difference in lower/upper case folders, but on mobile phones (both Android and iOS) filesystem differs cases in file and folder names.
from godot-local-notification.
@DrMoriarty yeah I tought that but I tested it changing name to scripts and I am having the same problem , so I am gonna try another way, thanks
from godot-local-notification.
Try to close Godot and check your project.godot
file, section [autoload]. It can be written there in wrong case.
from godot-local-notification.
Also you can check your APK file (it just zip archive). You can see your folder names how they are stored inside.
from godot-local-notification.
@DrMoriarty yes thanks! I am seeing that although I have changed the name of the folder , all the routes are still with the capital S, so I am fixing everything
from godot-local-notification.
@DrMoriarty so after solving my problem, I can get the token so it´s working!! Thnaks! Now I have two problems:
when sending from firebase console to my device, I can get a message trough the logcat,but there is no notification:
{from:201898469024, messageId:0:1615850189342089%8e6bc0f98e6bc0f9, messageType:Null, notification:{body:NotificationNotificationNotification, title:Notification}, senderId:201898469024, to:Null}
Also I tried sending a notification to a token via http with the token that I get with your plugin , and this url: "https://fcm.googleapis.com/fcm/send"
I can´t get the notification in the device and I am receiving this result body:
{"multicast_id":1245017623099266055,"success":1,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1615850167221938%8e6bc0f98e6bc0f9"}]}
before without the plugin, I was getting failure:1, so the token is working, but the notification is never shown
from godot-local-notification.
@DrMoriarty Edit: IT´S WORKING!! The only problem now it´s that the user on the cellphone has to enable floating notifications, the sound of the notification and the notification on phone lockscreen for the app/game. Or maybe this is done automatically when uploading to playstore?
Thanks you are a Master!
from godot-local-notification.
Yes, if user don't enable notifications (or disable it) the app will never show any popup.
But we (game developers) have no ways to affect on this. This is the task only between the device user and OS.
from godot-local-notification.
Same issue as martinpelli but I didn't find how to solve it. In my app I have:
func _ready():
messaging.connect('message_received', self, '_on_message_received')
func _on_message_received(message: Dictionary) -> void:
$Label.text += "Message received: %s\n" % str(message)
When my server sends a message using "https://fcm.googleapis.com/fcm/send", the app shows the JSON in the mobile, so I know all the token part is right and the messaging chain is working. No notifications are shown. Local notifications are shown normally. Did I miss a step somewhere?
Edit: nevermind, got it working. Problem was on server side ("notification" field was missing in the data array).
from godot-local-notification.
Related Issues (20)
- Get Token not working HOT 8
- Can't get cancel for android notifications to work. HOT 5
- please delete
- Note for iOS users HOT 1
- Feature request: provisional notifications for iOS
- repeating_interval seem working wrong HOT 5
- [iOS] no sound for local notification HOT 2
- [ios] Enhancement for ios repeating notification
- Can't get device token in Android HOT 1
- Repeating notification not working. HOT 2
- Quick actions without opening app itself
- Feature request : a why to change notification sound HOT 1
- Question about the implementation and running in background of the app.
- Notifications after reboot
- No library on current platform error from godot (Windows)
- Android trouble? HOT 17
- compile ios framework HOT 6
- Workability with Godot 3.5 or 3.51 HOT 5
- Invalid plugin config file HOT 1
- What's the license for this? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from godot-local-notification.