Onesignal-android-sdk: Users not resubscribed after deleting in dashboard

Created on 24 Oct 2019  路  14Comments  路  Source: OneSignal/OneSignal-Android-SDK

Description:

I deleted a player from the dashboard, then force closed and reopened the app to ensure that the player would be resubscribed. The user did not get resubscribed and a 400 error was logged in logcat. The player does not appear in the dashboard and the device does not receive notifications.

Some things I've tried:

  • Reinstalling the app does fix the issue and allow the device to be resubscribed.
  • The "clear data" button in app settings does allow the device to be resubscribed.
  • The "clear cache" button in app settings does not fix the issue.
  • Restarting the device does not fix the issue.

EDIT: This appears to happen with our iOS app as well.

Environment

  • Device: Nexus 6P with Android 8.1.0
  • Project details:

    • MinSDK version 21

    • Target and Compile SDK version 28

    • Gradle version 5.1.1

    • Android Gradle plugin version 3.4.1

  • OneSignal Dependencies:

    • OneSignal Gradle plugin version 0.12.6

    • OneSignal Android SDK version 3.11.4

  • Steps to Reproduce Issue:

    1. Open android app and allow player to be subscribed
    2. Set external id on user using OneSignal.setExternalUserId
    3. Close app
    4. Open OneSignal dashboard on web and delete player
    5. Open android app again
    6. Player is not resubscribed and error is logged in console.

    Anything else:

    Error in logcat shown when opening the app and when trying to set external id each time the app syncs user data with server:

    W/OneSignal: OneSignalRestClient: POST RECEIVED JSON: {"errors":["Player not found. Request body did not contain a device_type field, so a new player could not be automatically created."]}
    W/OneSignal: Failed last request. statusCode: 400
        response: null
    

    Also this error sometimes:

    W/OneSignal: OneSignalRestClient: PUT RECEIVED JSON: {"errors":["No user with this id found"]}
    W/OneSignal: Failed last request. statusCode: 400
        response: null
    

    Medium Priority Reproducible

    Most helpful comment

    Same problem with Javascript sdk

    All 14 comments

    I have the same issue. Is that something random users may theoretically get into?

    @thavelka Thanks for reporting the issue. We are working on a fix to have the SDK create a new player if it is deleted from the OneSignal dashboard in the next release.

    pls how solve?

    @thavelka Thanks for reporting the issue. We are working on a fix to have the SDK create a new player if it is deleted from the OneSignal dashboard in the next release.

    how slove ?

    @thavelka @alexshikov @zoro238
    This is now fixed in the 3.12.3 release that went out Nov. 21.

    @thavelka @alexshikov @zoro238
    This is now fixed in the 3.12.3 release that went out Nov. 21.

    ok i am tested very ok

    Same problem here.
    @thavelka have you reported this issue for the iOS SDK ?

    Same problem with Javascript sdk

    Same Problem, React Native

    @jkasten2 Can we maybe fast track this? Can I help somehow?

    @A-Tokyo Make sure you have [email protected] or newer since this version included 3.12.4 of this native SDK with the fix noted here.

    @jkasten2 Double checked, 100% sure i am using https://github.com/OneSignal/react-native-onesignal/releases/tag/3.6.1

    @A-Tokyo Can you provide the exact steps in producing the issue along with a logcat with OneSignal.setLogLevel to VERBOSE?
    https://documentation.onesignal.com/docs/react-native-sdk#section-set-log-level

    I recommend opening a new issues in the react-native-onesignal if the logcat does not help so your reply doesn't get lost in this closed issue.

    Hello! I'm having the same problem.
    When removing a user through the OneSignal dashboard, it is no longer possible to add the same method as before (using the sample code from the JS library). In console, error code 400 to request "PUT https://onesignal.com/api/v1/players/..." appears.

    Device: Android 10; MI A3 Xiaomi
    Browser: Chrome 81.0.40044.117

    EDIT:

    Ironically, as soon as I posted the comment, I managed to resolve:

    Just go to "Settings" -> Web Push Plataforms -> Select the broswer and simply save with the "AUTO RESUBSCRIBE" option active.

    Same problem with xamarin sdk

    Was this page helpful?
    0 / 5 - 0 ratings