godot-local-notification icon indicating copy to clipboard operation
godot-local-notification copied to clipboard

Get Token not working

Open martinpelli opened this issue 3 years ago • 8 comments

Hi on godot 3.2.2 and 3.2.4 on iOS, the module init perfect and I can get the request for notifications but when getting the token is not working (is not printing)

martinpelli avatar Mar 08 '21 15:03 martinpelli

Show me the code do you use?

DrMoriarty avatar Mar 08 '21 18:03 DrMoriarty

I just use the same script that is in the project, I put it as autload and then

Localnotification.init()
Localnotification.is_enabled()
Localnotification.get_device_token()

martinpelli avatar Mar 08 '21 18:03 martinpelli

you should not call get_device_token if is_enabled not return true also you may want to connect Localnotification's signal enabled to your method where you can get device token (because event enabled fired when user grants permission for using notifications)

DrMoriarty avatar Mar 08 '21 19:03 DrMoriarty

Like this way is not working, it´s printing "hola2" and nothing more

Localnotification.connect("device_token_received",self,"on_device_token_received")
Localnotification.connect("enabled",self,"on_enabled")
Localnotification.init()
Localnotification.is_enabled()

	
func on_enabled():
	print(Localnotification.get_device_token())
        print("hola2")

func on_device_token_received(token):
	print("hola")
	print(token)

martinpelli avatar Mar 09 '21 12:03 martinpelli

@DrMoriarty Is there any development on this? I can't get the device token as well

slabgames avatar Mar 13 '21 11:03 slabgames

@slabgames check Firebase Cloud Messaging plugin, now it available for iOS

DrMoriarty avatar Apr 27 '21 13:04 DrMoriarty

@DrMoriarty Thanks for updating the plugin

slabgames avatar Apr 30 '21 06:04 slabgames

Any news? I'm trying to get push notifications but get_device_token is null for me. Local notifications work fine.

Overvault-64 avatar Dec 13 '22 16:12 Overvault-64