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

feat: add ability to request the device token without showing permission #397

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gtokman
Copy link

@gtokman gtokman commented Mar 20, 2023

Description

Right now the only way to get the device token is to go through the permission prompt. This is not ideal if you want to support silent notification w/o asking for permission. This update allows you to achieve this.

Docs

If you want your app’s remote notifications to display alerts, play sounds, or perform other user-facing actions, you must request authorization to do so using the requestAuthorization(options:completionHandler:) method of UNUserNotificationCenter. If you do not request and receive authorization for your app's interactions, the system delivers all remote notifications to your app silently.

@yousrasd
Copy link

yousrasd commented Jun 9, 2023

That's a good addition, and I require this functionality. Do you have any updates regarding this?

@gtokman
Copy link
Author

gtokman commented Jun 16, 2023

@yousrasd Alternatively you can throw this in your AppDelegate:

UIApplication.shared.registerForRemoteNotifications()

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

Successfully merging this pull request may close these issues.

2 participants