iOS Accessibility: Custom voice over text for bund

2020-03-01 04:28发布

问题:

iOS voice over does not correctly read out my companies name. For example it reads out "dog" instead of "D.O.G." (not my real company name but you get the idea)

We get around this by telling the app to read out "D O G" in all places where the company name is read out.

However, voice over reads the bundle display name out incorrectly both on the app icon, and after the app has finished launching.

Is there a way to make my app read out "D O G" instead of "dog" after app launch? I would settle for forcing the app not to read out the bundle display name after app launch and then manually reading out "D O G".

(I'm assuming you can't set a custom voice over for the app icon, but bonus points for anyone that knows if I can or can't)

回答1:

As of iOS 8, you can achieve this by adding the CFBundleSpokenName key to your Info.plist.

https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/plist/info/CFBundleSpokenName



回答2:

I don't think you can provide an alternate bundle name string for VoiceOver. I was however able to find a hack that could work in your specific scenario:

VoiceOver seems to interpret various control characters differently. \u7f is one of the characters that split the word for VoiceOver and yet do not break display in launchpad. Therefore, defining bundle name as:

CFBundleDisplayName="D\U007fO\U007fG";

in InfoPlist.strings seems to achieve what you need.