1

What are the allowed enum values in AdParam.Builder, eg. setGender(int value)?

I've tried using 1 and 2, but having Root obj class .. is invalid in the log:

2021-01-13 00:20:22.041 2138-2324 W/HiAdSDK.jd:  Root obj class (class java.lang.Object) is invalid
2021-01-13 00:20:22.042 2138-2324 W/HiAdSDK.jd:  toJson jsex

PS. using implementation 'com.huawei.hms:ads-lite:13.4.37.300'

4ntoine
  • 19,816
  • 21
  • 96
  • 220

2 Answers2

1

What are the allowed enum values in AdParam.Builder, eg. setGender(int value)?

Please kindly refer to com.huawei.hms.ads.Gender,value 0 is for MALE, value 1 is for FEMALE.

For more details, see API documentation here.

zhangxaochen
  • 32,744
  • 15
  • 77
  • 108
0

It seems you used old version from the link you posted. Please refer to the info. Here for latest info for the service.

BTW, 1 or 2 are correct for the setGender(int value) function. Please try after you use the latest Ads SDK and function as above. Could you please share more detail logs if the error occurs again?

Zinna
  • 1,947
  • 2
  • 5
  • 20
  • I've updated my question with module import description, is `13.4.37.300` outdated? BTW there's nothing on your link: "Coming soon..." – 4ntoine Jan 13 '21 at 07:08
  • 1
    Just edited the link, please check again. I will look into this issue again tomorrow morning. – Zinna Jan 13 '21 at 07:21
  • btw `13.4.37.300` is mentioned in the [guide](https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides-V5/publisher-service-integrating-sdk-0000001050066913-V5). Let me know if it should be updated, thanks – 4ntoine Jan 13 '21 at 07:30
  • in the updated URL Gender.MALE or FEMALE is also not mentioned. But it's ok since i've already found it in the jar with help of @shirley – 4ntoine Jan 13 '21 at 07:33