exponea / exponea-react-native-sdk

MIT License
8 stars 13 forks source link

Following PUSH_IOS.md to setup the ios push but not able to retrieve the APNS token #96

Closed ak19945 closed 1 year ago

ak19945 commented 1 year ago

When we are trying to add the below after identify user it showing error or going into catch block Messaging.messaging().token { token, error in if let token = token { Exponea.exponeaInstance.trackPushToken(token) // resolve(nil) } else { // reject(error) } }

when we trying to get the APNS token manually to pass on to exponea its showing below error

Invariant Violation: new NativeEventEmitter() requires a non-null argument.

adam1929 commented 1 year ago

Hi @ak19945 take that documentation as just example or principle. That example is not optimal because you should similar code in RN, not in native swift. Please check latest RN SDK, where exists trackPushToken and trackHmsPushToken. We don't now which library you are using for Firebase/Push notifications handling. Main message of that documentation part was that you should update push token after anonymize() because this method is removing push token from local storage. We should rewrite documentation. Thank you