NOTE: The official WeChatOpenSDK CocoaPod is out! Please try pod 'WeChatOpenSDK'
in your project. As a result, this project is no longer maintained.
The official WeChat SDK for iOS apps to access WeChat platform. This is a mirror repository maintained by iOS developers from Baixing.
To run the example project:
- Clone the repo, and run
pod install
from the Example directory first. - Open
BXWeChatSDK.xcworkspace
. - Replace the example target's URL schemes
YOUR_WECAHT_APP_ID
with your WeChat app ID. - Afterwards, set the same app ID in
BXAppDelegate.m
.
Now, let's rock 🚀.
- iOS 7 and later
- Xcode 7.2 and later
BXWeChatSDK is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "BXWeChatSDK"
Then follow the instructions provided by Tencent.
Add the following lines to your project's info.plist file so that your app would be allowed to open WeChat.app.
<key>LSApplicationQueriesSchemes</key>
<array>
<string>wechat</string>
<string>weixin</string>
</array>
Also, add WeChat domains to your app's whitelist.
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>qq.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
</dict>
</dict>
Or if security is not an issue to your app, use the following lines.
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>