New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix idsAvailable not firing a 2nd time #563
Conversation
* Fixed issue where idsAvailable would not fire a 2nd time if registrationId the first time
f5b9273
to
700e755
Compare
@@ -1683,7 +1683,7 @@ public void run() { | |||
runIdsAvailable.run(); | |||
} | |||
|
|||
private static void fireIdsAvailableCallback() { | |||
static void fireIdsAvailableCallback() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i commented in the github issue, but just curious. has this callback always been expected to fire twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but only if there was an issue with the device getting a registrationId
. More details in my comment on the #563 PR.
Also, do you have a repro case, so we can test on our side as well? |
Actually looking at this a second time. This doesn't seem to resolve the underlying issue. |
@runningcode Thanks for reviewing the PR! I was not able to find any other case where the This PR fixes the following case:
This PR fixes the issue where step 7 was not happening. The behavior of the 2nd fire in the case above has been in place for a while and has aways been the intended behavior. In most cases however, |
We saw an issue in production where the callback is fired with a Inside of the callback we added some logging to track down the issue. Repeated app starts with excellent network conditions would lead to the exact same problem. We also asked our clients to reinstall the app and it led to the same problem. The OneSignal SDK was stuck in a state where the idsAvailableCallback would always fire with a null registrationId even though When would it make sense for the |
@runningcode Going to move our conversation back to issue #558 since I want to keep this PR scoped to the title I opened this under. |
Just to mention that we also got hit with this issue (after an update to OneSignal?) Anyway, since we didn't really use the pushToken/registrationid and were only looking for the userid, we replaced the call with OneSignal.getPermissionSubscriptionState().getSubscriptionStatus().getUserID(), which we could use instead ... |
@MacDegger curious, which version of onesignal were you on when this happened? |
@runningcode we were on 3.8.4 and went to 3.9.3. Might it have to do with using a lambda version of the expression, ie: OneSignal.idsAvailable((userId, registrationId) -> {});? |
Ah, good to know. Would you mind commenting on this github issue? :) #558 3.9.3 should have the fix for the "ids not firing a second time" which was not related to the github issue I filed. |
OneSignal.idsAvailable
callback has null registrationId whileOneSignal.getPermissionSubscriptionState().getSubscriptionStatus().getPushToken()
is not null. #558This change is