urbanairship / react-native-airship

Airship React Native module
Other
88 stars 62 forks source link

Get the Device Token in iOS #79

Closed listicos closed 6 years ago

listicos commented 6 years ago

Hello, I don't find a way to get the device token once I hace the permissions. I tried with this UrbanAirship.addListener('register', (event) => { console.log(event) }) In Objective C you can get the device token here didRegisterForRemoteNotificationsWithDeviceToken

Thanks

rlepinski commented 6 years ago

Its part of that event but under the key registrationToken

rlepinski commented 6 years ago

In 1.5.0 we can expose a method to get the registrationToken/device token

listicos commented 6 years ago

The problem is, never firing the event once I get the permissions.

rlepinski commented 6 years ago

The device token does not need the permission prompt to generate starting with iOS 9 as long as you have background refresh enabled in your targets capabilities. The event probably already fired by that time.