When you need the OneSignal user id on device, do not copy the idsAvailable snippet from old answers: it is deprecated and later SDKs removed it. Use the subscription-state call from the SDK version you actually ship, and log the id once at startup to confirm you have a real value before keying any transactional push off it. If the id comes back null on a current SDK, you are calling the old API, not facing a registration failure.

Context: Stack Overflow #36369910 (accepted answer, score 57): A developer needed the OneSignal user id (player id) on mobile to send a transactional push, and the accepted answer shows the idsAvailable callback. The same answer carries an explicit deprecation notice: idsAvailable was replaced, with the newer call being getPermissionSubscriptionState().getSubscriptionStatus().getUserId(). Copying the old snippet into a current SDK silently yields nothing.