Getting Started on iOS
1. Register an App ID
Fill in the required details on the App Registration page to obtain an App ID.
Submit the registered app for approval. Approved apps will be released.
2. Download the SDK package
The package is comprised of three files:
3. Set up your development environment
Create a project in Xcode.
Add the following three files to your project:
Note: For Xcode v4.3 and earlier, please use
libWeChatSDK.a. For XCode v4.5 and later, use
- Edit the "Build Settings" for your project. Add the paths of the following files to "Search Paths", as shown below:
- In Xcode, select
Targets > Info > URL type > URL scheme. Add the App ID you registered previously. For Xcode v3 and earlier, please add the ID to your plist file, as shown below:
Now you can start coding. For files on which you want to use the WeChat API, import
WXApi.hand add the
#import <UIKit/UIKit.h> #import "WXApi.h" @interface AppDelegate : UIResponder <UIApplicationDelegate, WXApiDelegate> @property (strong, nonatomic) UIWindow *window; @end
You should implement
- onResp:resp:in these classes. To send a request to the API, call