This message means your app called a Pushwoosh registration method with a null or empty push token, so the SDK refused to act on it.
Where it comes from
Pushwoosh.getInstance().registerExistingToken(token, callback) checks the token before doing anything else. On an empty value it logs token is empty at warning level and does not proceed with registration. Note that:
- The callback is invoked, with a failed result carrying a
RegisterForPushNotificationsException("token is empty")— checkresult.isSuccess()/getException()rather than assuming the callback never fires. - Nothing is sent to Pushwoosh, so the device is not registered and will not receive pushes.
This only affects registerExistingToken(), the method used when your app obtains the FCM/APNs token itself and hands it to Pushwoosh. The normal registerForPushNotifications() flow requests the token from the push service on its own and is not affected.
How to fix it
- Call
registerExistingToken()only from inside the callback that delivers the token (for example FirebaseMessaginggetToken()success,onNewToken(), ordidRegisterForRemoteNotificationsWithDeviceTokenon iOS) — never at app start. - Guard the call with a null/empty check of your own so the SDK is not invoked with a missing value.
- If you do not need to manage the token yourself, drop
registerExistingToken()and usePushwoosh.getInstance().registerForPushNotifications(callback)instead; that path reports success and failure through its callback. - If the push service itself never returns a token, the problem is upstream — check that your Firebase / APNs configuration matches the project configured in Pushwoosh.
Comments
0 comments
Please sign in to leave a comment.