-
Notifications
You must be signed in to change notification settings - Fork 549
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
Pinpoint SDK sends 3 character country code, causing API error #354
Comments
We released 2.6.6 that fixes the issue. |
With the country value of CAN, Using 2.6.6 I'm getting this,
|
@kvasukib Please help me out to implement AWS Pinpoint notification in android. i am getting the same issue ( com.amazonaws.services.pinpoint.model.BadRequestException: Country should be 2 character ISO 3166-1 Alpha-2 or Alpha-3 codes or UN M.49 numeric-3 area code ) as above as in TargetingClient class the EndpointLocation is unable to get city,country etc. I have researched and found that Please help to implement it ASAP. |
@Arpanbajpai Sorry for the inconvenience caused. |
@kvasukib Sir as requested i attached screenshot with breakpoints and result.I am using API level 28. |
@Arpanbajpai Thank you for providing me with all the necessary details. I added few log statements in the code to see if the location is fetched correctly. @Test
public void testUpdateEndpointProfile() {
EndpointProfile endpointProfile = targetingClient.currentEndpoint();
EndpointProfileUser endpointProfileUser = new EndpointProfileUser();
endpointProfileUser.setUserId(credentialsProvider.getIdentityId());
endpointProfile.setUser(endpointProfileUser);
targetingClient.updateEndpointProfile();
assertEquals("The userId should be the Cognito Identity ID",
credentialsProvider.getIdentityId(),
targetingClient.currentEndpoint().getUser().getUserId());
assertNotNull(targetingClient.currentEndpoint().getUser());
assertNotNull(targetingClient.currentEndpoint().getLocation());
assertNotNull(targetingClient.currentEndpoint().getDemographic());
assertNotNull(targetingClient.currentEndpoint().getDemographic().getAppVersion());
assertNotNull(targetingClient.currentEndpoint().getDemographic().getLocale());
assertNotNull(targetingClient.currentEndpoint().getDemographic().getMake());
assertNotNull(targetingClient.currentEndpoint().getDemographic().getModel());
assertNotNull(targetingClient.currentEndpoint().getDemographic().getPlatform());
assertNotNull(targetingClient.currentEndpoint().getDemographic().getPlatformVersion());
assertNotNull(targetingClient.currentEndpoint().getDemographic().getTimezone());
Log.i(TAG, "Country = " + targetingClient.currentEndpoint().getDemographic().getLocale().getCountry());
}
I am able to retrieve the information on API Level 28 emulator. Can you give some information on the device? |
@kvasukib i am using devices of moto(API 25) and redmi(API 24) for testing. It seems it is working pefectly on your side but i am not able to implement it correctly |
I am also facing the same issue. Why this issue has been closed?
|
Just make sure to insert Locale of your country inside your app. |
How to do that? Also what if my app gets downloaded from a different country would that be a problem? |
While initializing app just declare Locale with country code in your app |
Thanks a lot. This solved the error |
No description provided.
The text was updated successfully, but these errors were encountered: