teads / TeadsSDK-android

Teads SDK for Android - Premium branded "outstream" ads
13 stars 6 forks source link

InReadAdBaseListener error codes, descriptions and fail reasons #217

Open andrey-kotkovets opened 9 months ago

andrey-kotkovets commented 9 months ago

I am working on the InRead Teads implementation in my app. InReadAdViewListener extends InReadAdBaseListener and provide 2 error/failure methods:

public open fun onAdError(code: Int, description: String)

public open fun onFailToReceiveAd(failReason: String)

I would like to perform different actions on different error types. For example, I would like to know if there is the notFilled error or the serverError.

Could you provide me with possible values for:

I checked the SDK code (which is not obfuscated) but wasn't able to find any ErrorCode class.

github-maxime-liege commented 9 months ago

Hello,

I would like to know which version are you using to find non obfucstated code. Note that some classes are not obfuscated for public documentation purpose but the majority of the code is.

As we are using an external engine to manage the logic of the ad, there is no onAdError on the Native SDK, you can find below the desired values.

Here at the codes for onAdError:

  MEDIA_FILE_GENERAL_ERROR = 100, // This fatal error can be caused when the component is unable to display media file for any reason other than those below
  MEDIA_FILE_NOT_FOUND = 101, // When the component doesn't succeed to found the media file, usually from HTTP 404 status code
  MEDIA_FILE_TIMEOUT = 102, // When it's impossible to get the media file in the allotted time
  MEDIA_FILE_UNSUPPORTED = 103, // When the media format file is not supported by the asset
  MEDIA_FILE_DISPLAYING_ERROR = 104, // When component get the media file but fail to display it, for example it can be due to a mismatch between the MIME type and the media file type
  MEDIA_FILE_JS_ERROR = 105, // When an error is triggered by the js content from the asset
  UNDEFINED_ERROR = 900 // A component error not linked to the media file

Plus, you can add all the VAST error to it


Here are the codes for onFailToReceiveAd:

  networkError = 'networkError',
  serverError = 'serverError',
  notFilled = 'notFilled',
  fraud = 'fraud',
  badResponse = 'badResponse',
  incompatibleAdReceived = 'incompatibleAdReceived',
  vastError = 'vastError',
  incompatibilityContext = 'incompatibility-context'

Hope this helps, Thanks,

andrey-kotkovets commented 9 months ago

Hello @github-maxime-liege , Thank you very much for your reply!

I use the SDK v5.1.1. And I was referring to public classes mentioning some non-obfuscated code.

The provided error codes and fail reasons will help me. But I would be interested to know if I could access them in the SDK rather than hardcoding in my app? For example, something like tv.teads.sdk.AdError.MEDIA_FILE_GENERAL_ERROR or tv.teads.sdk.FailReason.networkError? It would be much better to refer to some constants from the SDK. Because if I hardcode error codes and fail reasons and you change them, I will have bugs in my app.

Probably you may be interested in why I am trying to handle errors by myself. Well, we would like to understand better how often errors happen and what kind of errors. And for example, we would like to exclude notFilled errors from logging for now. Maybe we will decide that some other errors are not interesting for us. Having error codes and fail reasons would help a lot. And as far as I know, at least error codes are available in iOS SDK: image

github-lucas-bon commented 5 months ago

Hello, sorry for the late reply, the issue was addressed to someone that is no longer in the team. Having known errors as a public list on the sdk could help indeed those wanting to perform best evaluation on each sort of error. This is going to be considered as a roadmap item. Let me know if I can help with something more.