Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Token not working #14

Open
martinpelli opened this issue Mar 8, 2021 · 8 comments
Open

Get Token not working #14

martinpelli opened this issue Mar 8, 2021 · 8 comments

Comments

@martinpelli
Copy link

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)

@DrMoriarty
Copy link
Owner

Show me the code do you use?

@martinpelli
Copy link
Author

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()

@DrMoriarty
Copy link
Owner

DrMoriarty commented Mar 8, 2021

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)

@martinpelli
Copy link
Author

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)

@slabgames
Copy link

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

@DrMoriarty
Copy link
Owner

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

@slabgames
Copy link

@DrMoriarty Thanks for updating the plugin

@Overvault-64
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants