Open tysheng opened 5 years ago
Hi tysheng. Thanks for your report.
Would you mind provide a procedure or video to reproduce this bug? Like "click A -> input B".
@CFFChi Sorry, I cannot reproduce this case myself. But there is another crash case I found. 1.Set white sms list only for ID( Indonesia ), meanwhile my WhatsApp and fb account phone number is a Singapore number, then IndexOutOfBoundError occurred.
val intent = Intent(this, AccountKitActivity::class.java)
val configurationBuilder = AccountKitConfiguration.AccountKitConfigurationBuilder(
LoginType.PHONE,
AccountKitActivity.ResponseType.CODE)
configurationBuilder.setSMSWhitelist(arrayOf("ID"))
intent.putExtra(
AccountKitActivity.ACCOUNT_KIT_ACTIVITY_CONFIGURATION,
configurationBuilder.build())
startActivityForResult(intent, APP_REQUEST_CODE)
I guess its cause is that you guys added WhatsApp verification in 5.0.0, will fetch the WhatsApp number when entering AccountKitActivity if there is no default phone number.
Back to the NPE situation, I add one more code to Init phone number
configurationBuilder.setInitialPhoneNumber(PhoneNumber("62", it, "ID"))
Does the PhoneNumber lead to NPE? Or SmsWhiteList? I cannot reproduce, hope you guys can test in different combinations. Thanks.
Thanks. I can reproduce it now!=D
@CFFChi any release updates?
if user back from [input code] to [enter phone number] page , this would happen. After debug for a while, I found the bug came from here:
for a Vietnam phone number(countryCode:84), should this line countryCode = this.phoneCountryCodes[0].**countryCode**;
be countryCode = this.phoneCountryCodes[0].**isoCode**;
public int getIndexOfCountryCode(String countryCode) {
if (Utility.isNullOrEmpty(countryCode)) {
return -1;
} else {
int length = this.phoneCountryCodes.length;
for(int i = 0; i < length; ++i) {
if (countryCode.equalsIgnoreCase(this.phoneCountryCodes[i].isoCode)) {
return i;
}
}
return -1;
}
}
could you guys fix this?🤣
update: fixed in sdk v5.2.0
It occurred in production environment, varied from android 4 to 7. Here is the stack trace.
Seems the problem is from PhoneContentController