Mobile Development 11 min read

How WeChat Overcame iOS 9 Compatibility Pitfalls: Solutions & Tips

This guide details the common iOS 9 compatibility issues WeChat encountered—such as Bitcode build failures, HTTP restrictions, canOpenURL limits, API deprecations, window level conflicts, and iPad split‑view challenges—and provides step‑by‑step solutions for each.

WeChat Client Technology Team
WeChat Client Technology Team
WeChat Client Technology Team
How WeChat Overcame iOS 9 Compatibility Pitfalls: Solutions & Tips

iOS 9 Issues Summary

1. Build problems (Bitcode)

After upgrading to Xcode 7, many encounter build failures because Bitcode is enabled by default while third‑party libraries may not contain Bitcode. The error looks like “xxx does not contain bitcode…”. The quick fix is to disable Bitcode in Build Settings → Enable Bitcode = NO, though enabling Bitcode later reduces app size.

<code>xxx does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target.</code>

2. HTTP request failures

iOS 9 blocks insecure HTTP by default, requiring HTTPS (TLS 1.2). To allow legacy HTTP calls, add the following to

Info.plist

:

<code>&lt;key&gt;NSAppTransportSecurity&lt;/key&gt;
&lt;dict&gt;
    &lt;key&gt;NSAllowsArbitraryLoads&lt;/key&gt;
    &lt;true/&gt;
&lt;/dict&gt;</code>

More granular whitelist and TLS version settings are also possible. Note that even with this flag, HTTP resources referenced from an HTTPS page will not load.

3. canOpenURL limit

iOS 9 limits canOpenURL to 50 schemes. Declare needed schemes in

LSApplicationQueriesSchemes

in the plist, or reduce calls. Example:

<code>&lt;key&gt;LSApplicationQueriesSchemes&lt;/key&gt;
&lt;array&gt;
    &lt;string&gt;weixin&lt;/string&gt;
    &lt;string&gt;wechat&lt;/string&gt;
&lt;/array&gt;</code>

Replace repetitive checks with a single

openURL

call to avoid consuming whitelist slots:

<code>if (!openUrl(scheme)) then xxx;</code>

4. systemName change

In iOS 9.1 beta,

[[UIDevice currentDevice] systemName]

returned “iOS” instead of “iPhone OS”, causing backend logic that relied on the string to fail. The fix is to make the backend check configurable; Apple later reverted the value.

5. preferredLanguages format

iOS 9 added a region suffix to language identifiers (e.g., “zh‑Hans‑CN”). This broke language detection in WeChat, showing English for some users. The solution is to match language prefixes instead of exact strings.

6. Deprecated APIs

AddressBookUI.framework → ContactsUI.framework.

UIAlertView → UIAlertController.

UIPopoverController → present a regular UIViewController with

modalPresentationStyle = UIModalPresentationPopover

.

7. windowLevel issue

The system keyboard’s windowLevel is extremely high (~10⁷). Custom windows may appear behind it. Two work‑arounds: raise the custom window’s level to 10⁷, or dismiss the keyboard with

[mainWindow endEditing:YES]

before showing the window.

8. Launch crash (missing rootViewController)

If the main window lacks a rootViewController at launch, the app crashes with “Application windows are expected to have a root view controller…”. Set a rootViewController before the end of launch.

iPad Multitasking

1. Enabling Split View

Compile with Xcode 7 iOS 9 SDK, use a Launch Storyboard, and support all interface orientations. If you do not want split view, check “Requires full screen” in the project’s Deployment Info.

2. Adapting UI for Split View

Design layouts that respond to size class changes (Regular ↔ Compact). WeChat uses configuration files to apply iPhone‑5 layout for 320 pt width, iPhone‑6 layout for 438 pt width, and iPad layout for larger widths.

3. Common Split View issues

Use

[UIScreen mainScreen].bounds

only for full‑screen; in split view, obtain the window’s frame instead.

Replace deprecated rotation callbacks with

viewWillTransitionToSize:withTransitionCoordinator:

.

Video recording is unavailable in split view; inform users accordingly.

Avoid hard‑coded screen sizes because the visible area changes dynamically.

Conclusion

The article summarizes the typical problems WeChat faced when adapting to iOS 9 and provides practical solutions, encouraging developers to share additional iOS 9 pitfalls.

Mobile DevelopmentHTTPWeChatAPI MigrationBitcodeiOS9
WeChat Client Technology Team
Written by

WeChat Client Technology Team

Official account of the WeChat mobile client development team, sharing development experience, cutting‑edge tech, and little‑known stories across Android, iOS, macOS, Windows Phone, and Windows.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.