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
Android: does not register device, oneSignalRestClient returns "Invalid device_type format! Expected integer" #557
Comments
@ivanlyubimov Did you manually delete the user for this device in our dashboard? This would happen if you deleted a user without uninstalling the app, because the app still has the old player_id saved locally. In short, I'm pretty sure this happened because you either deleted the player id, or possibly because you have a mixup with different App ID's (perhaps you use one for production and one for development and didn't uninstall the app before switching?) If not, can you please completely uninstall your app, then install the app, run it for ~30 seconds, and then send us a link to the logcat? |
@Nightsd01 yes, I have deleted device manually from dashboard. Didn't think it would cause problem. Anyways, If I uninstall app from device, it still appears on the dashboard. And app returns same error in logs. Here is logfile |
@ivanlyubimov Yes, deleting a device from OneSignal will cause a problem when you keep trying to use that same device. This error means exactly the same thing. I would advise that you don't delete users from the dashboard from now on? Why are you deleting them in the first place? Perhaps there is a better way to accomplish what you are trying to do. Also, I would recommend looking at this troubleshooting section for that custom tabs issue. |
@Nightsd01 After all, scenario where dashboard user deletes device is for testing purpose I supposed I need to make sure that sdk indeed subscribes at the moment when user opens application To clarify: after multiple sdk migrations, I want to ensure that thing works. |
We've made many bug fixes since 3.1.4. In any case, the main issue you are facing is caused by the fact that you are deleting users so I'll be closing this issue, but we'll be happy to help you fix #516 and #515. When you update back to the latest version of our SDK, please post on either 515 or 516 depending on what issue you run into. Then in that git issue, please post your |
@Nightsd01 yet you didn't address how could one test subscription correctly. Does it mean deleted device ids can no longer work with onesignal platfrom? |
@ivanlyubimov After the on_session error the SDK will automatically create a new player for your app even on the 3.1.4 SDK. We haven't seen any cases where this wasn't handled correct. For the other issues you linked to we will follow up there |
Above the same issue is have in android also with me and giving same bellow error as i deleted user from dashboard, not app is not uninstall |
I'm also unable to register my android devices wether I use a real device or an emulator. No error message tho. I've followed all the setup instructions. |
Description:
SDK doest not register device.
New device does not appear in dashboard device list.
Initialisation done specifying onesignal_app_id and onesignal_google_project_number in build.gradle.
Following logcat I noticed that there is request failing to onesignal api:
D/OneSignal: OneSignalRestClient: Making request to: https://onesignal.com/api/v1/players/2d9e5e61-46c4-4080-8a81-d47455ecaa9f/on_session D/OneSignal: OneSignalRestClient: POST SEND JSON: {"app_id":"myonesignalappidhere"} D/OneSignal: OneSignalRestClient: Failed request to: https://onesignal.com/api/v1/players/2d9e5e61-46c4-4080-8a81-d47455ecaa9f/on_session W/OneSignal: OneSignalRestClient: POST RECEIVED JSON: {"errors":["Invalid device_type format! Expected integer"]} W/OneSignal: Failed last request. statusCode: 400 response: {"errors":["Invalid device_type format! Expected integer"]}
Notably, after number of launches throughout an hour it returns 200 and registers new device. Without any code change
Environment
3.1.4
npm
Steps to Reproduce Issue:
Anything else:
In attempt to find a way around the issue, I tried few different sdk versions as well as latest, but ultimately hit #516 or #515 every time
The text was updated successfully, but these errors were encountered: