I'm working on an app where the user can search a database with several languages. I want to know which keyboards are installed on his device, if he doesn't have a specific one I can show a popup and explain him how to install it. How to get it?
You can find it in NSUserDefaults:
NSDictionary* defaults = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation];
I tested it on iOS Simulator (iOS 5.0). I have only US keyboard installed. Contents of defaults:
AppleITunesStoreItemKinds = (
eBook,
document,
"software-update",
booklet,
"itunes-u",
newsstand,
artist,
podcast,
"podcast-episode",
software
);
AppleLanguages = (
en,
fr,
de,
ja,
nl,
it,
es,
pt,
"pt-PT",
da,
fi,
nb,
sv,
ko,
"zh-Hans",
"zh-Hant",
ru,
pl,
tr,
uk,
ar,
hr,
cs,
el,
he,
ro,
sk,
th,
id,
ms,
"en-GB",
ca,
hu,
vi
);
AppleLocale = "en_US";
NSInterfaceStyle = macintosh;
NSLanguages = (
en,
fr,
de,
ja,
nl,
it,
es,
pt,
"pt-PT",
da,
fi,
nb,
sv,
ko,
"zh-Hans",
"zh-Hant",
ru,
pl,
tr,
uk,
ar,
hr,
cs,
el,
he,
ro,
sk,
th,
id,
ms,
"en-GB",
ca,
hu,
vi
);
}
Then I added russian keyboard and contents of NSUserDefaults become:
{
AppleITunesStoreItemKinds = (
eBook,
document,
"software-update",
booklet,
"itunes-u",
newsstand,
artist,
podcast,
"podcast-episode",
software
);
AppleKeyboards = (
"en_US@hw=US;sw=QWERTY",
"ru_RU@hw=Russian;sw=Russian"
);
AppleKeyboardsExpanded = 1;
AppleLanguages = (
en,
fr,
de,
ja,
nl,
it,
es,
pt,
"pt-PT",
da,
fi,
nb,
sv,
ko,
"zh-Hans",
"zh-Hant",
ru,
pl,
tr,
uk,
ar,
hr,
cs,
el,
he,
ro,
sk,
th,
id,
ms,
"en-GB",
ca,
hu,
vi
);
AppleLocale = "en_US";
NSInterfaceStyle = macintosh;
NSLanguages = (
en,
fr,
de,
ja,
nl,
it,
es,
pt,
"pt-PT",
da,
fi,
nb,
sv,
ko,
"zh-Hans",
"zh-Hant",
ru,
pl,
tr,
uk,
ar,
hr,
cs,
el,
he,
ro,
sk,
th,
id,
ms,
"en-GB",
ca,
hu,
vi
);
}
So, you need to use AppleKeyboards and AppleKeyboardsExpanded keys.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With