onmyway133 / PushNotifications

🐉 A macOS, Linux, Windows app to test push notifications on iOS and Android
https://onmyway133.com
Other
2.26k stars 175 forks source link

How do I get the device token? #1

Closed nikolaigeorgie closed 6 years ago

nikolaigeorgie commented 6 years ago

Every time I use the device token from either FCM or APNS it returns bad device token. Any detailed steps I can do to solve this?

onmyway133 commented 6 years ago

@nikolas7892 Hi, this may be a good tutorial https://www.raywenderlich.com/156966/push-notifications-tutorial-getting-started if you haven't read it. Normally, you should get the device token (in form of Data) in this AppDelegate method

optional func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data)