Skip to content
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

Ads region on iOS is unsupported if users Calendar is set to a non-default option #7029

Closed
kylehickinson opened this issue Nov 20, 2019 · 3 comments
Assignees
Labels

Comments

@kylehickinson
Copy link
Collaborator

@kylehickinson kylehickinson commented Nov 20, 2019

Description

In iOS/macOS we use NSLocale to determine the users current locale and feed this into the ads library. If an iOS user sets a non-default calendar for their region (For example switching from Gregorian to Japanese) the identifier reported by NSLocale ends up looking like this en_US@calendar=japanese which then is not parsed correctly by bat-native-ads since it is looking for en_US specifically.

Currently unknown whether or not this issue happens in macOS as well (Chromium may not use NSLocale.identifier directly as iOS does)

@tmancey
Copy link
Collaborator

@tmancey tmancey commented Nov 22, 2019

@kylehickinson Thinking about this it would be better if we pass an ISO code to the library, which can be concatenated using NSLocaleLanguageCode and NSLocaleCountryCode which are part of [NSLocale currentLocale]

@tmancey
Copy link
Collaborator

@tmancey tmancey commented Nov 23, 2019

@kylehickinson If we use NSString *locale = [[NSLocale preferredLanguages] firstObject]; then the correct language format is returned for iOS

@tmancey tmancey changed the title Ads region on iOS is unsupported if users Calendar is set to a non-default option Ads are unsupported on macOS and iOS if the users Calendar is set to a non-default option Nov 23, 2019
@tmancey tmancey changed the title Ads are unsupported on macOS and iOS if the users Calendar is set to a non-default option Ads region on iOS is unsupported if users Calendar is set to a non-default option Nov 23, 2019
@kylehickinson
Copy link
Collaborator Author

@kylehickinson kylehickinson commented Nov 25, 2019

Preferred Languages won't work here either, as it returns the incorrect format. Example:

(lldb) po Locale.preferredLanguages()
["en-JP"]
(lldb) po Locale.current.identifier
en_JP@calendar=japanese
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.