├── LICENSE.TXT ├── README.md ├── doc ├── App_Integration_Guide.md ├── Php_Integration_Guide.md ├── RSAKey_Cert_Generate_Guide.md ├── Sequence.md └── image │ ├── BundleId.jpg │ ├── Debug.jpg │ ├── Index.jpg │ ├── Log.jpg │ ├── RSAPublicKey.jpg │ ├── SKExpired.png │ ├── WXAppInfo.jpg │ ├── accessTokenExpired.png │ ├── appBindWX.png │ ├── bindAppLogin.png │ ├── bindAppRegister.png │ ├── checkLogin.png │ ├── config_step1.png │ ├── config_step2.png │ ├── config_step3.png │ ├── config_step4.png │ ├── config_step5.png │ ├── config_step6.png │ ├── connect.png │ ├── defaultHost.jpg │ ├── getUserInfo.png │ ├── login.png │ ├── refreshTokenExpired.png │ ├── register.png │ ├── serverCer.jpg │ └── wxLogin.png ├── iOS └── WeDemo │ ├── Default-568h@2x.png │ ├── Podfile.lock │ ├── Pods │ ├── AFNetworking │ │ ├── AFNetworking │ │ │ ├── AFHTTPSessionManager.h │ │ │ ├── AFHTTPSessionManager.m │ │ │ ├── AFNetworkReachabilityManager.h │ │ │ ├── AFNetworkReachabilityManager.m │ │ │ ├── AFNetworking.h │ │ │ ├── AFSecurityPolicy.h │ │ │ ├── AFSecurityPolicy.m │ │ │ ├── AFURLRequestSerialization.h │ │ │ ├── AFURLRequestSerialization.m │ │ │ ├── AFURLResponseSerialization.h │ │ │ ├── AFURLResponseSerialization.m │ │ │ ├── AFURLSessionManager.h │ │ │ └── AFURLSessionManager.m │ │ ├── LICENSE │ │ ├── README.md │ │ └── UIKit+AFNetworking │ │ │ ├── AFAutoPurgingImageCache.h │ │ │ ├── AFAutoPurgingImageCache.m │ │ │ ├── AFImageDownloader.h │ │ │ ├── AFImageDownloader.m │ │ │ ├── AFNetworkActivityIndicatorManager.h │ │ │ ├── AFNetworkActivityIndicatorManager.m │ │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ │ ├── UIActivityIndicatorView+AFNetworking.m │ │ │ ├── UIButton+AFNetworking.h │ │ │ ├── UIButton+AFNetworking.m │ │ │ ├── UIImage+AFNetworking.h │ │ │ ├── UIImageView+AFNetworking.h │ │ │ ├── UIImageView+AFNetworking.m │ │ │ ├── UIKit+AFNetworking.h │ │ │ ├── UIProgressView+AFNetworking.h │ │ │ ├── UIProgressView+AFNetworking.m │ │ │ ├── UIRefreshControl+AFNetworking.h │ │ │ ├── UIRefreshControl+AFNetworking.m │ │ │ ├── UIWebView+AFNetworking.h │ │ │ └── UIWebView+AFNetworking.m │ ├── Headers │ │ ├── Private │ │ │ └── AFNetworking │ │ │ │ ├── AFAutoPurgingImageCache.h │ │ │ │ ├── AFHTTPSessionManager.h │ │ │ │ ├── AFImageDownloader.h │ │ │ │ ├── AFNetworkActivityIndicatorManager.h │ │ │ │ ├── AFNetworkReachabilityManager.h │ │ │ │ ├── AFNetworking.h │ │ │ │ ├── AFSecurityPolicy.h │ │ │ │ ├── AFURLRequestSerialization.h │ │ │ │ ├── AFURLResponseSerialization.h │ │ │ │ ├── AFURLSessionManager.h │ │ │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ │ │ ├── UIButton+AFNetworking.h │ │ │ │ ├── UIImage+AFNetworking.h │ │ │ │ ├── UIImageView+AFNetworking.h │ │ │ │ ├── UIKit+AFNetworking.h │ │ │ │ ├── UIProgressView+AFNetworking.h │ │ │ │ ├── UIRefreshControl+AFNetworking.h │ │ │ │ └── UIWebView+AFNetworking.h │ │ └── Public │ │ │ └── AFNetworking │ │ │ ├── AFAutoPurgingImageCache.h │ │ │ ├── AFHTTPSessionManager.h │ │ │ ├── AFImageDownloader.h │ │ │ ├── AFNetworkActivityIndicatorManager.h │ │ │ ├── AFNetworkReachabilityManager.h │ │ │ ├── AFNetworking.h │ │ │ ├── AFSecurityPolicy.h │ │ │ ├── AFURLRequestSerialization.h │ │ │ ├── AFURLResponseSerialization.h │ │ │ ├── AFURLSessionManager.h │ │ │ ├── UIActivityIndicatorView+AFNetworking.h │ │ │ ├── UIButton+AFNetworking.h │ │ │ ├── UIImage+AFNetworking.h │ │ │ ├── UIImageView+AFNetworking.h │ │ │ ├── UIKit+AFNetworking.h │ │ │ ├── UIProgressView+AFNetworking.h │ │ │ ├── UIRefreshControl+AFNetworking.h │ │ │ └── UIWebView+AFNetworking.h │ ├── Manifest.lock │ ├── Pods.xcodeproj │ │ ├── project.pbxproj │ │ └── xcuserdata │ │ │ └── jeasonzhu.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── AFNetworking.xcscheme │ │ │ ├── Pods-WeDemo.xcscheme │ │ │ └── xcschememanagement.plist │ └── Target Support Files │ │ ├── AFNetworking │ │ ├── AFNetworking-dummy.m │ │ ├── AFNetworking-prefix.pch │ │ └── AFNetworking.xcconfig │ │ └── Pods-WeDemo │ │ ├── Pods-WeDemo-acknowledgements.markdown │ │ ├── Pods-WeDemo-acknowledgements.plist │ │ ├── Pods-WeDemo-dummy.m │ │ ├── Pods-WeDemo-frameworks.sh │ │ ├── Pods-WeDemo-resources.sh │ │ ├── Pods-WeDemo.debug.xcconfig │ │ └── Pods-WeDemo.release.xcconfig │ ├── WeDemo.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── jeasonzhu.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── jeasonzhu.xcuserdatad │ │ └── xcschemes │ │ ├── WeDemo.xcscheme │ │ └── xcschememanagement.plist │ ├── WeDemo.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── jeasonzhu.xcuserdatad │ │ ├── UserInterfaceState.xcuserstate │ │ └── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ ├── WeDemo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ └── LaunchScreen.storyboard │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── appIcon120-1.png │ │ │ ├── appIcon120.png │ │ │ ├── appIcon180.png │ │ │ ├── appIcon58.png │ │ │ ├── appIcon80.png │ │ │ └── appIcon87.png │ │ ├── AppLogo.imageset │ │ │ ├── AppLogo@2x.png │ │ │ └── Contents.json │ │ ├── AskLoginIcon.imageset │ │ │ ├── AskLoginIcon@2x.png │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── documentsIcon.imageset │ │ │ ├── Contents.json │ │ │ └── documentsIcon@2x.png │ │ ├── documentsSelectIcon.imageset │ │ │ ├── Contents.json │ │ │ └── documentsSelectIcon@2x.png │ │ ├── messageBoardIcon.imageset │ │ │ ├── Contents.json │ │ │ └── messageBoardIcon@2x.png │ │ ├── messageBoardSelectedIcon.imageset │ │ │ ├── Contents.json │ │ │ └── messageBoardSelectedIcon@2x.png │ │ ├── newCommentIcon.imageset │ │ │ ├── Contents.json │ │ │ └── newCommentIcon@2x.png │ │ ├── userIcon.imageset │ │ │ ├── Contents.json │ │ │ └── userIcon@2x.png │ │ ├── userSelectedIcon.imageset │ │ │ ├── Contents.json │ │ │ └── userSelectedIcon@2x.png │ │ ├── weChatLoginDocumentIcon.imageset │ │ │ ├── Contents.json │ │ │ └── weChatLoginDocumentIcon@2x.png │ │ ├── weChatMoreDocumentIcon.imageset │ │ │ ├── Contents.json │ │ │ └── weChatMoreDocumentIcon@2x.png │ │ ├── weChatPayDocumentIcon.imageset │ │ │ ├── Contents.json │ │ │ └── weChatPayDocumentIcon@2x.png │ │ ├── weChatShareDocumentIcon.imageset │ │ │ ├── Contents.json │ │ │ └── weChatShareDocumentIcon@2x.png │ │ ├── wxLoginBackground.imageset │ │ │ ├── Contents.json │ │ │ └── wxLoginBackground.png │ │ ├── wxLogo.imageset │ │ │ ├── Contents.json │ │ │ └── wxLogo@2x.png │ │ └── wxLogoGreen.imageset │ │ │ ├── Contents.json │ │ │ └── pic_logo_1082168b9.png │ ├── Info.plist │ ├── Model │ │ ├── Common │ │ │ ├── ADAccessLog.h │ │ │ ├── ADAccessLog.m │ │ │ ├── ADBaseResp.h │ │ │ ├── ADBaseResp.m │ │ │ ├── ADNetworkConfigItem.h │ │ │ ├── ADNetworkConfigItem.m │ │ │ ├── Common.json │ │ │ └── DataModels.h │ │ ├── LogicSvr │ │ │ ├── ADAddCommentResp.h │ │ │ ├── ADAddCommentResp.m │ │ │ ├── ADAddReplyResp.h │ │ │ ├── ADAddReplyResp.m │ │ │ ├── ADCheckLoginResp.h │ │ │ ├── ADCheckLoginResp.m │ │ │ ├── ADCommentList.h │ │ │ ├── ADCommentList.m │ │ │ ├── ADConnectResp.h │ │ │ ├── ADConnectResp.m │ │ │ ├── ADGetCommentListResp.h │ │ │ ├── ADGetCommentListResp.m │ │ │ ├── ADGetReplyListResp.h │ │ │ ├── ADGetReplyListResp.m │ │ │ ├── ADGetUserInfoResp.h │ │ │ ├── ADGetUserInfoResp.m │ │ │ ├── ADReplyList.h │ │ │ ├── ADReplyList.m │ │ │ ├── ADUser.h │ │ │ ├── ADUser.m │ │ │ ├── ADWXLoginResp.h │ │ │ ├── ADWXLoginResp.m │ │ │ └── LogicSvr.json │ │ └── Store │ │ │ ├── ADUserInfo.h │ │ │ ├── ADUserInfo.m │ │ │ └── Store.json │ ├── Service │ │ ├── ADKeyChainWrap.h │ │ ├── ADKeyChainWrap.m │ │ ├── ADNetworkConfigManager.h │ │ ├── ADNetworkConfigManager.m │ │ ├── ADNetworkEngine.h │ │ ├── ADNetworkEngine.m │ │ ├── BaseNetworkEngine.h │ │ ├── BaseNetworkEngine.m │ │ ├── ConfigItemsMaker.h │ │ ├── NetworkConfigItems.h │ │ ├── NetworkHandler │ │ │ ├── ErrorHandler.h │ │ │ ├── ErrorHandler.m │ │ │ ├── ErrorTitle.h │ │ │ ├── ErrorTitle.m │ │ │ ├── ImageCache.h │ │ │ ├── ImageCache.m │ │ │ ├── JSONRequest.h │ │ │ └── JSONRequest.m │ │ ├── WXApiManager.h │ │ └── WXApiManager.m │ ├── Util │ │ ├── AlertTitleFont.h │ │ ├── AlertTitleFont.m │ │ ├── ButtonColor.h │ │ ├── ButtonColor.m │ │ ├── Definition │ │ │ ├── Constant.h │ │ │ └── Definition.h │ │ ├── Encrypt │ │ │ ├── AES.h │ │ │ ├── AES.m │ │ │ ├── MD5.h │ │ │ ├── MD5.m │ │ │ ├── RSA.h │ │ │ ├── RSA.m │ │ │ ├── RandomKey.h │ │ │ └── RandomKey.m │ │ ├── LineColor.h │ │ ├── LineColor.m │ │ ├── ShakeDebug.h │ │ ├── ShakeDebug.m │ │ ├── UITextView+Placeholder.h │ │ └── UITextView+Placeholder.m │ ├── View │ │ ├── CommentReplyFooterView.h │ │ ├── CommentReplyFooterView.m │ │ ├── CommentReplyFooterView.xib │ │ ├── DocumentsCell.h │ │ ├── DocumentsCell.m │ │ ├── DocumentsCell.xib │ │ ├── InputWithTextFeildBar.h │ │ ├── InputWithTextFeildBar.m │ │ ├── InputWithTextFieldBar.xib │ │ ├── InputWithTextFieldCell.h │ │ ├── InputWithTextFieldCell.m │ │ ├── InputWithTextFieldCell.xib │ │ ├── MessageBoardCommentView.h │ │ ├── MessageBoardCommentView.m │ │ ├── MessageBoardContentView.h │ │ ├── MessageBoardContentView.m │ │ ├── MessageBoardReplyCell.h │ │ ├── MessageBoardReplyCell.m │ │ ├── MessageboardFooterView.h │ │ ├── MessageboardFooterView.m │ │ ├── MessageboardFooterView.xib │ │ ├── MessageboardHeaderView.h │ │ ├── MessageboardHeaderView.m │ │ ├── MessageboardHeaderView.xib │ │ ├── UserHeadPhotoCell.h │ │ ├── UserHeadPhotoCell.m │ │ ├── UserHeadPhotoCell.xib │ │ ├── UserInfoDisplayCell.h │ │ ├── UserInfoDisplayCell.m │ │ ├── UserInfoDisplayCell.xib │ │ ├── UserNickNameCell.h │ │ ├── UserNickNameCell.m │ │ └── UserNickNameCell.xib │ ├── ViewController │ │ ├── Debug │ │ │ ├── ConfigDetailViewController.h │ │ │ ├── ConfigDetailViewController.m │ │ │ ├── DebugViewController.h │ │ │ ├── DebugViewController.m │ │ │ ├── LogTextViewController.h │ │ │ └── LogTextViewController.m │ │ ├── Login │ │ │ ├── AskLoginViewController.h │ │ │ ├── AskLoginViewController.m │ │ │ ├── WXLoginViewController.h │ │ │ └── WXLoginViewController.m │ │ └── Tab │ │ │ ├── Documents │ │ │ ├── DocumentsViewController.h │ │ │ └── DocumentsViewController.m │ │ │ ├── MessageBoard │ │ │ ├── MessageBoardViewController.h │ │ │ ├── MessageBoardViewController.m │ │ │ ├── NewCommentViewController.h │ │ │ └── NewCommentViewController.m │ │ │ └── User │ │ │ ├── ADAboutViewController.h │ │ │ ├── ADAboutViewController.m │ │ │ ├── ADHistoryViewController.h │ │ │ ├── ADHistoryViewController.m │ │ │ ├── ADShareViewController.h │ │ │ ├── ADShareViewController.m │ │ │ ├── DebugInfoViewController.h │ │ │ ├── DebugInfoViewController.m │ │ │ ├── UserInfoViewController.h │ │ │ └── UserInfoViewController.m │ ├── WeChatSDK │ │ ├── WXApi.h │ │ ├── WXApiObject.h │ │ └── libWeChatSDK.a │ ├── main.m │ └── wechatauthdemo.cer │ ├── WeDemoTests │ ├── Info.plist │ └── WeDemoTests.m │ ├── WeDemoUITests │ ├── Info.plist │ └── WeDemoUITests.m │ └── podfile └── php ├── demo ├── class.we_demo_controller_demo.php ├── class.we_demo_database_demo.php ├── config.php └── index.php └── sdk ├── class.wx_network.php ├── class.wx_open_api.php ├── class.wx_sdk_handler.php └── interface.wx_database.php /README.md: -------------------------------------------------------------------------------- 1 | #WeDemo App 2 | 3 | WeDemo为微信团队开源项目,用于微信开发者进行微信登录、分享功能开发时的参考Demo。微信开发者可以参考项目中的代码来开发应用,也可以直接使用项目中的代码到自己的App中。 4 | 5 | 开发者可以自由使用并传播本代码,但需要保留原作者信息。 6 | 7 | 联系我们:dev@wechat.com 8 | 9 | ##Document 10 | 11 | 详见Wiki: 12 | 13 | * [WeDemo App交互时序说明文档](https://github.com/Tencent/WeDemo/wiki/WeDemo-App交互时序说明文档) 14 | 15 | * [WeDemo客户端接入指南](https://github.com/Tencent/WeDemo/wiki/WeDemo客户端接入指南) 16 | 17 | * [WeDemo生成密钥与自签名证书指南](https://github.com/Tencent/WeDemo/wiki/WeDemo生成密钥与自签名证书指南) 18 | 19 | * [WeDemo后台(PHP)接入指南](https://github.com/Tencent/WeDemo/wiki/WeDemo后台(PHP)接入指南) 20 | 21 | ##License 22 | Copyright (c) 2016 Tencent 23 | 24 | Permission is hereby granted, free of charge, to any person obtaining a copy 25 | of this software and associated documentation files (the "Software"), to deal 26 | in the Software without restriction, including without limitation the rights 27 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 28 | copies of the Software, and to permit persons to whom the Software is 29 | furnished to do so, subject to the following conditions: 30 | 31 | The above copyright notice and this permission notice shall be included in all 32 | copies or substantial portions of the Software. 33 | 34 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 35 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 36 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 37 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 38 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 39 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 40 | SOFTWARE. 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /doc/image/BundleId.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/doc/image/BundleId.jpg -------------------------------------------------------------------------------- /doc/image/Debug.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/doc/image/Debug.jpg -------------------------------------------------------------------------------- /doc/image/Index.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/doc/image/Index.jpg -------------------------------------------------------------------------------- /doc/image/Log.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/doc/image/Log.jpg -------------------------------------------------------------------------------- /doc/image/RSAPublicKey.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/doc/image/RSAPublicKey.jpg -------------------------------------------------------------------------------- /doc/image/SKExpired.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/doc/image/SKExpired.png -------------------------------------------------------------------------------- /doc/image/WXAppInfo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/doc/image/WXAppInfo.jpg -------------------------------------------------------------------------------- /doc/image/accessTokenExpired.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/doc/image/accessTokenExpired.png -------------------------------------------------------------------------------- /doc/image/appBindWX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/doc/image/appBindWX.png -------------------------------------------------------------------------------- /doc/image/bindAppLogin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/doc/image/bindAppLogin.png -------------------------------------------------------------------------------- /doc/image/bindAppRegister.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/doc/image/bindAppRegister.png -------------------------------------------------------------------------------- /doc/image/checkLogin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/doc/image/checkLogin.png -------------------------------------------------------------------------------- /doc/image/config_step1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/doc/image/config_step1.png -------------------------------------------------------------------------------- /doc/image/config_step2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/doc/image/config_step2.png -------------------------------------------------------------------------------- /doc/image/config_step3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/doc/image/config_step3.png -------------------------------------------------------------------------------- /doc/image/config_step4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/doc/image/config_step4.png -------------------------------------------------------------------------------- /doc/image/config_step5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/doc/image/config_step5.png -------------------------------------------------------------------------------- /doc/image/config_step6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/doc/image/config_step6.png -------------------------------------------------------------------------------- /doc/image/connect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/doc/image/connect.png -------------------------------------------------------------------------------- /doc/image/defaultHost.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/doc/image/defaultHost.jpg -------------------------------------------------------------------------------- /doc/image/getUserInfo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/doc/image/getUserInfo.png -------------------------------------------------------------------------------- /doc/image/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/doc/image/login.png -------------------------------------------------------------------------------- /doc/image/refreshTokenExpired.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/doc/image/refreshTokenExpired.png -------------------------------------------------------------------------------- /doc/image/register.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/doc/image/register.png -------------------------------------------------------------------------------- /doc/image/serverCer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/doc/image/serverCer.jpg -------------------------------------------------------------------------------- /doc/image/wxLogin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/doc/image/wxLogin.png -------------------------------------------------------------------------------- /iOS/WeDemo/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/iOS/WeDemo/Default-568h@2x.png -------------------------------------------------------------------------------- /iOS/WeDemo/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (3.1.0): 3 | - AFNetworking/NSURLSession (= 3.1.0) 4 | - AFNetworking/Reachability (= 3.1.0) 5 | - AFNetworking/Security (= 3.1.0) 6 | - AFNetworking/Serialization (= 3.1.0) 7 | - AFNetworking/UIKit (= 3.1.0) 8 | - AFNetworking/NSURLSession (3.1.0): 9 | - AFNetworking/Reachability 10 | - AFNetworking/Security 11 | - AFNetworking/Serialization 12 | - AFNetworking/Reachability (3.1.0) 13 | - AFNetworking/Security (3.1.0) 14 | - AFNetworking/Serialization (3.1.0) 15 | - AFNetworking/UIKit (3.1.0): 16 | - AFNetworking/NSURLSession 17 | 18 | DEPENDENCIES: 19 | - AFNetworking 20 | 21 | SPEC CHECKSUMS: 22 | AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67 23 | 24 | PODFILE CHECKSUM: 7c16eaa2599d6ba23e2c7f0bf770e2f3dca36a44 25 | 26 | COCOAPODS: 1.1.1 27 | -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/AFNetworking/AFNetworking/AFNetworking.h: -------------------------------------------------------------------------------- 1 | // AFNetworking.h 2 | // 3 | // Copyright (c) 2013 AFNetworking (http://afnetworking.com/) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #import 24 | #import 25 | #import 26 | 27 | #ifndef _AFNETWORKING_ 28 | #define _AFNETWORKING_ 29 | 30 | #import "AFURLRequestSerialization.h" 31 | #import "AFURLResponseSerialization.h" 32 | #import "AFSecurityPolicy.h" 33 | 34 | #if !TARGET_OS_WATCH 35 | #import "AFNetworkReachabilityManager.h" 36 | #endif 37 | 38 | #import "AFURLSessionManager.h" 39 | #import "AFHTTPSessionManager.h" 40 | 41 | #endif /* _AFNETWORKING_ */ 42 | -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/AFNetworking/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011–2016 Alamofire Software Foundation (http://alamofire.org/) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIActivityIndicatorView+AFNetworking.h 2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if TARGET_OS_IOS || TARGET_OS_TV 27 | 28 | #import 29 | 30 | /** 31 | This category adds methods to the UIKit framework's `UIActivityIndicatorView` class. The methods in this category provide support for automatically starting and stopping animation depending on the loading state of a session task. 32 | */ 33 | @interface UIActivityIndicatorView (AFNetworking) 34 | 35 | ///---------------------------------- 36 | /// @name Animating for Session Tasks 37 | ///---------------------------------- 38 | 39 | /** 40 | Binds the animating state to the state of the specified task. 41 | 42 | @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. 43 | */ 44 | - (void)setAnimatingWithStateOfTask:(nullable NSURLSessionTask *)task; 45 | 46 | @end 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+AFNetworking.h 3 | // 4 | // 5 | // Created by Paulo Ferreira on 08/07/15. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #if TARGET_OS_IOS || TARGET_OS_TV 26 | 27 | #import 28 | 29 | @interface UIImage (AFNetworking) 30 | 31 | + (UIImage*) safeImageWithData:(NSData*)data; 32 | 33 | @end 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIKit+AFNetworking.h 2 | // 3 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #if TARGET_OS_IOS || TARGET_OS_TV 24 | #import 25 | 26 | #ifndef _UIKIT_AFNETWORKING_ 27 | #define _UIKIT_AFNETWORKING_ 28 | 29 | #if TARGET_OS_IOS 30 | #import "AFAutoPurgingImageCache.h" 31 | #import "AFImageDownloader.h" 32 | #import "AFNetworkActivityIndicatorManager.h" 33 | #import "UIRefreshControl+AFNetworking.h" 34 | #import "UIWebView+AFNetworking.h" 35 | #endif 36 | 37 | #import "UIActivityIndicatorView+AFNetworking.h" 38 | #import "UIButton+AFNetworking.h" 39 | #import "UIImageView+AFNetworking.h" 40 | #import "UIProgressView+AFNetworking.h" 41 | #endif /* _UIKIT_AFNETWORKING_ */ 42 | #endif 43 | -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIProgressView+AFNetworking.h 2 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | 24 | #import 25 | 26 | #if TARGET_OS_IOS || TARGET_OS_TV 27 | 28 | #import 29 | 30 | NS_ASSUME_NONNULL_BEGIN 31 | 32 | 33 | /** 34 | This category adds methods to the UIKit framework's `UIProgressView` class. The methods in this category provide support for binding the progress to the upload and download progress of a session task. 35 | */ 36 | @interface UIProgressView (AFNetworking) 37 | 38 | ///------------------------------------ 39 | /// @name Setting Session Task Progress 40 | ///------------------------------------ 41 | 42 | /** 43 | Binds the progress to the upload progress of the specified session task. 44 | 45 | @param task The session task. 46 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 47 | */ 48 | - (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task 49 | animated:(BOOL)animated; 50 | 51 | /** 52 | Binds the progress to the download progress of the specified session task. 53 | 54 | @param task The session task. 55 | @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 56 | */ 57 | - (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task 58 | animated:(BOOL)animated; 59 | 60 | @end 61 | 62 | NS_ASSUME_NONNULL_END 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h: -------------------------------------------------------------------------------- 1 | // UIRefreshControl+AFNetworking.m 2 | // 3 | // Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #import 24 | 25 | #import 26 | 27 | #if TARGET_OS_IOS 28 | 29 | #import 30 | 31 | NS_ASSUME_NONNULL_BEGIN 32 | 33 | /** 34 | This category adds methods to the UIKit framework's `UIRefreshControl` class. The methods in this category provide support for automatically beginning and ending refreshing depending on the loading state of a session task. 35 | */ 36 | @interface UIRefreshControl (AFNetworking) 37 | 38 | ///----------------------------------- 39 | /// @name Refreshing for Session Tasks 40 | ///----------------------------------- 41 | 42 | /** 43 | Binds the refreshing state to the state of the specified task. 44 | 45 | @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. 46 | */ 47 | - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task; 48 | 49 | @end 50 | 51 | NS_ASSUME_NONNULL_END 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Private/AFNetworking/AFAutoPurgingImageCache.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Private/AFNetworking/AFHTTPSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPSessionManager.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Private/AFNetworking/AFImageDownloader.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFImageDownloader.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Private/AFNetworking/AFNetworkActivityIndicatorManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Private/AFNetworking/AFNetworkReachabilityManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworkReachabilityManager.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Private/AFNetworking/AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworking.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Private/AFNetworking/AFSecurityPolicy.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFSecurityPolicy.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Private/AFNetworking/AFURLRequestSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLRequestSerialization.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Private/AFNetworking/AFURLResponseSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLResponseSerialization.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Private/AFNetworking/AFURLSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLSessionManager.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Private/AFNetworking/UIActivityIndicatorView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Private/AFNetworking/UIButton+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Private/AFNetworking/UIImage+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Private/AFNetworking/UIImageView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Private/AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Private/AFNetworking/UIProgressView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Private/AFNetworking/UIRefreshControl+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Private/AFNetworking/UIWebView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Public/AFNetworking/AFAutoPurgingImageCache.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Public/AFNetworking/AFHTTPSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFHTTPSessionManager.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Public/AFNetworking/AFImageDownloader.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFImageDownloader.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Public/AFNetworking/AFNetworkActivityIndicatorManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Public/AFNetworking/AFNetworkReachabilityManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworkReachabilityManager.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Public/AFNetworking/AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFNetworking.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Public/AFNetworking/AFSecurityPolicy.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFSecurityPolicy.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Public/AFNetworking/AFURLRequestSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLRequestSerialization.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Public/AFNetworking/AFURLResponseSerialization.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLResponseSerialization.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Public/AFNetworking/AFURLSessionManager.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/AFNetworking/AFURLSessionManager.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Public/AFNetworking/UIActivityIndicatorView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Public/AFNetworking/UIButton+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Public/AFNetworking/UIImage+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Public/AFNetworking/UIImageView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Public/AFNetworking/UIKit+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Public/AFNetworking/UIProgressView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Public/AFNetworking/UIRefreshControl+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Headers/Public/AFNetworking/UIWebView+AFNetworking.h: -------------------------------------------------------------------------------- 1 | ../../../AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (3.1.0): 3 | - AFNetworking/NSURLSession (= 3.1.0) 4 | - AFNetworking/Reachability (= 3.1.0) 5 | - AFNetworking/Security (= 3.1.0) 6 | - AFNetworking/Serialization (= 3.1.0) 7 | - AFNetworking/UIKit (= 3.1.0) 8 | - AFNetworking/NSURLSession (3.1.0): 9 | - AFNetworking/Reachability 10 | - AFNetworking/Security 11 | - AFNetworking/Serialization 12 | - AFNetworking/Reachability (3.1.0) 13 | - AFNetworking/Security (3.1.0) 14 | - AFNetworking/Serialization (3.1.0) 15 | - AFNetworking/UIKit (3.1.0): 16 | - AFNetworking/NSURLSession 17 | 18 | DEPENDENCIES: 19 | - AFNetworking 20 | 21 | SPEC CHECKSUMS: 22 | AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67 23 | 24 | PODFILE CHECKSUM: 7c16eaa2599d6ba23e2c7f0bf770e2f3dca36a44 25 | 26 | COCOAPODS: 1.1.1 27 | -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Pods.xcodeproj/xcuserdata/jeasonzhu.xcuserdatad/xcschemes/AFNetworking.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Pods.xcodeproj/xcuserdata/jeasonzhu.xcuserdatad/xcschemes/Pods-WeDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Pods.xcodeproj/xcuserdata/jeasonzhu.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | AFNetworking.xcscheme 8 | 9 | isShown 10 | 11 | 12 | Pods-WeDemo.xcscheme 13 | 14 | isShown 15 | 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 04181F9796CADC9FF79EB76E86B8BE5B 21 | 22 | primary 23 | 24 | 25 | 9E033EDB5EC0819481B0546434FA577B 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Target Support Files/AFNetworking/AFNetworking-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_AFNetworking : NSObject 3 | @end 4 | @implementation PodsDummy_AFNetworking 5 | @end 6 | -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Target Support Files/AFNetworking/AFNetworking-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #ifndef TARGET_OS_IOS 6 | #define TARGET_OS_IOS TARGET_OS_IPHONE 7 | #endif 8 | 9 | #ifndef TARGET_OS_WATCH 10 | #define TARGET_OS_WATCH 0 11 | #endif 12 | 13 | #ifndef TARGET_OS_TV 14 | #define TARGET_OS_TV 0 15 | #endif 16 | -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Target Support Files/AFNetworking/AFNetworking.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/AFNetworking 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/AFNetworking" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" 4 | OTHER_LDFLAGS = -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Target Support Files/Pods-WeDemo/Pods-WeDemo-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## AFNetworking 5 | 6 | Copyright (c) 2011–2016 Alamofire Software Foundation (http://alamofire.org/) 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - https://cocoapods.org 27 | -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Target Support Files/Pods-WeDemo/Pods-WeDemo-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2011–2016 Alamofire Software Foundation (http://alamofire.org/) 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | License 38 | MIT 39 | Title 40 | AFNetworking 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Generated by CocoaPods - https://cocoapods.org 47 | Title 48 | 49 | Type 50 | PSGroupSpecifier 51 | 52 | 53 | StringsTable 54 | Acknowledgements 55 | Title 56 | Acknowledgements 57 | 58 | 59 | -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Target Support Files/Pods-WeDemo/Pods-WeDemo-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_WeDemo : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_WeDemo 5 | @end 6 | -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Target Support Files/Pods-WeDemo/Pods-WeDemo.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" 4 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking" 5 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" 6 | OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking" -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" 7 | PODS_BUILD_DIR = $BUILD_DIR 8 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /iOS/WeDemo/Pods/Target Support Files/Pods-WeDemo/Pods-WeDemo.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" 4 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking" 5 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" 6 | OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking" -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration" 7 | PODS_BUILD_DIR = $BUILD_DIR 8 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo.xcodeproj/project.xcworkspace/xcuserdata/jeasonzhu.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/iOS/WeDemo/WeDemo.xcodeproj/project.xcworkspace/xcuserdata/jeasonzhu.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo.xcodeproj/xcuserdata/jeasonzhu.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | WeDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 1085451C1E52F3EA008FFE2F 16 | 17 | primary 18 | 19 | 20 | 108545351E52F3EA008FFE2F 21 | 22 | primary 23 | 24 | 25 | 108545401E52F3EA008FFE2F 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo.xcworkspace/xcuserdata/jeasonzhu.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/iOS/WeDemo/WeDemo.xcworkspace/xcuserdata/jeasonzhu.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo.xcworkspace/xcuserdata/jeasonzhu.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @class DocumentsViewController; 10 | @class UserInfoViewController; 11 | @class MessageBoardViewController; 12 | 13 | @interface AppDelegate : UIResponder 14 | 15 | @property (strong, nonatomic) UIWindow *window; 16 | @property (nonatomic, strong) DocumentsViewController *documentsView; 17 | @property (nonatomic, strong) UserInfoViewController *userInfoView; 18 | @property (nonatomic, strong) MessageBoardViewController *messageBoardView; 19 | @property (nonatomic, assign) BOOL keyboardWasShown; 20 | 21 | @end 22 | 23 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "size" : "29x29", 15 | "idiom" : "iphone", 16 | "filename" : "appIcon58.png", 17 | "scale" : "2x" 18 | }, 19 | { 20 | "size" : "29x29", 21 | "idiom" : "iphone", 22 | "filename" : "appIcon87.png", 23 | "scale" : "3x" 24 | }, 25 | { 26 | "size" : "40x40", 27 | "idiom" : "iphone", 28 | "filename" : "appIcon80.png", 29 | "scale" : "2x" 30 | }, 31 | { 32 | "size" : "40x40", 33 | "idiom" : "iphone", 34 | "filename" : "appIcon120.png", 35 | "scale" : "3x" 36 | }, 37 | { 38 | "size" : "60x60", 39 | "idiom" : "iphone", 40 | "filename" : "appIcon120-1.png", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "size" : "60x60", 45 | "idiom" : "iphone", 46 | "filename" : "appIcon180.png", 47 | "scale" : "3x" 48 | } 49 | ], 50 | "info" : { 51 | "version" : 1, 52 | "author" : "xcode" 53 | } 54 | } -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/AppIcon.appiconset/appIcon120-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/iOS/WeDemo/WeDemo/Images.xcassets/AppIcon.appiconset/appIcon120-1.png -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/AppIcon.appiconset/appIcon120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/iOS/WeDemo/WeDemo/Images.xcassets/AppIcon.appiconset/appIcon120.png -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/AppIcon.appiconset/appIcon180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/iOS/WeDemo/WeDemo/Images.xcassets/AppIcon.appiconset/appIcon180.png -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/AppIcon.appiconset/appIcon58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/iOS/WeDemo/WeDemo/Images.xcassets/AppIcon.appiconset/appIcon58.png -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/AppIcon.appiconset/appIcon80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/iOS/WeDemo/WeDemo/Images.xcassets/AppIcon.appiconset/appIcon80.png -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/AppIcon.appiconset/appIcon87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/iOS/WeDemo/WeDemo/Images.xcassets/AppIcon.appiconset/appIcon87.png -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/AppLogo.imageset/AppLogo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/iOS/WeDemo/WeDemo/Images.xcassets/AppLogo.imageset/AppLogo@2x.png -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/AppLogo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "AppLogo@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/AskLoginIcon.imageset/AskLoginIcon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/iOS/WeDemo/WeDemo/Images.xcassets/AskLoginIcon.imageset/AskLoginIcon@2x.png -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/AskLoginIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "AskLoginIcon@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/documentsIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "documentsIcon@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/documentsIcon.imageset/documentsIcon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/iOS/WeDemo/WeDemo/Images.xcassets/documentsIcon.imageset/documentsIcon@2x.png -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/documentsSelectIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "documentsSelectIcon@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/documentsSelectIcon.imageset/documentsSelectIcon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/iOS/WeDemo/WeDemo/Images.xcassets/documentsSelectIcon.imageset/documentsSelectIcon@2x.png -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/messageBoardIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "messageBoardIcon@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/messageBoardIcon.imageset/messageBoardIcon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/iOS/WeDemo/WeDemo/Images.xcassets/messageBoardIcon.imageset/messageBoardIcon@2x.png -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/messageBoardSelectedIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "messageBoardSelectedIcon@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/messageBoardSelectedIcon.imageset/messageBoardSelectedIcon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/iOS/WeDemo/WeDemo/Images.xcassets/messageBoardSelectedIcon.imageset/messageBoardSelectedIcon@2x.png -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/newCommentIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "newCommentIcon@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/newCommentIcon.imageset/newCommentIcon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/iOS/WeDemo/WeDemo/Images.xcassets/newCommentIcon.imageset/newCommentIcon@2x.png -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/userIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "userIcon@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/userIcon.imageset/userIcon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/iOS/WeDemo/WeDemo/Images.xcassets/userIcon.imageset/userIcon@2x.png -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/userSelectedIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "userSelectedIcon@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/userSelectedIcon.imageset/userSelectedIcon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/iOS/WeDemo/WeDemo/Images.xcassets/userSelectedIcon.imageset/userSelectedIcon@2x.png -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/weChatLoginDocumentIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "weChatLoginDocumentIcon@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/weChatLoginDocumentIcon.imageset/weChatLoginDocumentIcon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/iOS/WeDemo/WeDemo/Images.xcassets/weChatLoginDocumentIcon.imageset/weChatLoginDocumentIcon@2x.png -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/weChatMoreDocumentIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "weChatMoreDocumentIcon@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/weChatMoreDocumentIcon.imageset/weChatMoreDocumentIcon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/iOS/WeDemo/WeDemo/Images.xcassets/weChatMoreDocumentIcon.imageset/weChatMoreDocumentIcon@2x.png -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/weChatPayDocumentIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "weChatPayDocumentIcon@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/weChatPayDocumentIcon.imageset/weChatPayDocumentIcon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/iOS/WeDemo/WeDemo/Images.xcassets/weChatPayDocumentIcon.imageset/weChatPayDocumentIcon@2x.png -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/weChatShareDocumentIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "weChatShareDocumentIcon@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/weChatShareDocumentIcon.imageset/weChatShareDocumentIcon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/iOS/WeDemo/WeDemo/Images.xcassets/weChatShareDocumentIcon.imageset/weChatShareDocumentIcon@2x.png -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/wxLoginBackground.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "wxLoginBackground.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/wxLoginBackground.imageset/wxLoginBackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/iOS/WeDemo/WeDemo/Images.xcassets/wxLoginBackground.imageset/wxLoginBackground.png -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/wxLogo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "wxLogo@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/wxLogo.imageset/wxLogo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/iOS/WeDemo/WeDemo/Images.xcassets/wxLogo.imageset/wxLogo@2x.png -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/wxLogoGreen.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "pic_logo_1082168b9.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Images.xcassets/wxLogoGreen.imageset/pic_logo_1082168b9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/iOS/WeDemo/WeDemo/Images.xcassets/wxLogoGreen.imageset/pic_logo_1082168b9.png -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | zh_CN 7 | CFBundleDisplayName 8 | WeDemo 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleURLTypes 24 | 25 | 26 | CFBundleTypeRole 27 | Editor 28 | CFBundleURLIconFile 29 | 30 | CFBundleURLName 31 | wechatauthdemo 32 | CFBundleURLSchemes 33 | 34 | wxbeafe42095e03edf 35 | 36 | 37 | 38 | CFBundleVersion 39 | 1 40 | LSApplicationQueriesSchemes 41 | 42 | weixin 43 | wechat 44 | 45 | LSRequiresIPhoneOS 46 | 47 | NSAppTransportSecurity 48 | 49 | NSAllowsArbitraryLoads 50 | 51 | 52 | UIRequiredDeviceCapabilities 53 | 54 | armv7 55 | 56 | UISupportedInterfaceOrientations 57 | 58 | UIInterfaceOrientationPortrait 59 | UIInterfaceOrientationLandscapeLeft 60 | UIInterfaceOrientationLandscapeRight 61 | 62 | WXAppInfo 63 | 64 | AppDescription 65 | Auth Demo 3.0 66 | AppId 67 | wxbeafe42095e03edf 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Model/Common/ADAccessLog.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | 10 | 11 | @interface ADAccessLog : NSObject 12 | 13 | @property (nonatomic, assign) double loginTime; 14 | @property (nonatomic, assign) ADLoginType loginType; 15 | 16 | + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict; 17 | - (instancetype)initWithDictionary:(NSDictionary *)dict; 18 | - (NSDictionary *)dictionaryRepresentation; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Model/Common/ADAccessLog.m: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import "ADAccessLog.h" 8 | 9 | 10 | NSString *const kADAccessLogLoginTime = @"login_time"; 11 | NSString *const kADAccessLogLoginType = @"login_type"; 12 | 13 | @interface ADAccessLog () 14 | 15 | - (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict; 16 | 17 | @end 18 | 19 | @implementation ADAccessLog 20 | 21 | @synthesize loginTime = _loginTime; 22 | @synthesize loginType = _loginType; 23 | 24 | + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict 25 | { 26 | return [[self alloc] initWithDictionary:dict]; 27 | } 28 | 29 | - (instancetype)initWithDictionary:(NSDictionary *)dict 30 | { 31 | self = [super init]; 32 | 33 | // This check serves to make sure that a non-NSDictionary object 34 | // passed into the model class doesn't break the parsing. 35 | if(self && [dict isKindOfClass:[NSDictionary class]]) { 36 | self.loginTime = [[self objectOrNilForKey:kADAccessLogLoginTime fromDictionary:dict] doubleValue]; 37 | self.loginType = [[self objectOrNilForKey:kADAccessLogLoginType fromDictionary:dict] intValue]; 38 | } 39 | 40 | return self; 41 | 42 | } 43 | 44 | - (NSDictionary *)dictionaryRepresentation 45 | { 46 | NSMutableDictionary *mutableDict = [NSMutableDictionary dictionary]; 47 | [mutableDict setValue:[NSNumber numberWithDouble:self.loginTime] forKey:kADAccessLogLoginTime]; 48 | [mutableDict setValue:[NSNumber numberWithInt:self.loginType] forKey:kADAccessLogLoginType]; 49 | 50 | return [NSDictionary dictionaryWithDictionary:mutableDict]; 51 | } 52 | 53 | - (NSString *)description 54 | { 55 | return [NSString stringWithFormat:@"%@", [self dictionaryRepresentation]]; 56 | } 57 | 58 | #pragma mark - Helper Method 59 | - (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict 60 | { 61 | id object = [dict objectForKey:aKey]; 62 | return [object isEqual:[NSNull null]] ? nil : object; 63 | } 64 | 65 | 66 | #pragma mark - NSCoding Methods 67 | 68 | - (id)initWithCoder:(NSCoder *)aDecoder 69 | { 70 | self = [super init]; 71 | 72 | self.loginTime = [aDecoder decodeDoubleForKey:kADAccessLogLoginTime]; 73 | self.loginType = [aDecoder decodeIntForKey:kADAccessLogLoginType]; 74 | return self; 75 | } 76 | 77 | - (void)encodeWithCoder:(NSCoder *)aCoder 78 | { 79 | 80 | [aCoder encodeDouble:_loginTime forKey:kADAccessLogLoginTime]; 81 | [aCoder encodeInt:_loginType forKey:kADAccessLogLoginType]; 82 | } 83 | 84 | - (id)copyWithZone:(NSZone *)zone 85 | { 86 | ADAccessLog *copy = [[ADAccessLog alloc] init]; 87 | 88 | if (copy) { 89 | 90 | copy.loginTime = self.loginTime; 91 | copy.loginType = self.loginType; 92 | } 93 | 94 | return copy; 95 | } 96 | 97 | 98 | @end 99 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Model/Common/ADBaseResp.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | 10 | 11 | @interface ADBaseResp : NSObject 12 | 13 | @property (nonatomic, assign) ADErrorCode errcode; 14 | @property (nonatomic, strong) NSString *errmsg; 15 | 16 | + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict; 17 | - (instancetype)initWithDictionary:(NSDictionary *)dict; 18 | - (NSDictionary *)dictionaryRepresentation; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Model/Common/ADNetworkConfigItem.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | AUTH_DEMO_EXTERN NSString *const kEncryptWholePacketParaKey; 10 | 11 | @interface ADNetworkConfigItem : NSObject 12 | 13 | @property (nonatomic, strong) NSString *cgiName; 14 | @property (nonatomic, strong) NSString *encryptKeyPath; 15 | @property (nonatomic, assign) EncryptAlgorithm encryptAlgorithm; 16 | @property (nonatomic, assign) EncryptAlgorithm decryptAlgorithm; 17 | @property (nonatomic, strong) NSString *requestPath; 18 | @property (nonatomic, strong) NSString *decryptKeyPath; 19 | @property (nonatomic, strong) NSString *httpMethod; 20 | @property (nonatomic, strong) NSString *sysErrKeyPath; 21 | 22 | + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict; 23 | - (instancetype)initWithDictionary:(NSDictionary *)dict; 24 | - (NSDictionary *)dictionaryRepresentation; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Model/Common/Common.json: -------------------------------------------------------------------------------- 1 | { 2 | "base_resp" : { 3 | "errcode" : 20001, 4 | "errmsg" : "1234" 5 | }, 6 | "access_log" : [ 7 | { 8 | "login_time" : 12345, 9 | "login_type" : 1 10 | }, 11 | { 12 | "login_time" : 12345, 13 | "login_type" : 1 14 | } 15 | ], 16 | "network_config_item": { 17 | "cgi_name": "12345", 18 | "request_path": "12345", 19 | "http_method": "PUT", 20 | "encrypt_algorithm": 1, 21 | "decrypt_algorithm": 1, 22 | "encrypt_key_path": "123456", 23 | "decrypt_key_path": "123456", 24 | "sys_err_key_path": "123456" 25 | }, 26 | "resp_object": { 27 | "errcode": -1, 28 | "resp_buffer": "buffer" 29 | } 30 | } -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Model/Common/DataModels.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at //http://opensource.org/licenses/MIT //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. #import "ADConnectResp.h" #import "ADWXLoginResp.h" #import "ADBaseResp.h" #import "ADGetUserInfoResp.h" #import "ADAccessLog.h" #import "ADCheckLoginResp.h" #import "ADUserInfo.h" #import "ADNetworkConfigItem.h" #import "ADGetCommentListResp.h" #import "ADAddCommentResp.h" #import "ADGetReplyListResp.h" #import "ADAddReplyResp.h" -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Model/LogicSvr/ADAddCommentResp.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @class ADBaseResp, ADCommentList; 10 | 11 | @interface ADAddCommentResp : NSObject 12 | 13 | @property (nonatomic, strong) ADBaseResp *baseResp; 14 | @property (nonatomic, strong) ADCommentList *comment; 15 | 16 | + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict; 17 | - (instancetype)initWithDictionary:(NSDictionary *)dict; 18 | - (NSDictionary *)dictionaryRepresentation; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Model/LogicSvr/ADAddReplyResp.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @class ADBaseResp, ADReplyList; 10 | 11 | @interface ADAddReplyResp : NSObject 12 | 13 | @property (nonatomic, strong) ADBaseResp *baseResp; 14 | @property (nonatomic, strong) ADReplyList *reply; 15 | 16 | + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict; 17 | - (instancetype)initWithDictionary:(NSDictionary *)dict; 18 | - (NSDictionary *)dictionaryRepresentation; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Model/LogicSvr/ADCheckLoginResp.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @class ADBaseResp; 10 | 11 | @interface ADCheckLoginResp : NSObject 12 | 13 | @property (nonatomic, strong) ADBaseResp *baseResp; 14 | @property (nonatomic, strong) NSString *sessionKey; 15 | @property (nonatomic, assign) double expireTime; 16 | 17 | + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict; 18 | - (instancetype)initWithDictionary:(NSDictionary *)dict; 19 | - (NSDictionary *)dictionaryRepresentation; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Model/LogicSvr/ADCommentList.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @class ADUser; 10 | 11 | @interface ADCommentList : NSObject 12 | 13 | @property (nonatomic, assign) double date; 14 | @property (nonatomic, strong) NSString *commentListIdentifier; 15 | @property (nonatomic, strong) NSString *content; 16 | @property (nonatomic, assign) double replyCount; 17 | @property (nonatomic, strong) ADUser *user; 18 | @property (nonatomic, strong) NSArray *replyList; 19 | @property (nonatomic, assign) CGFloat height; 20 | 21 | + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict; 22 | - (instancetype)initWithDictionary:(NSDictionary *)dict; 23 | - (NSDictionary *)dictionaryRepresentation; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Model/LogicSvr/ADConnectResp.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @class ADBaseResp; 10 | 11 | @interface ADConnectResp : NSObject 12 | 13 | @property (nonatomic, strong) ADBaseResp *baseResp; 14 | @property (nonatomic, assign) double tempUin; 15 | 16 | + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict; 17 | - (instancetype)initWithDictionary:(NSDictionary *)dict; 18 | - (NSDictionary *)dictionaryRepresentation; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Model/LogicSvr/ADGetCommentListResp.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @class ADBaseResp; 10 | 11 | @interface ADGetCommentListResp : NSObject 12 | 13 | @property (nonatomic, strong) ADBaseResp *baseResp; 14 | @property (nonatomic, strong) NSArray *commentList; 15 | @property (nonatomic, assign) double commentCount; 16 | @property (nonatomic, assign) double perpage; 17 | 18 | + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict; 19 | - (instancetype)initWithDictionary:(NSDictionary *)dict; 20 | - (NSDictionary *)dictionaryRepresentation; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Model/LogicSvr/ADGetReplyListResp.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @class ADBaseResp; 10 | 11 | @interface ADGetReplyListResp : NSObject 12 | 13 | @property (nonatomic, strong) ADBaseResp *baseResp; 14 | @property (nonatomic, strong) NSArray *replyList; 15 | 16 | + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict; 17 | - (instancetype)initWithDictionary:(NSDictionary *)dict; 18 | - (NSDictionary *)dictionaryRepresentation; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Model/LogicSvr/ADGetUserInfoResp.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @class ADBaseResp; 10 | 11 | @interface ADGetUserInfoResp : NSObject 12 | 13 | @property (nonatomic, strong) NSString *mail; 14 | @property (nonatomic, strong) NSString *openid; 15 | @property (nonatomic, strong) NSString *nickname; 16 | @property (nonatomic, strong) ADBaseResp *baseResp; 17 | @property (nonatomic, strong) NSString *headimgurl; 18 | @property (nonatomic, strong) NSString *unionid; 19 | @property (nonatomic, strong) NSString *city; 20 | @property (nonatomic, strong) NSString *province; 21 | @property (nonatomic, strong) NSString *country; 22 | @property (nonatomic, assign) int64_t refreshTokenExpireTime; 23 | @property (nonatomic, assign) ADSexType sex; 24 | @property (nonatomic, assign) int64_t accessTokenExpireTime; 25 | @property (nonatomic, strong) NSArray *accessLog; 26 | 27 | + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict; 28 | - (instancetype)initWithDictionary:(NSDictionary *)dict; 29 | - (NSDictionary *)dictionaryRepresentation; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Model/LogicSvr/ADReplyList.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @class ADUser; 10 | 11 | @interface ADReplyList : NSObject 12 | 13 | @property (nonatomic, strong) ADUser *user; 14 | @property (nonatomic, strong) NSString *replyListIdentifier; 15 | @property (nonatomic, strong) NSString *content; 16 | @property (nonatomic, strong) NSString *replyToId; 17 | @property (nonatomic, assign) double date; 18 | @property (nonatomic, assign) CGFloat height; 19 | 20 | + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict; 21 | - (instancetype)initWithDictionary:(NSDictionary *)dict; 22 | - (NSDictionary *)dictionaryRepresentation; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Model/LogicSvr/ADUser.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | 10 | 11 | @interface ADUser : NSObject 12 | 13 | @property (nonatomic, assign) double sex; 14 | @property (nonatomic, strong) NSString *country; 15 | @property (nonatomic, strong) NSString *nickname; 16 | @property (nonatomic, strong) NSString *city; 17 | @property (nonatomic, strong) NSString *headimgurl; 18 | @property (nonatomic, strong) NSString *openid; 19 | 20 | + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict; 21 | - (instancetype)initWithDictionary:(NSDictionary *)dict; 22 | - (NSDictionary *)dictionaryRepresentation; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Model/LogicSvr/ADWXLoginResp.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @class ADBaseResp; 10 | 11 | @interface ADWXLoginResp : NSObject 12 | 13 | @property (nonatomic, strong) ADBaseResp *baseResp; 14 | @property (nonatomic, assign) double uin; 15 | @property (nonatomic, strong) NSString *loginTicket; 16 | @property (nonatomic, assign) BOOL hasBindApp; 17 | 18 | + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict; 19 | - (instancetype)initWithDictionary:(NSDictionary *)dict; 20 | - (NSDictionary *)dictionaryRepresentation; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Model/Store/ADUserInfo.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | 10 | 11 | @interface ADUserInfo : NSObject 12 | 13 | @property (nonatomic, strong) NSString *openid; 14 | @property (nonatomic, assign) UInt32 uin; 15 | @property (nonatomic, strong) NSString *mail; 16 | @property (nonatomic, strong) NSString *nickname; 17 | @property (nonatomic, strong) NSString *pwdH1; 18 | @property (nonatomic, strong) NSString *loginTicket; 19 | @property (nonatomic, strong) NSString *unionid; 20 | @property (nonatomic, strong) NSString *authCode; 21 | @property (nonatomic, strong) NSString *headimgurl; 22 | @property (nonatomic, assign) double sessionExpireTime; 23 | @property (nonatomic, assign) ADSexType sex; 24 | 25 | + (instancetype)modelObjectWithDictionary:(NSDictionary *)dict; 26 | - (instancetype)initWithDictionary:(NSDictionary *)dict; 27 | - (NSDictionary *)dictionaryRepresentation; 28 | 29 | + (instancetype)currentUser; 30 | + (instancetype)visitorUser; 31 | - (BOOL)save; 32 | - (BOOL)load; 33 | - (void)clear; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Model/Store/Store.json: -------------------------------------------------------------------------------- 1 | { 2 | "UserInfo" : { 3 | "uin" : 123456, 4 | "mail" : "123456", 5 | "pwd_h1" : "123456", 6 | "nickname" : "123456", 7 | "openid" : "123456", 8 | "login_ticket" : "123456", 9 | "unionid" : "123456", 10 | "auth_code": "123456", 11 | "headimgurl": "1234" 12 | "sex": 1 13 | } 14 | } -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Service/ADKeyChainWrap.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @interface ADKeyChainWrap : NSObject 10 | 11 | + (BOOL)setData:(NSData *)data ForKey:(NSString *)key; 12 | 13 | + (NSData *)getDataForKey:(NSString *)key; 14 | 15 | + (BOOL)deleteDataForKey:(NSString *)key; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Service/ADKeyChainWrap.m: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import "ADKeyChainWrap.h" 8 | #import 9 | 10 | @implementation ADKeyChainWrap 11 | 12 | #pragma mark - Public Methods 13 | + (BOOL)setData:(NSData *)data ForKey:(NSString *)key { 14 | NSMutableDictionary *keychainQuery = [self getKeychainQueryForKey:key]; 15 | if (keychainQuery == nil) { 16 | return NO; 17 | } 18 | SecItemDelete((__bridge_retained CFDictionaryRef)keychainQuery); 19 | keychainQuery[(__bridge_transfer id)kSecValueData] = data; 20 | return SecItemAdd((__bridge_retained CFDictionaryRef)keychainQuery, NULL) == noErr; 21 | } 22 | 23 | + (NSData *)getDataForKey:(NSString *)key { 24 | NSMutableDictionary *keychainQuery = [self getKeychainQueryForKey:key]; 25 | [keychainQuery setObject:(__bridge_transfer id)kCFBooleanTrue 26 | forKey:(__bridge_transfer id)kSecReturnData]; 27 | [keychainQuery setObject:(__bridge_transfer id)kSecMatchLimitOne 28 | forKey:(__bridge_transfer id)kSecMatchLimit]; 29 | CFDataRef keyData = NULL; 30 | NSData *ret = nil; 31 | 32 | if (SecItemCopyMatching((__bridge_retained CFDictionaryRef)keychainQuery, (CFTypeRef *)&keyData) == noErr) { 33 | ret = (__bridge_transfer NSData*)keyData; 34 | } 35 | return ret; 36 | } 37 | 38 | + (BOOL)deleteDataForKey:(NSString *)key { 39 | NSMutableDictionary *keychainQuery = [self getKeychainQueryForKey:key]; 40 | return SecItemDelete((__bridge_retained CFDictionaryRef)keychainQuery) == noErr; 41 | } 42 | 43 | #pragma mark - Private Methods 44 | + (NSMutableDictionary *)getKeychainQueryForKey:(NSString *)key { 45 | if (key == nil) { 46 | return nil; 47 | } 48 | return [@{ 49 | (__bridge_transfer id)kSecClass: (__bridge_transfer id)kSecClassGenericPassword, 50 | (__bridge_transfer id)kSecAttrService: key 51 | } mutableCopy]; 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Service/ADNetworkConfigManager.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | @class ADNetworkConfigItem; 9 | 10 | AUTH_DEMO_EXTERN const NSString *kConnectCGIName; 11 | AUTH_DEMO_EXTERN const NSString *kWXLoginCGIName; 12 | AUTH_DEMO_EXTERN const NSString *kCheckLoginCGIName; 13 | AUTH_DEMO_EXTERN const NSString *kGetUserInfoCGIName; 14 | AUTH_DEMO_EXTERN const NSString *kMakeExpiredCGIName; 15 | AUTH_DEMO_EXTERN const NSString *kGetCommentListCGIName; 16 | AUTH_DEMO_EXTERN const NSString *kGetReplyListCGIName; 17 | AUTH_DEMO_EXTERN const NSString *kAddCommentCGIName; 18 | AUTH_DEMO_EXTERN const NSString *kAddReplyCGIName; 19 | 20 | @interface ADNetworkConfigManager : NSObject 21 | 22 | /** 23 | * 严格单例,唯一获得实例的方法. 24 | * 25 | * @abstract 所有的配置都只会存在内存里,这么做的主要目的是减小安全风险. 26 | * 27 | * @return 实例对象. 28 | */ 29 | + (instancetype)sharedManager; 30 | 31 | /** 32 | * 注册默认的CGI配置属性. 33 | * 34 | * @restrict 该方法需要在任何CGI发起之前调用. 35 | */ 36 | - (void)setup; 37 | 38 | /** 39 | * 增加一个配置. 40 | * 41 | * @param item 要增加的配置 42 | * @param keyPath 该配置的ID 43 | */ 44 | - (void)registerConfig:(ADNetworkConfigItem *)item forKeyPath:(NSString *)keyPath; 45 | 46 | /** 47 | * 删除一个配置. 48 | * 49 | * @param keyPath 要删除的配置的ID 50 | */ 51 | - (void)removeConfigForKeyPath:(NSString *)keyPath; 52 | 53 | /** 54 | * 根据ID获得配置. 55 | * 56 | * @param keyPath 配置的ID 57 | * 58 | * @return 跟配置ID对应的配置属性 59 | */ 60 | - (ADNetworkConfigItem *)getConfigForKeyPath:(NSString *)keyPath; 61 | 62 | /** 63 | * 获得所有配置Key 64 | * 65 | * @return 所有配置Key的数组 66 | */ 67 | - (NSArray *)allConfigKeys; 68 | 69 | 70 | /** 71 | * 保存所有配置 72 | */ 73 | - (void)save; 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Service/ADNetworkEngine.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | #import "BaseNetworkEngine.h" 9 | 10 | @class ADGetCommentListResp; 11 | @class ADGetReplyListResp; 12 | @class ADAddCommentResp; 13 | @class ADAddReplyResp; 14 | 15 | typedef void(^GetCommentListCallBack)(ADGetCommentListResp *resp); 16 | typedef void(^GetReplyListCallBack)(ADGetReplyListResp *resp); 17 | typedef void(^AddCommentCallBack)(ADAddCommentResp *resp); 18 | typedef void(^AddReplyCallBack)(ADAddReplyResp *resp); 19 | 20 | @interface ADNetworkEngine : BaseNetworkEngine 21 | 22 | /** 23 | * 获取某个startId之后的留言板的留言。 24 | * 25 | * @restrict 可以在临时或正式安全通道里进行. 26 | * 27 | * @param uin 正式Uin 28 | * @param startId 开始的留言Id,nil则为从头开始 29 | * @param completion 获取完成的回调,参数包括留言列表,留言个数,每页的最多数量。 30 | */ 31 | - (void)getCommentListForUin:(UInt32)uin 32 | From:(NSString *)startId 33 | WithCompletion:(GetCommentListCallBack)completion; 34 | 35 | /** 36 | * 获取某个留言下的评论。 37 | * 38 | * @restrict 可以在临时或正式安全通道里进行. 39 | * 40 | * @param uin 正式Uin 41 | * @param commentId 该留言的Id 42 | * @param completion 获取完成的回调. 43 | */ 44 | - (void)getReplyListForUin:(UInt32)uin 45 | OfComment:(NSString *)commentId 46 | WithCompletion:(GetReplyListCallBack)completion; 47 | 48 | /** 49 | * 发布一条留言 50 | * 51 | * @restrict 必须在正式安全通道里进行. 52 | * 53 | * @param content 留言的文字 54 | * @param uin 正式uin 55 | * @param loginTicket 用户的登录票据 56 | * @param completion 发布完成的回调 57 | * 58 | */ 59 | - (void)addCommentContent:(NSString *)content 60 | ForUin:(UInt32)uin 61 | LoginTicket:(NSString *)loginTicket 62 | WithCompletion:(AddCommentCallBack)completion; 63 | 64 | /** 65 | * 发布一条评论 66 | * 67 | * @restrict 必须在正式安全通道里进行. 68 | * 69 | * @param content 回复的内容 70 | * @param commentId 留言的Id 71 | * @param replyId 回复的Id 72 | * @param uin 正式Uin 73 | * @param loginTicket 用户的登录票据 74 | * @param completion 发布完成的回调 75 | */ 76 | - (void)addReplyContent:(NSString *)content 77 | ToComment:(NSString *)commentId 78 | OrToReply:(NSString *)replyId 79 | ForUin:(UInt32)uin 80 | LoginTicket:(NSString *)loginTicket 81 | WithCompletion:(AddReplyCallBack)completion; 82 | @end 83 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Service/NetworkHandler/ErrorHandler.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | typedef void(^ErrorSignal)(ADErrorCode code); 10 | 11 | @interface ErrorHandler : NSObject 12 | 13 | /** 14 | * 处理会话过期,Toekn过期时的行为。 15 | * 16 | * @param resp 服务器返回的响应 17 | * @param errorSignal 处理完成后的回调 18 | */ 19 | + (void)handleNetworkExpiredError:(ADBaseResp *)resp 20 | WhileCatchErrorCode:(ErrorSignal)errorSignal; 21 | 22 | @end -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Service/NetworkHandler/ErrorHandler.m: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import "ErrorHandler.h" 8 | #import "ErrorTitle.h" 9 | #import "AppDelegate.h" 10 | #import "WXLoginViewController.h" 11 | #import "ADNetworkEngine.h" 12 | #import "ADUserInfo.h" 13 | #import "ADCheckLoginResp.h" 14 | 15 | static int const kHandleErrorMaxDepth = 3; 16 | 17 | @implementation ErrorHandler 18 | 19 | + (void)handleNetworkExpiredError:(ADBaseResp *)resp 20 | WhileCatchErrorCode:(ErrorSignal)errorSignal { 21 | [self handleNetworkExpiredError:resp 22 | WhileCatchErrorCode:errorSignal 23 | InDepth:0]; 24 | } 25 | 26 | + (void)handleNetworkExpiredError:(ADBaseResp *)resp 27 | WhileCatchErrorCode:(ErrorSignal)errorSignal 28 | InDepth:(int)depth { 29 | if (depth <= kHandleErrorMaxDepth) { 30 | switch (resp.errcode) { 31 | case ADErrorCodeSessionKeyExpired: { //会话过期,再次登录 32 | NSLog(@"Session Key Is Expired"); 33 | [[ADNetworkEngine sharedEngine] checkLoginForUin:[ADUserInfo currentUser].uin 34 | LoginTicket:[ADUserInfo currentUser].loginTicket 35 | WithCompletion:^(ADCheckLoginResp *checkLoginResp) { 36 | if (checkLoginResp && checkLoginResp.sessionKey) { 37 | NSLog(@"Check Login Success"); 38 | [ADUserInfo currentUser].sessionExpireTime = checkLoginResp.expireTime; 39 | [[ADUserInfo currentUser] save]; 40 | errorSignal != nil ? errorSignal(resp.errcode) : nil; 41 | } else { 42 | NSLog(@"Check Login Fail"); 43 | [self handleNetworkExpiredError:resp 44 | WhileCatchErrorCode:nil 45 | InDepth:depth+1]; 46 | } 47 | }]; 48 | break; 49 | }; 50 | default: 51 | errorSignal != nil ? errorSignal(resp.errcode) : nil; 52 | break; 53 | } 54 | } 55 | } 56 | 57 | @end -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Service/NetworkHandler/ErrorTitle.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | #import 9 | 10 | @interface NSString (ErrorTitle) 11 | 12 | /** 13 | * 根据错误码返回对应的错误描述. 14 | * 15 | * @param resp 服务器返回的响应 16 | * @param defaultError 默认错误描述 17 | * 18 | * @return 错误描述语句 19 | */ 20 | + (NSString *)errorTitleFromResponse:(ADBaseResp *)resp 21 | defaultError:(NSString *)defaultError; 22 | 23 | @end -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Service/NetworkHandler/ErrorTitle.m: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import "ErrorTitle.h" 8 | #import "ADNetworkEngine.h" 9 | 10 | @implementation NSString (ErrorTitle) 11 | 12 | + (NSString *)errorTitleFromResponse:(ADBaseResp *)resp 13 | defaultError:(NSString *)defaultError { 14 | if (resp.errmsg) 15 | return resp.errmsg; 16 | 17 | NSString *errorTitle = defaultError; 18 | switch (resp.errcode) { 19 | case ADErrorCodeAlreadyBind: 20 | errorTitle = @"用户已经绑定"; 21 | break; 22 | case ADErrorCodeUserExisted: 23 | errorTitle = @"账号已注册"; 24 | break; 25 | case ADErrorCodeTokenExpired: 26 | case ADErrorCodeTicketExpired: 27 | errorTitle = @"太久没有登录了,为了安全起见,请重新登录"; 28 | break; 29 | case ADErrorCodeTicketNotMatch: 30 | errorTitle = @"登录票据错误"; 31 | break; 32 | case ADErrorCodeUserNotExisted: 33 | errorTitle = @"该账号未注册"; 34 | break; 35 | case ADErrorCodePasswordNotMatch: 36 | errorTitle = @"密码不正确"; 37 | break; 38 | case ADErrorCodeClientDescryptError: 39 | errorTitle = @"网络错误"; 40 | break; 41 | default: 42 | break; 43 | } 44 | return errorTitle; 45 | } 46 | 47 | @end -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Service/NetworkHandler/ImageCache.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @interface UIImage (ImageCache) 10 | 11 | + (UIImage *)getCachedImageForUrl:(NSString *)urlString; 12 | 13 | - (BOOL)cacheForUrl:(NSString *)urlString; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Service/NetworkHandler/ImageCache.m: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import "ImageCache.h" 8 | #import "MD5.h" 9 | 10 | static NSString *kCacheImageDirectory = @"com.wechat.authdemo.image"; 11 | 12 | @implementation UIImage (ImageCache) 13 | 14 | + (UIImage *)getCachedImageForUrl:(NSString *)urlString { 15 | if (!urlString) 16 | return nil; 17 | 18 | NSString *cachePath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject]; 19 | NSString *imageCacheDir = [cachePath stringByAppendingPathComponent:kCacheImageDirectory]; 20 | NSString *filePath = [imageCacheDir stringByAppendingPathComponent:[urlString MD5]]; 21 | 22 | NSData *data = [NSData dataWithContentsOfFile:filePath]; 23 | return [UIImage imageWithData:data]; 24 | } 25 | 26 | - (BOOL)cacheForUrl:(NSString *)urlString { 27 | if (!urlString) 28 | return NO; 29 | 30 | NSString *cachePath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject]; 31 | NSString *imageCacheDir = [cachePath stringByAppendingPathComponent:kCacheImageDirectory]; 32 | NSError *fileError = nil; 33 | [[NSFileManager defaultManager] createDirectoryAtPath:imageCacheDir 34 | withIntermediateDirectories:YES 35 | attributes:nil 36 | error:&fileError]; 37 | if (fileError) { 38 | NSLog(@"File Error: %@", fileError); 39 | return NO; 40 | } 41 | NSString *filePath = [imageCacheDir stringByAppendingPathComponent:[urlString MD5]]; 42 | NSData *data = UIImageJPEGRepresentation(self, 1.0f); 43 | return [data writeToFile:filePath atomically:YES]; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Service/NetworkHandler/JSONRequest.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | typedef void (^JSONCallBack)(NSDictionary *dict, NSError *error); 10 | 11 | @interface AFURLSessionManager (JSONRequest) 12 | 13 | /** 14 | * 网络请求建立的统一接口. 15 | * 16 | * @param host 请求的Host 17 | * @param para 请求的参数 18 | * @param configKeyPath 请求的配置ID, 详情阅读ADNetworkConfigManager 19 | * @param handler 请求完成时的回调 20 | * 21 | */ 22 | 23 | - (NSURLSessionTask *)JSONTaskForHost:(NSString *)host 24 | Para:(NSDictionary *)para 25 | ConfigKeyPath:(NSString *)configKeyPath 26 | WithCompletion:(JSONCallBack)handler; 27 | @end 28 | 29 | @interface AFURLSessionManager (SessionKey) 30 | 31 | @property (nonatomic, retain) NSString *sessionKey; 32 | @property (nonatomic, retain) NSString *publicKey; 33 | 34 | @end 35 | 36 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Service/WXApiManager.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | #import 9 | #import "WXApi.h" 10 | #import "WXApiObject.h" 11 | 12 | @protocol WXAuthDelegate 13 | 14 | @optional 15 | - (void)wxAuthSucceed:(NSString*)code; 16 | - (void)wxAuthDenied; 17 | - (void)wxAuthCancel; 18 | 19 | @end 20 | 21 | @interface WXApiManager : NSObject 22 | 23 | @property (nonatomic, assign) id delegate; 24 | 25 | /** 26 | * 严格单例,唯一获得实例的方法. 27 | * 28 | * @return 实例对象. 29 | */ 30 | + (instancetype)sharedManager; 31 | 32 | /** 33 | * 发送微信验证请求. 34 | * 35 | * @restrict 该方法支持未安装微信的用户. 36 | * 37 | * @param viewController 发起验证的VC 38 | * @param delegate 处理验证结果的代理 39 | */ 40 | - (void)sendAuthRequestWithController:(UIViewController*)viewController 41 | delegate:(id)delegate; 42 | 43 | /** 44 | * 发送链接到微信. 45 | * 46 | * @restrict 该方法要求用户一定要安装微信. 47 | * 48 | * @param urlString 链接的Url 49 | * @param title 链接的Title 50 | * @param desc 链接的描述 51 | * @param scene 发送的场景,分为朋友圈, 会话和收藏 52 | * 53 | * @return 发送成功返回YES 54 | */ 55 | - (BOOL)sendLinkContent:(NSString *)urlString 56 | Title:(NSString *)title 57 | Description:(NSString *)desc 58 | AtScene:(enum WXScene)scene; 59 | /** 60 | * 发送文件到微信. 61 | * 62 | * @restrict 该方法要求用户一定要安装微信. 63 | * 64 | * @param fileData 文件的数据 65 | * @param extension 文件扩展名 66 | * @param title 文件的Title 67 | * @param desc 文件的描述 68 | * @param thumbImage 文件缩略图 69 | * @param scene 发送的场景,分为朋友圈, 会话和收藏 70 | * 71 | * @return 发送成功返回YES 72 | */ 73 | - (BOOL)sendFileData:(NSData *)fileData 74 | fileExtension:(NSString *)extension 75 | Title:(NSString *)title 76 | Description:(NSString *)desc 77 | ThumbImage:(UIImage *)thumbImage 78 | AtScene:(enum WXScene)scene; 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Util/AlertTitleFont.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @interface UILabel (AlertTitleFont) 10 | 11 | @property (nonatomic, copy) UIFont *alertTitleFont UI_APPEARANCE_SELECTOR; 12 | 13 | @end 14 | 15 | @interface UIButton (AlertTitleFont) 16 | 17 | @property (nonatomic, copy) UIFont *alertTitleFont UI_APPEARANCE_SELECTOR; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Util/AlertTitleFont.m: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import "AlertTitleFont.h" 8 | 9 | @implementation UILabel (AlertTitleFont) 10 | 11 | - (void)setAlertTitleFont:(UIFont *)alertTitleFont { 12 | self.font = alertTitleFont; 13 | } 14 | 15 | - (UIFont *)alertTitleFont { 16 | return self.font; 17 | } 18 | 19 | @end 20 | 21 | @implementation UIButton (AlertTitleFont) 22 | 23 | - (void)setAlertTitleFont:(UIFont *)alertTitleFont { 24 | self.titleLabel.font = alertTitleFont; 25 | } 26 | 27 | - (UIFont *)alertTitleFont { 28 | return self.titleLabel.font; 29 | } 30 | @end 31 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Util/ButtonColor.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @interface UIColor (buttonColor) 10 | 11 | + (instancetype)loginButtonColor; 12 | 13 | + (instancetype)linkButtonColor; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Util/ButtonColor.m: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import "ButtonColor.h" 8 | 9 | @implementation UIColor (buttonColor) 10 | 11 | + (instancetype)loginButtonColor { 12 | return [UIColor colorWithRed:0.04 13 | green:0.73 14 | blue:0.03 15 | alpha:1.00]; 16 | } 17 | 18 | + (instancetype)linkButtonColor { 19 | return [UIColor colorWithRed:0.27 20 | green:0.60 21 | blue:0.91 22 | alpha:1.00]; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Util/Definition/Constant.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #ifndef AuthSDKDemo_Constant_h 8 | #define AuthSDKDemo_Constant_h 9 | #import 10 | 11 | static const int inset = 10; 12 | static const int navigationBarHeight = 44; 13 | static const int statusBarHeight = 20; 14 | static const int normalHeight = 44; 15 | static const float kLoginButtonCornerRadius = 4.0f; 16 | static int64_t kRefreshTokenTimeNone = 2592000; 17 | static int64_t kAccessTokenTimeNone = 0; 18 | static NSString* const kChineseFont = @"STHeitiSC-Light"; 19 | static NSString* const kEnglishNumberFont = @"HelveticaNeue"; 20 | static NSString* const kCancleWordingText = @"知道了"; 21 | 22 | #define ScreenWidth [UIScreen mainScreen].bounds.size.width 23 | #define ScreenHeight [UIScreen mainScreen].bounds.size.height 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Util/Encrypt/AES.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @interface NSData (AES) 10 | /** 11 | * AES_256_CBC_PKCS7Padding+HMAC, 加密后输出的格式为IV+AES密文+SHA256+Salt 12 | */ 13 | - (NSData *)AES256EncryptWithKey:(NSString *)key; 14 | - (NSData *)AES256DecryptWithKey:(NSString *)key; 15 | 16 | @end 17 | 18 | @interface NSString (AES) 19 | 20 | - (NSString *)AES256EncryptWithKey:(NSString *)key; 21 | - (NSString *)AES256DecryptWithKey:(NSString *)key; 22 | 23 | @end -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Util/Encrypt/MD5.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @interface NSData (MD5) 10 | 11 | - (NSString *)MD5; 12 | 13 | @end 14 | 15 | @interface NSString (MD5) 16 | 17 | - (NSString *)MD5; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Util/Encrypt/MD5.m: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import "MD5.h" 8 | #import // Need to import for CC_MD5 access 9 | 10 | @implementation NSData (MD5) 11 | 12 | - (NSString*)MD5 { 13 | // Create byte array of unsigned chars 14 | unsigned char md5Buffer[CC_MD5_DIGEST_LENGTH]; 15 | 16 | // Create 16 byte MD5 hash value, store in buffer 17 | CC_MD5([self bytes], (uint32_t)[self length], md5Buffer); 18 | 19 | // Convert unsigned char buffer to NSString of hex values 20 | NSMutableString *output = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH * 2]; 21 | for(int i = 0; i < CC_MD5_DIGEST_LENGTH; i++) 22 | [output appendFormat:@"%02x",md5Buffer[i]]; 23 | 24 | return output; 25 | } 26 | 27 | @end 28 | 29 | @implementation NSString (MD5) 30 | 31 | - (NSString *)MD5 { 32 | // Create pointer to the string as UTF8 33 | const char *ptr = [self UTF8String]; 34 | 35 | // Create byte array of unsigned chars 36 | unsigned char md5Buffer[CC_MD5_DIGEST_LENGTH]; 37 | 38 | // Create 16 byte MD5 hash value, store in buffer 39 | CC_MD5(ptr, (uint32_t)strlen(ptr), md5Buffer); 40 | 41 | // Convert MD5 value in the buffer to NSString of hex values 42 | NSMutableString *output = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH * 2]; 43 | for(int i = 0; i < CC_MD5_DIGEST_LENGTH; i++) 44 | [output appendFormat:@"%02x",md5Buffer[i]]; 45 | 46 | return output; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Util/Encrypt/RSA.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @interface NSData (RSA) 10 | 11 | - (NSData *)RSAEncryptWithPublicKey:(NSString *)pubKey; 12 | 13 | @end 14 | 15 | @interface NSString (RSA) 16 | 17 | - (NSString *)RSAEncryptWithPublicKey:(NSString *)pubKey; 18 | 19 | @end -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Util/Encrypt/RandomKey.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @interface NSString (RandomKey) 10 | 11 | /** 12 | * 产生一个随机Key,长度为32. 13 | */ 14 | + (NSString *)randomKey; 15 | 16 | @end 17 | 18 | @interface NSData (RandomData) 19 | /** 20 | * 产生随机数据. 21 | * @param length 随机数据的长度 22 | * 23 | */ 24 | + (NSData *)randomDataWithLength:(NSUInteger)length; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Util/Encrypt/RandomKey.m: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | #import 9 | #import "RandomKey.h" 10 | #import "MD5.h" 11 | 12 | @implementation NSString (RandomKey) 13 | 14 | + (NSString *)randomKey { 15 | /* Get Random UUID */ 16 | NSString *UUIDString; 17 | CFUUIDRef UUIDRef = CFUUIDCreate(NULL); 18 | CFStringRef UUIDStringRef = CFUUIDCreateString(NULL, UUIDRef); 19 | UUIDString = (NSString *)CFBridgingRelease(UUIDStringRef); 20 | CFRelease(UUIDRef); 21 | /* Get Time */ 22 | double time = CFAbsoluteTimeGetCurrent(); 23 | /* MD5 With Sale */ 24 | return [[NSString stringWithFormat:@"%@%f", UUIDString, time] MD5]; 25 | } 26 | 27 | @end 28 | 29 | @implementation NSData (RandomData) 30 | 31 | + (NSData *)randomDataWithLength:(NSUInteger)length { 32 | NSMutableData* data = [NSMutableData dataWithLength:length]; 33 | int err = SecRandomCopyBytes(kSecRandomDefault, length, [data mutableBytes]); 34 | if (err) 35 | return nil; 36 | else 37 | return data; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Util/LineColor.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @interface UIColor (LineColor) 10 | 11 | + (UIColor *)lineColor; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Util/LineColor.m: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import "LineColor.h" 8 | 9 | @implementation UIColor (LineColor) 10 | 11 | + (UIColor *)lineColor { 12 | return [UIColor colorWithRed:0.8 13 | green:0.8 14 | blue:0.8 15 | alpha:0.7f]; 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Util/ShakeDebug.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | #ifdef DEBUG 10 | @interface UIViewController (ShakeDebug) 11 | 12 | @end 13 | #endif -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Util/ShakeDebug.m: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import "ShakeDebug.h" 8 | #import "LogTextViewController.h" 9 | 10 | #ifdef DEBUG 11 | @implementation UIViewController (ShakeDebug) 12 | - (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event { 13 | if (event.type == UIEventSubtypeMotionShake 14 | && [LogTextViewController sharedLogTextView].presented == NO) { 15 | [LogTextViewController sharedLogTextView].presented = YES; 16 | [self.navigationController pushViewController:[LogTextViewController sharedLogTextView] 17 | animated:YES]; 18 | } else if (event.type == UIEventSubtypeMotionShake 19 | && [LogTextViewController sharedLogTextView].presented == YES) { 20 | [LogTextViewController sharedLogTextView].presented = NO; 21 | [self.navigationController popViewControllerAnimated:YES]; 22 | } 23 | } 24 | @end 25 | #endif 26 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/Util/UITextView+Placeholder.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @interface UITextView (Placeholder) 10 | 11 | @property (nonatomic, readonly) UILabel *placeholderLabel; 12 | 13 | @property (nonatomic, strong) NSString *placeholder; 14 | @property (nonatomic, strong) NSAttributedString *attributedPlaceholder; 15 | @property (nonatomic, strong) UIColor *placeholderColor; 16 | 17 | + (UIColor *)defaultPlaceholderColor; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/CommentReplyFooterView.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | typedef void(^ClickFooterCallBack)(void); 10 | 11 | @interface CommentReplyFooterView : UITableViewCell 12 | 13 | @property (nonatomic, strong) ClickFooterCallBack onClick; 14 | 15 | @property (weak, nonatomic) IBOutlet UIButton *button; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/CommentReplyFooterView.m: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import "CommentReplyFooterView.h" 8 | 9 | @implementation CommentReplyFooterView 10 | 11 | /* 12 | // Only override drawRect: if you perform custom drawing. 13 | // An empty implementation adversely affects performance during animation. 14 | - (void)drawRect:(CGRect)rect { 15 | // Drawing code 16 | } 17 | */ 18 | - (IBAction)onClickButton:(id)sender { 19 | self.onClick != nil ? self.onClick() : nil; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/CommentReplyFooterView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/DocumentsCell.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @interface DocumentsCell : UICollectionViewCell 10 | 11 | @property (weak, nonatomic) IBOutlet UIImageView *documentsIcon; 12 | @property (weak, nonatomic) IBOutlet UILabel *documentsTitle; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/DocumentsCell.m: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import "DocumentsCell.h" 8 | 9 | static const CGFloat kDocumentsTitleFontSize = 16.0f; 10 | 11 | @implementation DocumentsCell 12 | 13 | - (void)awakeFromNib { 14 | // Initialization code 15 | [super awakeFromNib]; 16 | self.documentsTitle.font = [UIFont fontWithName:kChineseFont 17 | size:kDocumentsTitleFontSize]; 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/DocumentsCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/InputWithTextFeildBar.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @interface InputWithTextFeildBar : UIToolbar 10 | 11 | @property (weak, nonatomic) IBOutlet UITextField *textField; 12 | 13 | @property (weak, nonatomic) IBOutlet UIBarButtonItem *barButton; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/InputWithTextFeildBar.m: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import "InputWithTextFeildBar.h" 8 | 9 | static CGFloat const kTextFieldFontSize = 14.0f; 10 | 11 | @implementation InputWithTextFeildBar 12 | 13 | - (void)awakeFromNib { 14 | [super awakeFromNib]; 15 | self.textField.font = [UIFont fontWithName:kChineseFont 16 | size:kTextFieldFontSize]; 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/InputWithTextFieldBar.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/InputWithTextFieldCell.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @interface InputWithTextFieldCell : UITableViewCell 10 | 11 | @property (retain, nonatomic) IBOutlet UILabel *descLabel; 12 | @property (retain, nonatomic) IBOutlet UITextField *textField; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/InputWithTextFieldCell.m: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import "InputWithTextFieldCell.h" 8 | 9 | @implementation InputWithTextFieldCell 10 | 11 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 12 | [super setSelected:selected animated:animated]; 13 | 14 | // Configure the view for the selected state 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/InputWithTextFieldCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/MessageBoardCommentView.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @class MessageBoardContentView; 10 | 11 | @interface MessageBoardCommentView : UITableViewHeaderFooterView 12 | 13 | @property (nonatomic, strong) MessageBoardContentView *commentContent; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/MessageBoardCommentView.m: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import "MessageBoardCommentView.h" 8 | #import "MessageBoardContentView.h" 9 | 10 | @implementation MessageBoardCommentView 11 | 12 | #pragma mark - Life Cycle 13 | - (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier { 14 | self = [super initWithReuseIdentifier:reuseIdentifier]; 15 | if (self) { 16 | self.contentView.backgroundColor = [UIColor whiteColor]; 17 | [self.contentView addSubview:self.commentContent]; 18 | } 19 | return self; 20 | } 21 | 22 | - (void)layoutSubviews { 23 | [super layoutSubviews]; 24 | self.commentContent.frame = CGRectMake(0, 0, CGRectGetWidth(self.frame), CGRectGetHeight(self.frame)); 25 | } 26 | 27 | #pragma mark - Lazy Initializer 28 | - (MessageBoardContentView *)commentContent { 29 | if (_commentContent == nil) { 30 | _commentContent = [[MessageBoardContentView alloc] init]; 31 | } 32 | return _commentContent; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/MessageBoardContentView.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @class ADCommentList; 10 | @class ADReplyList; 11 | 12 | typedef void(^ClickContentCallBack)(void); 13 | 14 | @interface MessageBoardContentView : UIView 15 | 16 | @property (nonatomic, strong) UIImageView *headImage; 17 | @property (nonatomic, strong) UILabel *nickName; 18 | @property (nonatomic, strong) UILabel *content; 19 | @property (nonatomic, strong) UILabel *timeStamp; 20 | @property (nonatomic, strong) ClickContentCallBack clickCallBack; 21 | 22 | - (void)configureViewWithComment:(ADCommentList *)comment; 23 | 24 | - (void)configureViewWithReply:(ADReplyList *)reply; 25 | 26 | + (CGFloat)calcHeightForComment:(ADCommentList *)comment; 27 | 28 | + (CGFloat)calcHeightForReply:(ADReplyList *)reply; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/MessageBoardReplyCell.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | #import 7 | 8 | @class MessageBoardContentView; 9 | 10 | @interface MessageBoardReplyCell : UITableViewCell 11 | 12 | @property (nonatomic, strong) MessageBoardContentView *replyContentView; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/MessageBoardReplyCell.m: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import "MessageBoardReplyCell.h" 8 | #import "MessageBoardContentView.h" 9 | 10 | @implementation MessageBoardReplyCell 11 | 12 | #pragma mark - Life Cycle 13 | 14 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { 15 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 16 | if (self) { 17 | self.replyContentView = [[MessageBoardContentView alloc] init]; 18 | [self.contentView addSubview:self.replyContentView]; 19 | } 20 | return self; 21 | } 22 | 23 | - (void)layoutSubviews { 24 | [super layoutSubviews]; 25 | self.replyContentView.frame = CGRectMake(inset*4, 26 | 0, 27 | CGRectGetWidth(self.frame)-inset*4, 28 | CGRectGetHeight(self.frame)); 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/MessageboardFooterView.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @interface MessageboardFooterView : UITableViewHeaderFooterView 10 | 11 | @property (weak, nonatomic) IBOutlet UIActivityIndicatorView *activityView; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/MessageboardFooterView.m: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import "MessageboardFooterView.h" 8 | 9 | @implementation MessageboardFooterView 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/MessageboardFooterView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/MessageboardHeaderView.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @interface MessageboardHeaderView : UITableViewHeaderFooterView 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/MessageboardHeaderView.m: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import "MessageboardHeaderView.h" 8 | 9 | @implementation MessageboardHeaderView 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/MessageboardHeaderView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/UserHeadPhotoCell.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @interface UserHeadPhotoCell : UITableViewCell 10 | 11 | @property (weak, nonatomic) IBOutlet UIImageView *headPhoto; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/UserHeadPhotoCell.m: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import "UserHeadPhotoCell.h" 8 | 9 | static const CGFloat kTitleFontSize = 19.0f; 10 | 11 | @interface UserHeadPhotoCell () 12 | @property (weak, nonatomic) IBOutlet UILabel *titleLabel; 13 | 14 | @end 15 | 16 | @implementation UserHeadPhotoCell 17 | 18 | - (void)awakeFromNib { 19 | // Initialization code 20 | [super awakeFromNib]; 21 | self.titleLabel.font = [UIFont fontWithName:kChineseFont 22 | size:kTitleFontSize]; 23 | } 24 | 25 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 26 | [super setSelected:selected animated:animated]; 27 | 28 | // Configure the view for the selected state 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/UserInfoDisplayCell.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @interface UserInfoDisplayCell : UITableViewCell 10 | 11 | @property (weak, nonatomic) IBOutlet UILabel *descLabel; 12 | 13 | @property (weak, nonatomic) IBOutlet UILabel *valueLabel; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/UserInfoDisplayCell.m: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import "UserInfoDisplayCell.h" 8 | 9 | @implementation UserInfoDisplayCell 10 | 11 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 12 | [super setSelected:selected animated:animated]; 13 | 14 | // Configure the view for the selected state 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/UserNickNameCell.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @interface UserNickNameCell : UITableViewCell 10 | 11 | @property (weak, nonatomic) IBOutlet UILabel *nameLabel; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/UserNickNameCell.m: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import "UserNickNameCell.h" 8 | 9 | static const CGFloat kTitleFontSize = 16.0f; 10 | 11 | @interface UserNickNameCell () 12 | 13 | @property (weak, nonatomic) IBOutlet UILabel *titleLabel; 14 | 15 | @end 16 | 17 | @implementation UserNickNameCell 18 | 19 | - (void)awakeFromNib { 20 | // Initialization code 21 | [super awakeFromNib]; 22 | self.nameLabel.font = [UIFont fontWithName:kChineseFont 23 | size:kTitleFontSize]; 24 | self.titleLabel.font = [UIFont fontWithName:kChineseFont 25 | size:kTitleFontSize]; 26 | } 27 | 28 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 29 | [super setSelected:selected animated:animated]; 30 | 31 | // Configure the view for the selected state 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/View/UserNickNameCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 23 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/ViewController/Debug/ConfigDetailViewController.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @class ADNetworkConfigItem; 10 | 11 | @interface ConfigDetailViewController : UITableViewController 12 | 13 | @property (nonatomic, assign) ADNetworkConfigItem *configItem; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/ViewController/Debug/DebugViewController.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @interface DebugViewController : UITableViewController 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/ViewController/Debug/LogTextViewController.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @interface LogTextViewController : UIViewController 10 | 11 | + (instancetype)sharedLogTextView; 12 | 13 | - (void)insertLog:(NSString *)log; 14 | 15 | @property (nonatomic, assign) BOOL presented; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/ViewController/Login/AskLoginViewController.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @interface AskLoginViewController : UIViewController 10 | 11 | @property (nonatomic, strong) NSString *founctionName; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/ViewController/Login/WXLoginViewController.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @interface WXLoginViewController : UIViewController 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/ViewController/Tab/Documents/DocumentsViewController.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @interface DocumentsViewController : UIViewController 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/ViewController/Tab/MessageBoard/MessageBoardViewController.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @interface MessageBoardViewController : UIViewController 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/ViewController/Tab/MessageBoard/NewCommentViewController.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @class NewCommentViewController; 10 | 11 | @protocol NewCommentViewControllerDelegate 12 | 13 | @optional 14 | - (void)onNewCommentDidFinish; 15 | 16 | @end 17 | 18 | @interface NewCommentViewController : UIViewController 19 | 20 | @property (nonatomic, assign) id delegate; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/ViewController/Tab/User/ADAboutViewController.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @interface ADAboutViewController : UIViewController 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/ViewController/Tab/User/ADHistoryViewController.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @interface ADHistoryViewController : UITableViewController 10 | 11 | - (instancetype)initWithStyle:(UITableViewStyle)style 12 | AccessLogs:(NSArray *)accessLogArray; 13 | @end 14 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/ViewController/Tab/User/ADShareViewController.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @interface ADShareViewController : UIViewController 10 | 11 | @property (nonatomic, strong) NSString *urlString; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/ViewController/Tab/User/DebugInfoViewController.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | @class ADGetUserInfoResp; 9 | 10 | @interface DebugInfoViewController : UITableViewController 11 | 12 | @property (nonatomic, strong) ADGetUserInfoResp *userInfoResp; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/ViewController/Tab/User/UserInfoViewController.h: -------------------------------------------------------------------------------- 1 | //Tencent is pleased to support the open source community by making WeDemo available. 2 | //Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. 3 | //Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 4 | //http://opensource.org/licenses/MIT 5 | //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 6 | 7 | #import 8 | 9 | @class ADGetUserInfoResp; 10 | 11 | @interface UserInfoViewController : UITableViewController 12 | 13 | @property (nonatomic, strong) ADGetUserInfoResp *userInfoResp; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/WeChatSDK/libWeChatSDK.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/iOS/WeDemo/WeDemo/WeChatSDK/libWeChatSDK.a -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // WeDemo 4 | // 5 | // Created by jeasonzhu on 2017/2/14. 6 | // Copyright © 2017年 Tencent. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemo/wechatauthdemo.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Tencent/WeDemo/68a2cdaa30b0c384335fd445ad70cb6c88f1eb3b/iOS/WeDemo/WeDemo/wechatauthdemo.cer -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemoTests/WeDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // WeDemoTests.m 3 | // WeDemoTests 4 | // 5 | // Created by jeasonzhu on 2017/2/14. 6 | // Copyright © 2017年 Tencent. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface WeDemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation WeDemoTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemoUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /iOS/WeDemo/WeDemoUITests/WeDemoUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // WeDemoUITests.m 3 | // WeDemoUITests 4 | // 5 | // Created by jeasonzhu on 2017/2/14. 6 | // Copyright © 2017年 Tencent. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface WeDemoUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation WeDemoUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /iOS/WeDemo/podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '7.0' 2 | target 'WeDemo' do 3 | pod 'AFNetworking' 4 | end 5 | -------------------------------------------------------------------------------- /php/demo/config.php: -------------------------------------------------------------------------------- 1 | main(); 17 | 18 | /* END file */ -------------------------------------------------------------------------------- /php/sdk/class.wx_open_api.php: -------------------------------------------------------------------------------- 1 | app_id = $app_id; 23 | $this->app_secret = $app_secret; 24 | } 25 | 26 | public function get_wx_api($path, $query) 27 | { 28 | $url = 'https://api.weixin.qq.com/' . ltrim($path, '/') . '?' . http_build_query($query); 29 | $data = file_get_contents($url); 30 | if (!$data) { 31 | return null; 32 | } 33 | $data = json_decode($data, true); 34 | return $data; 35 | } 36 | 37 | public function request_access_token($code) 38 | { 39 | $json = $this->get_wx_api('sns/oauth2/access_token', array( 40 | 'appid' => $this->app_id, 41 | 'secret' => $this->app_secret, 42 | 'code' => $code, 43 | 'grant_type' => 'authorization_code' 44 | )); 45 | return $json; 46 | } 47 | 48 | public function request_refresh_token($refresh_token) 49 | { 50 | $json = $this->get_wx_api('sns/oauth2/refresh_token', array( 51 | 'appid' => $this->app_id, 52 | 'grant_type' => 'refresh_token', 53 | 'refresh_token' => $refresh_token 54 | )); 55 | return $json; 56 | } 57 | 58 | public function request_userinfo($access_token, $openid) 59 | { 60 | $json = $this->get_wx_api('sns/userinfo', array( 61 | 'access_token' => $access_token, 62 | 'openid' => $openid 63 | )); 64 | return $json; 65 | } 66 | 67 | } // END 68 | 69 | /* END file */ -------------------------------------------------------------------------------- /php/sdk/interface.wx_database.php: -------------------------------------------------------------------------------- 1 |