ios icon indicating copy to clipboard operation
ios copied to clipboard

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

Open gtokman opened this issue 2 years ago • 2 comments

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.

gtokman avatar Mar 20 '23 13:03 gtokman

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

yousrasd avatar Jun 09 '23 02:06 yousrasd

@yousrasd Alternatively you can throw this in your AppDelegate:

UIApplication.shared.registerForRemoteNotifications()

gtokman avatar Jun 16 '23 13:06 gtokman