├── .gitignore ├── LICENSE ├── README.md └── WTShare ├── WTShare.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── WTShare ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── tu.imageset │ │ ├── Contents.json │ │ └── Snip20160701_2.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── Lib │ ├── Tencent3.1.0 │ │ ├── TencentOpenAPI.framework │ │ │ ├── Headers │ │ │ │ ├── QQApiInterface.h │ │ │ │ ├── QQApiInterfaceObject.h │ │ │ │ ├── TencentApiInterface.h │ │ │ │ ├── TencentMessageObject.h │ │ │ │ ├── TencentOAuth.h │ │ │ │ ├── TencentOAuthObject.h │ │ │ │ └── sdkdef.h │ │ │ ├── Resources │ │ │ │ └── ios_open_sdk_3.1.0.3_iphone │ │ │ └── TencentOpenAPI │ │ └── TencentOpenApi_IOS_Bundle.bundle │ │ │ ├── error.png │ │ │ ├── local.html │ │ │ ├── qqicon.png │ │ │ └── success.png │ ├── WeChatSDK_1.7.1 │ │ ├── README.txt │ │ ├── WXApi.h │ │ ├── WXApiObject.h │ │ ├── WechatAuthSDK.h │ │ └── libWeChatSDK.a │ └── libWeiboSDK │ │ ├── WBHttpRequest+WeiboGame.h │ │ ├── WBHttpRequest+WeiboShare.h │ │ ├── WBHttpRequest+WeiboToken.h │ │ ├── WBHttpRequest+WeiboUser.h │ │ ├── WBHttpRequest.h │ │ ├── WBSDKBasicButton.h │ │ ├── WBSDKCommentButton.h │ │ ├── WBSDKRelationshipButton.h │ │ ├── WeiboSDK+Statistics.h │ │ ├── WeiboSDK.bundle │ │ ├── images │ │ │ ├── alert_error_icon@2x.png │ │ │ ├── alert_success_icon@2x.png │ │ │ ├── close.png │ │ │ ├── close@2x.png │ │ │ ├── common_button_big_blue@2x.png │ │ │ ├── common_button_big_blue_disable@2x.png │ │ │ ├── common_button_big_blue_highlighted@2x.png │ │ │ ├── common_button_white.png │ │ │ ├── common_button_white@2x.png │ │ │ ├── common_button_white_highlighted.png │ │ │ ├── common_button_white_highlighted@2x.png │ │ │ ├── common_icon_arrow@2x.png │ │ │ ├── compose_keyboardbutton_background.png │ │ │ ├── compose_keyboardbutton_background@2x.png │ │ │ ├── compose_toolbar_background.png │ │ │ ├── compose_toolbar_background@2x.png │ │ │ ├── empty_failed.png │ │ │ ├── empty_failed@2x.png │ │ │ ├── login_background@2x.png │ │ │ ├── login_country_background@2x.png │ │ │ ├── login_country_background_highlighted@2x.png │ │ │ ├── navigationbar_background.png │ │ │ ├── navigationbar_background@2x.png │ │ │ ├── navigationbar_background_os7.png │ │ │ ├── navigationbar_background_os7@2x.png │ │ │ ├── progresshud_background@2x.png │ │ │ ├── sdk_weibo_logo.png │ │ │ ├── sdk_weibo_logo@2x.png │ │ │ ├── sdk_weibo_logo@3x.png │ │ │ ├── timeline_relationship_icon_addattention.png │ │ │ ├── timeline_relationship_icon_addattention@2x.png │ │ │ ├── timeline_relationship_icon_addattention@3x.png │ │ │ ├── timeline_relationship_icon_attention.png │ │ │ ├── timeline_relationship_icon_attention@2x.png │ │ │ ├── timeline_relationship_icon_attention@3x.png │ │ │ ├── verify_code_button@2x.png │ │ │ ├── verify_code_button@3x.png │ │ │ ├── verify_code_button_highlighted@2x.png │ │ │ └── verify_code_button_highlighted@3x.png │ │ └── others │ │ │ ├── countryList │ │ │ └── mfp.cer │ │ ├── WeiboSDK.h │ │ ├── WeiboUser.h │ │ └── libWeiboSDK.a ├── ViewController.h ├── ViewController.m ├── WTShareContentItem.h ├── WTShareContentItem.m ├── WTShareManager.h ├── WTShareManager.m └── main.m ├── WTShareTests ├── Info.plist └── WTShareTests.m └── WTShareUITests ├── Info.plist └── WTShareUITests.m /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | # Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | 55 | #Code Injection 56 | # 57 | # After new code Injection tools there's a generated folder /iOSInjectionProject 58 | # https://github.com/johnno1962/injectionforxcode 59 | 60 | iOSInjectionProject/ 61 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /WTShare/WTShare.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /WTShare/WTShare/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // WTShare 4 | // 5 | // Created by Mac on 16/6/30. 6 | // Copyright © 2016年 wutong. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /WTShare/WTShare/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // WTShare 4 | // 5 | // Created by Mac on 16/6/30. 6 | // Copyright © 2016年 wutong. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "WTShareManager.h" 11 | 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | // Override point for customization after application launch. 21 | return YES; 22 | } 23 | 24 | 25 | #pragma mark - 从别的应用回来 26 | 27 | // iOS9 以上用这个方法接收 28 | - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options 29 | { 30 | NSDictionary * dic = options; 31 | NSLog(@"%@", dic); 32 | if ([options[UIApplicationOpenURLOptionsSourceApplicationKey] isEqualToString:@"com.sina.weibo"]) { 33 | NSLog(@"新浪微博~"); 34 | 35 | return [WeiboSDK handleOpenURL:url delegate:[WTShareManager shareWTShareManager]]; 36 | }else if ([options[UIApplicationOpenURLOptionsSourceApplicationKey] isEqualToString:@"com.tencent.xin"]){ 37 | 38 | return [WXApi handleOpenURL:url delegate:[WTShareManager shareWTShareManager]]; 39 | }else if ([options[UIApplicationOpenURLOptionsSourceApplicationKey] isEqualToString:@"com.tencent.mqq"]){ 40 | 41 | [WTShareManager didReceiveTencentUrl:url]; 42 | return [TencentOAuth HandleOpenURL:url]; 43 | } 44 | return YES; 45 | } 46 | // iOS9 以下用这个方法接收 47 | - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation 48 | { 49 | NSLog(@"%@",url); 50 | 51 | 52 | if ([sourceApplication isEqualToString:@"com.sina.weibo"]) { 53 | 54 | return [WeiboSDK handleOpenURL:url delegate:[WTShareManager shareWTShareManager]]; 55 | 56 | }else if ([sourceApplication isEqualToString:@"com.tencent.xin"]){ 57 | 58 | return [WXApi handleOpenURL:url delegate:[WTShareManager shareWTShareManager]]; 59 | 60 | }else if ([sourceApplication isEqualToString:@"com.tencent.mqq"]){ 61 | 62 | [WTShareManager didReceiveTencentUrl:url]; 63 | return [TencentOAuth HandleOpenURL:url]; 64 | } 65 | 66 | 67 | return YES; 68 | } 69 | 70 | 71 | 72 | 73 | 74 | - (void)applicationWillResignActive:(UIApplication *)application { 75 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 76 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 77 | } 78 | 79 | - (void)applicationDidEnterBackground:(UIApplication *)application { 80 | 81 | 82 | } 83 | 84 | - (void)applicationWillEnterForeground:(UIApplication *)application { 85 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 86 | } 87 | 88 | - (void)applicationDidBecomeActive:(UIApplication *)application { 89 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 90 | } 91 | 92 | - (void)applicationWillTerminate:(UIApplication *)application { 93 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 94 | } 95 | 96 | 97 | 98 | 99 | @end 100 | -------------------------------------------------------------------------------- /WTShare/WTShare/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /WTShare/WTShare/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /WTShare/WTShare/Assets.xcassets/tu.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "Snip20160701_2.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /WTShare/WTShare/Assets.xcassets/tu.imageset/Snip20160701_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Assets.xcassets/tu.imageset/Snip20160701_2.png -------------------------------------------------------------------------------- /WTShare/WTShare/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 | -------------------------------------------------------------------------------- /WTShare/WTShare/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 27 | 34 | 41 | 48 | 55 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /WTShare/WTShare/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 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleURLTypes 22 | 23 | 24 | CFBundleTypeRole 25 | Editor 26 | CFBundleURLName 27 | com.weibo 28 | CFBundleURLSchemes 29 | 30 | wb2045436852 31 | 32 | 33 | 34 | CFBundleTypeRole 35 | Editor 36 | CFBundleURLName 37 | weixin 38 | CFBundleURLSchemes 39 | 40 | wxd930ea5d5a258f4f 41 | 42 | 43 | 44 | CFBundleTypeRole 45 | Editor 46 | CFBundleURLName 47 | tencentdsadsadasdas 48 | CFBundleURLSchemes 49 | 50 | tencent222222 51 | 52 | 53 | 54 | CFBundleVersion 55 | 1 56 | 57 | LSRequiresIPhoneOS 58 | 59 | UILaunchStoryboardName 60 | LaunchScreen 61 | UIMainStoryboardFile 62 | Main 63 | UIRequiredDeviceCapabilities 64 | 65 | armv7 66 | 67 | UISupportedInterfaceOrientations 68 | 69 | UIInterfaceOrientationPortrait 70 | 71 | 72 | LSApplicationQueriesSchemes 73 | 74 | sinaweibohd 75 | sinaweibo 76 | sinaweibosso 77 | weibosdk 78 | weibosdk2.5 79 | mqqapi 80 | mqq 81 | mqqOpensdkSSoLogin 82 | mqqconnect 83 | mqqopensdkdataline 84 | mqqopensdkgrouptribeshare 85 | mqqopensdkfriend 86 | mqqopensdkapi 87 | mqqopensdkapiV2 88 | mqqopensdkapiV3 89 | mqzoneopensdk 90 | wtloginmqq 91 | wtloginmqq2 92 | mqqwpa 93 | mqzone 94 | mqzonev2 95 | mqzoneshare 96 | wtloginqzone 97 | mqzonewx 98 | mqzoneopensdkapiV2 99 | mqzoneopensdkapi19 100 | mqzoneopensdkapi 101 | mqzoneopensdk 102 | alipay 103 | alipayshare 104 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/Tencent3.1.0/TencentOpenAPI.framework/Headers/QQApiInterface.h: -------------------------------------------------------------------------------- 1 | /// 2 | /// \file QQApiInterface.h 3 | /// \brief QQApi接口简化封装 4 | /// 5 | /// Created by Tencent on 12-5-15. 6 | /// Copyright (c) 2012年 Tencent. All rights reserved. 7 | /// 8 | 9 | #import 10 | #import "QQApiInterfaceObject.h" 11 | 12 | /** 13 | \brief 处理来至QQ的请求及响应的回调协议 14 | */ 15 | @protocol QQApiInterfaceDelegate 16 | 17 | /** 18 | 处理来至QQ的请求 19 | */ 20 | - (void)onReq:(QQBaseReq *)req; 21 | 22 | /** 23 | 处理来至QQ的响应 24 | */ 25 | - (void)onResp:(QQBaseResp *)resp; 26 | 27 | /** 28 | 处理QQ在线状态的回调 29 | */ 30 | - (void)isOnlineResponse:(NSDictionary *)response; 31 | 32 | @end 33 | 34 | /** 35 | \brief 对QQApi的简单封装类 36 | */ 37 | @interface QQApiInterface : NSObject 38 | 39 | /** 40 | 处理由手Q唤起的跳转请求 41 | \param url 待处理的url跳转请求 42 | \param delegate 第三方应用用于处理来至QQ请求及响应的委托对象 43 | \return 跳转请求处理结果,YES表示成功处理,NO表示不支持的请求协议或处理失败 44 | */ 45 | + (BOOL)handleOpenURL:(NSURL *)url delegate:(id)delegate; 46 | 47 | /** 48 | 向手Q发起分享请求 49 | \param req 分享内容的请求 50 | \return 请求发送结果码 51 | */ 52 | + (QQApiSendResultCode)sendReq:(QQBaseReq *)req; 53 | 54 | /** 55 | 向手Q QZone结合版发起分享请求 56 | \note H5分享只支持单张网络图片的传递 57 | \param req 分享内容的请求 58 | \return 请求发送结果码 59 | */ 60 | + (QQApiSendResultCode)SendReqToQZone:(QQBaseReq *)req; 61 | 62 | /** 63 | 向手Q 群部落发起分享请求 64 | \note H5分享只支持单张网络图片的传递 65 | \param req 分享内容的请求 66 | \return 请求发送结果码 67 | */ 68 | + (QQApiSendResultCode)SendReqToQQGroupTribe:(QQBaseReq *)req; 69 | 70 | /** 71 | 向手Q发送应答消息 72 | \param resp 应答消息 73 | \return 应答发送结果码 74 | */ 75 | + (QQApiSendResultCode)sendResp:(QQBaseResp *)resp; 76 | 77 | /** 78 | 检测是否已安装QQ 79 | \return 如果QQ已安装则返回YES,否则返回NO 80 | */ 81 | + (BOOL)isQQInstalled; 82 | 83 | /** 84 | 批量检测QQ号码是否在线 85 | */ 86 | + (void)getQQUinOnlineStatues:(NSArray *)QQUins delegate:(id)delegate; 87 | 88 | /** 89 | 检测QQ是否支持API调用 90 | \return 如果当前安装QQ版本支持API调用则返回YES,否则返回NO 91 | */ 92 | + (BOOL)isQQSupportApi; 93 | 94 | /** 95 | 启动QQ 96 | \return 成功返回YES,否则返回NO 97 | */ 98 | + (BOOL)openQQ; 99 | 100 | /** 101 | 获取QQ下载地址 102 | 103 | 如果App通过QQApiInterface#isQQInstalledQQApiInterface#isQQSupportApi检测发现QQ没安装或当前版本QQ不支持API调用,可引导用户通过打开此链接下载最新版QQ。 104 | \return iPhoneQQ下载地址 105 | */ 106 | + (NSString *)getQQInstallUrl; 107 | 108 | @end 109 | -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/Tencent3.1.0/TencentOpenAPI.framework/Headers/QQApiInterfaceObject.h: -------------------------------------------------------------------------------- 1 | /// 2 | /// \file QQApiInterfaceObject.h 3 | /// \brief QQApiInterface所依赖的请求及应答消息对象封装帮助类 4 | /// 5 | /// Created by Tencent on 12-5-15. 6 | /// Copyright (c) 2012年 Tencent. All rights reserved. 7 | /// 8 | 9 | #ifndef QQApiInterface_QQAPIOBJECT_h 10 | #define QQApiInterface_QQAPIOBJECT_h 11 | 12 | #import 13 | 14 | 15 | typedef enum 16 | { 17 | EQQAPISENDSUCESS = 0, 18 | EQQAPIQQNOTINSTALLED = 1, 19 | EQQAPIQQNOTSUPPORTAPI = 2, 20 | EQQAPIMESSAGETYPEINVALID = 3, 21 | EQQAPIMESSAGECONTENTNULL = 4, 22 | EQQAPIMESSAGECONTENTINVALID = 5, 23 | EQQAPIAPPNOTREGISTED = 6, 24 | EQQAPIAPPSHAREASYNC = 7, 25 | EQQAPIQQNOTSUPPORTAPI_WITH_ERRORSHOW = 8, 26 | EQQAPISENDFAILD = -1, 27 | //qzone分享不支持text类型分享 28 | EQQAPIQZONENOTSUPPORTTEXT = 10000, 29 | //qzone分享不支持image类型分享 30 | EQQAPIQZONENOTSUPPORTIMAGE = 10001, 31 | //当前QQ版本太低,需要更新至新版本才可以支持 32 | EQQAPIVERSIONNEEDUPDATE = 10002, 33 | } QQApiSendResultCode; 34 | 35 | #pragma mark - QQApiObject(分享对象类型) 36 | 37 | // QQApiObject control flags 38 | enum 39 | { 40 | kQQAPICtrlFlagQZoneShareOnStart = 0x01, 41 | kQQAPICtrlFlagQZoneShareForbid = 0x02, 42 | kQQAPICtrlFlagQQShare = 0x04, 43 | kQQAPICtrlFlagQQShareFavorites = 0x08, //收藏 44 | kQQAPICtrlFlagQQShareDataline = 0x10, //数据线 45 | }; 46 | 47 | // QQApiObject 48 | /** \brief 所有在QQ及插件间发送的数据对象的根类。 49 | */ 50 | @interface QQApiObject : NSObject 51 | @property(nonatomic,retain) NSString* title; ///< 标题,最长128个字符 52 | @property(nonatomic,retain) NSString* description; ///<简要描述,最长512个字符 53 | 54 | @property (nonatomic, assign) uint64_t cflag; 55 | 56 | @end 57 | 58 | // QQApiResultObject 59 | /** \brief 用于请求回应的数据类型。 60 |

可能错误码及描述如下:

61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 |
errorerrorDescription注释
0nil成功
-1param error参数错误
-2group code is invalid该群不在自己的群列表里面
-3upload photo failed上传图片失败
-4user give up the current operation用户放弃当前操作
-5client internal error客户端内部处理错误
70 | */ 71 | @interface QQApiResultObject : QQApiObject 72 | @property(nonatomic,retain) NSString* error; ///<错误 73 | @property(nonatomic,retain) NSString* errorDescription; ///<错误描述 74 | @property(nonatomic,retain) NSString* extendInfo; ///<扩展信息 75 | @end 76 | 77 | // QQApiTextObject 78 | /** \brief 文本对象 79 | */ 80 | @interface QQApiTextObject : QQApiObject 81 | @property(nonatomic,retain)NSString* text; ///<文本内容,必填,最长1536个字符 82 | 83 | -(id)initWithText:(NSString*)text; ///<初始化方法 84 | +(id)objectWithText:(NSString*)text;///<工厂方法,获取一个QQApiTextObject对象. 85 | @end 86 | 87 | // QQApiURLObject 88 | typedef enum QQApiURLTargetType{ 89 | QQApiURLTargetTypeNotSpecified = 0x00, 90 | QQApiURLTargetTypeAudio = 0x01, 91 | QQApiURLTargetTypeVideo = 0x02, 92 | QQApiURLTargetTypeNews = 0x03 93 | }QQApiURLTargetType; 94 | 95 | /** @brief URL对象类型。 96 | 97 | 包括URL地址,URL地址所指向的目标类型及预览图像。 98 | */ 99 | @interface QQApiURLObject : QQApiObject 100 | /** 101 | URL地址所指向的目标类型. 102 | @note 参见QQApi.h 中的 QQApiURLTargetType 定义. 103 | */ 104 | @property(nonatomic)QQApiURLTargetType targetContentType; 105 | 106 | @property(nonatomic,retain)NSURL* url; ///QQApiExtendObject对象 150 | @param data 数据内容 151 | @param previewImageData 用于预览的图片 152 | @param title 标题 153 | @param description 此对象,分享的描述 154 | @return 155 | 一个自动释放的QQApiExtendObject实例 156 | */ 157 | + (id)objectWithData:(NSData*)data previewImageData:(NSData*)previewImageData title:(NSString*)title description:(NSString*)description; 158 | 159 | /** 160 | helper方法获取一个autorelease的QQApiExtendObject对象 161 | @param data 数据内容 162 | @param previewImageData 用于预览的图片 163 | @param title 标题 164 | @param description 此对象,分享的描述 165 | @param imageDataArray 发送的多张图片队列 166 | @return 167 | 一个自动释放的QQApiExtendObject实例 168 | */ 169 | + (id)objectWithData:(NSData*)data previewImageData:(NSData*)previewImageData title:(NSString*)title description:(NSString*)description imageDataArray:(NSArray*)imageDataArray; 170 | 171 | @end 172 | 173 | // QQApiImageObject 174 | /** @brief 图片对象 175 | 用于分享图片内容的对象,是一个指定为图片类型的QQApiExtendObject 176 | */ 177 | @interface QQApiImageObject : QQApiExtendObject 178 | @end 179 | 180 | // QQApiImageArrayForQZoneObject 181 | /** @brief 图片对象 182 | 用于分享图片到空间,走写说说路径,是一个指定为图片类型的,当图片数组为空时,默认走文本写说说QQApiObject 183 | */ 184 | @interface QQApiImageArrayForQZoneObject : QQApiObject 185 | 186 | @property(nonatomic,retain) NSArray* imageDataArray;///图片数组 187 | 188 | /** 189 | 初始化方法 190 | @param imageDataArray 图片数组 191 | @param title 写说说的内容,可以为空 192 | */ 193 | - (id)initWithImageArrayData:(NSArray*)imageDataArray title:(NSString*)title; 194 | 195 | /** 196 | helper方法获取一个autorelease的QQApiExtendObject对象 197 | @param title 写说说的内容,可以为空 198 | @param imageDataArray 发送的多张图片队列 199 | @return 200 | 一个自动释放的QQApiExtendObject实例 201 | */ 202 | + (id)objectWithimageDataArray:(NSArray*)imageDataArray title:(NSString*)title; 203 | 204 | @end 205 | 206 | // QQApiVideoForQZoneObject 207 | /** @brief 视频对象 208 | 用于分享视频到空间,走写说说路径QQApiObject 209 | assetURL可传ALAsset的ALAssetPropertyAssetURL,或者PHAsset的localIdentifier 210 | */ 211 | @interface QQApiVideoForQZoneObject : QQApiObject 212 | 213 | @property(nonatomic, retain) NSString *assetURL; 214 | 215 | - (id)initWithAssetURL:(NSString*)assetURL title:(NSString*)title; 216 | 217 | + (id)objectWithAssetURL:(NSString*)assetURL title:(NSString*)title; 218 | 219 | @end 220 | 221 | // QQApiWebImageObject 222 | /** @brief 图片对象 223 | 用于分享网络图片内容的对象,是一个指定网络图片url的: 该类型只在2.9.0的h5分享中才支持, 224 | 原有的手q分享是不支持该类型的。 225 | */ 226 | @interface QQApiWebImageObject : QQApiObject 227 | 228 | @property(nonatomic, retain) NSURL *previewImageURL; ///<预览图像URL 229 | 230 | /** 231 | 初始化方法 232 | @param previewImageURL 用于预览的图片 233 | @param title 标题 234 | @param description 此对象,分享的描述 235 | */ 236 | - (id)initWithPreviewImageURL:(NSURL*)previewImageURL title:(NSString*)title description:(NSString*)description; 237 | 238 | /** 239 | helper方法获取一个autorelease的QQApiWebImageObject对象 240 | @param previewImageURL 用于预览的图片 241 | @param title 标题 242 | @param description 此对象,分享的描述 243 | */ 244 | + (id)objectWithPreviewImageURL:(NSURL*)previewImageURL title:(NSString*)title description:(NSString*)description; 245 | 246 | @end 247 | 248 | // QQApiGroupTribeImageObject 249 | /** @brief 群部落图片对象 250 | 用于分享图片内容的对象,是一个指定为图片类型的 可以指定一些其他的附加数据QQApiExtendObject 251 | */ 252 | @interface QQApiGroupTribeImageObject : QQApiImageObject 253 | { 254 | NSString *_bid; 255 | NSString *_bname; 256 | } 257 | // 群部落id 258 | @property (nonatomic, retain)NSString* bid; 259 | 260 | // 群部落名称 261 | @property (nonatomic, retain)NSString* bname; 262 | 263 | @end 264 | 265 | 266 | //QQApiFileObject 267 | /** @brief 本地文件对象(暂只支持分享到手机QQ数据线功能) 268 | 用于分享文件内容的对象,是一个指定为文件类型的QQApiExtendObject 269 | */ 270 | @interface QQApiFileObject : QQApiExtendObject 271 | { 272 | NSString* _fileName; 273 | } 274 | @property(nonatomic, retain)NSString* fileName; 275 | @end 276 | 277 | // QQApiAudioObject 278 | /** @brief 音频URL对象 279 | 用于分享目标内容为音频的URL的对象 280 | */ 281 | @interface QQApiAudioObject : QQApiURLObject 282 | 283 | @property (nonatomic, retain) NSURL *flashURL; ///<音频URL地址,最长512个字符 284 | 285 | /** 286 | 获取一个autorelease的QQApiAudioObject 287 | @param url 音频内容的目标URL 288 | @param title 分享内容的标题 289 | @param description 分享内容的描述 290 | @param data 分享内容的预览图像 291 | @note 如果url为空,调用QQApi#sendMessage:时将返回FALSE 292 | */ 293 | +(id)objectWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageData:(NSData*)data; 294 | 295 | /** 296 | 获取一个autorelease的QQApiAudioObject 297 | @param url 音频内容的目标URL 298 | @param title 分享内容的标题 299 | @param description 分享内容的描述 300 | @param previewURL 分享内容的预览图像URL 301 | @note 如果url为空,调用QQApi#sendMessage:时将返回FALSE 302 | */ 303 | +(id)objectWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageURL:(NSURL*)previewURL; 304 | 305 | @end 306 | 307 | // QQApiVideoObject 308 | /** @brief 视频URL对象 309 | 用于分享目标内容为视频的URL的对象 310 | 311 | QQApiVideoObject类型的分享,目前在Android和PC QQ上接收消息时,展现有待完善,待手机QQ版本以后更新支持 312 | 目前如果要分享视频,推荐使用 QQApiNewsObject 类型 313 | */ 314 | @interface QQApiVideoObject : QQApiURLObject 315 | 316 | @property (nonatomic, retain) NSURL *flashURL; ///<视频URL地址,最长512个字符 317 | 318 | /** 319 | 获取一个autorelease的QQApiVideoObject 320 | @param url 视频内容的目标URL 321 | @param title 分享内容的标题 322 | @param description 分享内容的描述 323 | @param data 分享内容的预览图像 324 | @note 如果url为空,调用QQApi#sendMessage:时将返回FALSE 325 | */ 326 | +(id)objectWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageData:(NSData*)data; 327 | 328 | /** 329 | 获取一个autorelease的QQApiVideoObject 330 | @param url 视频内容的目标URL 331 | @param title 分享内容的标题 332 | @param description 分享内容的描述 333 | @param previewURL 分享内容的预览图像URL 334 | @note 如果url为空,调用QQApi#sendMessage:时将返回FALSE 335 | */ 336 | +(id)objectWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageURL:(NSURL*)previewURL; 337 | 338 | @end 339 | 340 | // QQApiNewsObject 341 | /** @brief 新闻URL对象 342 | 用于分享目标内容为新闻的URL的对象 343 | */ 344 | @interface QQApiNewsObject : QQApiURLObject 345 | /** 346 | 获取一个autorelease的QQApiNewsObject 347 | @param url 视频内容的目标URL 348 | @param title 分享内容的标题 349 | @param description 分享内容的描述 350 | @param data 分享内容的预览图像 351 | @note 如果url为空,调用QQApi#sendMessage:时将返回FALSE 352 | */ 353 | +(id)objectWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageData:(NSData*)data; 354 | 355 | /** 356 | 获取一个autorelease的QQApiNewsObject 357 | @param url 视频内容的目标URL 358 | @param title 分享内容的标题 359 | @param description 分享内容的描述 360 | @param previewURL 分享内容的预览图像URL 361 | @note 如果url为空,调用QQApi#sendMessage:时将返回FALSE 362 | */ 363 | +(id)objectWithURL:(NSURL*)url title:(NSString*)title description:(NSString*)description previewImageURL:(NSURL*)previewURL; 364 | 365 | @end 366 | 367 | // QQApiPayObject 368 | /** \brief 支付对象 369 | */ 370 | @interface QQApiPayObject : QQApiObject 371 | @property(nonatomic,retain)NSString* OrderNo; ///<支付订单号,必填 372 | @property(nonatomic,retain)NSString* AppInfo; ///<支付来源信息,必填 373 | 374 | -(id)initWithOrderNo:(NSString*)OrderNo AppInfo:(NSString*)AppInfo; ///<初始化方法 375 | +(id)objectWithOrderNo:(NSString*)OrderNo AppInfo:(NSString*)AppInfo;///<工厂方法,获取一个QQApiPayObject对象. 376 | @end 377 | 378 | // QQApiCommonContentObject; 379 | /** @brief 通用模板类型对象 380 | 用于分享一个固定显示模板的图文混排对象 381 | @note 图片列表和文本列表不能同时为空 382 | */ 383 | @interface QQApiCommonContentObject : QQApiObject 384 | /** 385 | 预定义的界面布局类型 386 | */ 387 | @property(nonatomic,assign) unsigned int layoutType; 388 | @property(nonatomic,assign) NSData* previewImageData;///<预览图 389 | @property(nonatomic,retain) NSArray* textArray;///<文本列表 390 | @property(nonatomic,retain) NSArray* pictureDataArray;///<图片列表 391 | +(id)objectWithLayoutType:(int)layoutType textArray:(NSArray*)textArray pictureArray:(NSArray*)pictureArray previewImageData:(NSData*)data; 392 | /** 393 | 将一个NSDictionary对象转化为QQApiCommomContentObject,如果无法转换,则返回空 394 | */ 395 | +(id)objectWithDictionary:(NSDictionary*)dic; 396 | -(NSDictionary*)toDictionary; 397 | @end 398 | 399 | //////////////////////////////////////////////////////////////////////////////////////////////////////////// 400 | // Ad item object definition 401 | //////////////////////////////////////////////////////////////////////////////////////////////////////////// 402 | /** @brief 广告数据对象 403 | */ 404 | @interface QQApiAdItem : NSObject 405 | @property(nonatomic,retain) NSString* title; ///<名称 406 | @property(nonatomic,retain) NSString* description;///<描述 407 | @property(nonatomic,retain) NSData* imageData;///<广告图片 408 | @property(nonatomic,retain) NSURL* target;///<广告目标链接 409 | @end 410 | 411 | // QQApiWPAObject 412 | /** \brief 发起WPA对象 413 | */ 414 | @interface QQApiWPAObject : QQApiObject 415 | @property(nonatomic,retain)NSString* uin; ///<想要对话的QQ号 416 | 417 | -(id)initWithUin:(NSString*)uin; ///<初始化方法 418 | +(id)objectWithUin:(NSString*)uin;///<工厂方法,获取一个QQApiWPAObject对象. 419 | @end 420 | 421 | // QQApiAddFriendObject 422 | /** \brief 添加好友 423 | */ 424 | @interface QQApiAddFriendObject : QQApiObject 425 | @property (nonatomic,retain)NSString* openID; 426 | @property (nonatomic,retain)NSString* subID; 427 | @property (nonatomic,retain)NSString* remark; 428 | 429 | -(id)initWithOpenID:(NSString*)openID; ///<初始化方法 430 | +(id)objecWithOpenID:(NSString*)openID; ///<工厂方法,获取一个QQApiAddFriendObject对象. 431 | 432 | @end 433 | 434 | // QQApiGameConsortiumBindingGroupObject 435 | /** \brief 游戏公会绑定群 436 | */ 437 | @interface QQApiGameConsortiumBindingGroupObject : QQApiObject 438 | @property (nonatomic,retain)NSString* signature; 439 | @property (nonatomic,retain)NSString* unionid; 440 | @property (nonatomic,retain)NSString* zoneID; 441 | @property (nonatomic,retain)NSString* appDisplayName; 442 | 443 | -(id)initWithGameConsortium:(NSString*)signature unionid:(NSString*)unionid zoneID:(NSString*)zoneID appDisplayName:(NSString*)appDisplayName; ///<初始化方法 444 | +(id)objectWithGameConsortium:(NSString*)signature unionid:(NSString*)unionid zoneID:(NSString*)zoneID appDisplayName:(NSString*)appDisplayName; ///<工厂方法,获取一个QQApiAddFriendObject对象. 445 | 446 | @end 447 | 448 | // QQApiGameConsortiumBindingGroupObject 449 | /** \brief 加入群 450 | */ 451 | @interface QQApiJoinGroupObject : QQApiObject 452 | @property (nonatomic,retain)NSString* groupUin; 453 | @property (nonatomic,retain)NSString* groupKey; 454 | 455 | - (id)initWithGroupInfo:(NSString*)groupUin key:(NSString*)groupKey; ///<初始化方法 456 | + (id)objectWithGroupInfo:(NSString*)groupUin key:(NSString*)groupKey; ///<同时提供群号和群KEY 工厂方法,获取一个QQApiAddFriendObject对象. 457 | + (id)objectWithGroupKey:(NSString*)groupKey; ///<只需要群的KEY 工厂方法,获取一个QQApiAddFriendObject对象. 458 | 459 | @end 460 | 461 | // QQApiGroupChatObject 462 | /** \brief 发起群会话对象 463 | */ 464 | @interface QQApiGroupChatObject : QQApiObject 465 | @property(nonatomic,retain)NSString* groupID; ///<想要对话的群号 466 | 467 | -(id)initWithGroup:(NSString*)groupID; ///<初始化方法 468 | +(id)objectWithGroup:(NSString*)groupID;///<工厂方法,获取一个QQApiGroupChatObject对象. 469 | @end 470 | 471 | #pragma mark - QQApi请求消息类型 472 | 473 | /** 474 | QQApi请求消息类型 475 | */ 476 | enum QQApiInterfaceReqType 477 | { 478 | EGETMESSAGEFROMQQREQTYPE = 0, ///< 手Q -> 第三方应用,请求第三方应用向手Q发送消息 479 | ESENDMESSAGETOQQREQTYPE = 1, ///< 第三方应用 -> 手Q,第三方应用向手Q分享消息 480 | ESHOWMESSAGEFROMQQREQTYPE = 2 ///< 手Q -> 第三方应用,请求第三方应用展现消息中的数据 481 | }; 482 | 483 | /** 484 | QQApi应答消息类型 485 | */ 486 | enum QQApiInterfaceRespType 487 | { 488 | ESHOWMESSAGEFROMQQRESPTYPE = 0, ///< 第三方应用 -> 手Q,第三方应用应答消息展现结果 489 | EGETMESSAGEFROMQQRESPTYPE = 1, ///< 第三方应用 -> 手Q,第三方应用回应发往手Q的消息 490 | ESENDMESSAGETOQQRESPTYPE = 2 ///< 手Q -> 第三方应用,手Q应答处理分享消息的结果 491 | }; 492 | 493 | /** 494 | QQApi请求消息基类 495 | */ 496 | @interface QQBaseReq : NSObject 497 | 498 | /** 请求消息类型,参见\ref QQApiInterfaceReqType */ 499 | @property (nonatomic, assign) int type; 500 | 501 | @end 502 | 503 | /** 504 | QQApi应答消息基类 505 | */ 506 | @interface QQBaseResp : NSObject 507 | 508 | /** 请求处理结果 */ 509 | @property (nonatomic, copy) NSString* result; 510 | 511 | /** 具体错误描述信息 */ 512 | @property (nonatomic, copy) NSString* errorDescription; 513 | 514 | /** 应答消息类型,参见\ref QQApiInterfaceRespType */ 515 | @property (nonatomic, assign) int type; 516 | 517 | /** 扩展信息 */ 518 | @property (nonatomic, assign) NSString* extendInfo; 519 | 520 | @end 521 | 522 | /** 523 | GetMessageFromQQReq请求帮助类 524 | */ 525 | @interface GetMessageFromQQReq : QQBaseReq 526 | 527 | /** 528 | 创建一个GetMessageFromQQReq请求实例 529 | */ 530 | + (GetMessageFromQQReq *)req; 531 | 532 | @end 533 | 534 | /** 535 | GetMessageFromQQResp应答帮助类 536 | */ 537 | @interface GetMessageFromQQResp : QQBaseResp 538 | 539 | /** 540 | 创建一个GetMessageFromQQResp应答实例 541 | \param message 具体分享消息实例 542 | \return 新创建的GetMessageFromQQResp应答实例 543 | */ 544 | + (GetMessageFromQQResp *)respWithContent:(QQApiObject *)message; 545 | 546 | /** 具体分享消息 */ 547 | @property (nonatomic, retain) QQApiObject *message; 548 | 549 | @end 550 | 551 | /** 552 | SendMessageToQQReq请求帮助类 553 | */ 554 | @interface SendMessageToQQReq : QQBaseReq 555 | 556 | /** 557 | 创建一个SendMessageToQQReq请求实例 558 | \param message 具体分享消息实例 559 | \return 新创建的SendMessageToQQReq请求实例 560 | */ 561 | + (SendMessageToQQReq *)reqWithContent:(QQApiObject *)message; 562 | 563 | /** 具体分享消息 */ 564 | @property (nonatomic, retain) QQApiObject *message; 565 | 566 | @end 567 | 568 | /** 569 | SendMessageToQQResp应答帮助类 570 | */ 571 | @interface SendMessageToQQResp : QQBaseResp 572 | 573 | /** 574 | 创建一个SendMessageToQQResp应答实例 575 | \param result 请求处理结果 576 | \param errDesp 具体错误描述信息 577 | \param extendInfo 扩展信息 578 | \return 新创建的SendMessageToQQResp应答实例 579 | */ 580 | + (SendMessageToQQResp *)respWithResult:(NSString *)result errorDescription:(NSString *)errDesp extendInfo:(NSString*)extendInfo; 581 | 582 | @end 583 | 584 | /** 585 | ShowMessageFromQQReq请求帮助类 586 | */ 587 | @interface ShowMessageFromQQReq : QQBaseReq 588 | 589 | /** 590 | 创建一个ShowMessageFromQQReq请求实例 591 | \param message 具体待展现消息实例 592 | \return 新创建的ShowMessageFromQQReq请求实例 593 | */ 594 | + (ShowMessageFromQQReq *)reqWithContent:(QQApiObject *)message; 595 | 596 | /** 具体待展现消息 */ 597 | @property (nonatomic, retain) QQApiObject *message; 598 | 599 | @end 600 | 601 | /** 602 | ShowMessageFromQQResp应答帮助类 603 | */ 604 | @interface ShowMessageFromQQResp : QQBaseResp 605 | 606 | /** 607 | 创建一个ShowMessageFromQQResp应答实例 608 | \param result 展现消息结果 609 | \param errDesp 具体错误描述信息 610 | \return 新创建的ShowMessageFromQQResp应答实例 611 | */ 612 | + (ShowMessageFromQQResp *)respWithResult:(NSString *)result errorDescription:(NSString *)errDesp; 613 | 614 | @end 615 | 616 | #endif 617 | -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/Tencent3.1.0/TencentOpenAPI.framework/Headers/TencentApiInterface.h: -------------------------------------------------------------------------------- 1 | // 2 | // TencentMessage.h 3 | // TencentOpenApi_IOS 4 | // 5 | // Created by qqconnect on 13-5-29. 6 | // Copyright (c) 2013年 Tencent. All rights reserved. 7 | // 8 | 9 | #ifndef QQ_OPEN_SDK_LITE 10 | 11 | #import 12 | #import "TencentMessageObject.h" 13 | 14 | typedef enum 15 | { 16 | kIphoneQQ, 17 | kIphoneQZONE, 18 | kThirdApp, 19 | } 20 | TecnentPlatformType; 21 | 22 | typedef enum 23 | { 24 | kTencentApiSuccess, 25 | kTencentApiPlatformUninstall, 26 | kTencentApiPlatformNotSupport, 27 | kTencentApiParamsError, 28 | kTencentApiFail, 29 | } 30 | TencentApiRetCode; 31 | 32 | @class TencentApiReq; 33 | @class TencentApiResp; 34 | 35 | /** 36 | * \brief TencentApiInterface的回调 37 | * 38 | * TencentApiInterface的回调接口 39 | * \note v1.0版本只支持腾讯业务拉起第三方请求内容 40 | */ 41 | @protocol TencentApiInterfaceDelegate 42 | 43 | @optional 44 | /** 45 | * 请求获得内容 当前版本只支持第三方相应腾讯业务请求 46 | */ 47 | - (BOOL)onTencentReq:(TencentApiReq *)req; 48 | 49 | /** 50 | * 响应请求答复 当前版本只支持腾讯业务相应第三方的请求答复 51 | */ 52 | - (BOOL)onTencentResp:(TencentApiResp *)resp; 53 | 54 | @end 55 | 56 | /** 57 | * \brief TencentApiInterface的回调 58 | * 59 | * TencentApiInterface的调用接口 60 | * \note v1.0版本只支持第三方答复内容 61 | */ 62 | @interface TencentApiInterface : NSObject 63 | 64 | /** 65 | * 发送答复返回腾讯业务 66 | * \param resp 答复内容 67 | * \return 返回码 68 | */ 69 | + (TencentApiRetCode)sendRespMessageToTencentApp:(TencentApiResp *)resp; 70 | 71 | /** 72 | * 是否可以处理拉起协议 73 | * \param url 74 | * \param delegate 指定的回调 75 | * \return 是否是腾讯API认识的消息类型 76 | */ 77 | + (BOOL)canOpenURL:(NSURL *)url delegate:(id)delegate; 78 | 79 | /** 80 | * 处理应用拉起协议 81 | * \param url 82 | * \param delegate 指定的回调 83 | * \return 是否是腾讯API认识的消息类型 84 | */ 85 | + (BOOL)handleOpenURL:(NSURL *)url delegate:(id)delegate; 86 | 87 | /** 88 | * 用户设备是否安装腾讯APP 89 | * \param platform 指定的腾讯业务 90 | * \return YES:安装 NO:未安装 91 | */ 92 | + (BOOL)isTencentAppInstall:(TecnentPlatformType)platform; 93 | 94 | /** 95 | * 用户设备是否支持调用SDK 96 | * \param platform 指定的腾讯业务 97 | * \return YES:支持 NO:不支持 98 | */ 99 | + (BOOL)isTencentAppSupportTencentApi:(TecnentPlatformType)platform; 100 | 101 | @end 102 | 103 | #endif 104 | -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/Tencent3.1.0/TencentOpenAPI.framework/Headers/TencentMessageObject.h: -------------------------------------------------------------------------------- 1 | // 2 | // TencentMessageObject.h 3 | // TencentOpenApi_IOS 4 | // 5 | // Created by qqconnect on 13-5-27. 6 | // Copyright (c) 2013年 Tencent. All rights reserved. 7 | // 8 | 9 | #ifndef QQ_OPEN_SDK_LITE 10 | 11 | #import 12 | #import 13 | #import "sdkdef.h" 14 | 15 | #define kTextLimit (1024 * 1024) 16 | #define kDataLimit (1024 * 1024 * 10) 17 | #define kPreviewDataLimit (1024 * 1024) 18 | 19 | @class TencentApiReq; 20 | @class TencentApiResp; 21 | 22 | /** 23 | * 必填的NSArray型参数 24 | */ 25 | typedef NSArray *TCRequiredArray; 26 | 27 | /** 28 | * 必填的NSDictionary型参数 29 | */ 30 | typedef NSDictionary *TCRequiredDictionary; 31 | 32 | /** 33 | * 必填的TencentApiReq型参数 34 | */ 35 | typedef TencentApiReq *TCRequiredReq; 36 | 37 | /** 38 | * 可选的UIImage类型参数 39 | */ 40 | typedef NSData *TCOptionalData; 41 | 42 | 43 | /** 44 | * 可选的NSArray型参数 45 | */ 46 | typedef NSArray *TCOptionalArray; 47 | 48 | /** 49 | * 可选的TencentApiReq型参数 50 | */ 51 | typedef TencentApiReq *TCOptionalReq; 52 | 53 | /** 54 | * TencentReqMessageType 请求类型枚举参数 55 | */ 56 | typedef enum 57 | { 58 | /** TX APP请求内容填充(需要第三方开发者填充完成内容后需要主动调用sendRespMessageToTencentApp)*/ 59 | ReqFromTencentAppQueryContent, 60 | /** TX APP请求展现内容 (不用调用答复) */ 61 | ReqFromTencentAppShowContent, 62 | /** 第三方 APP 请求内容 */ 63 | ReqFromThirdAppQueryContent, 64 | /** 第三方 APP 请求展现内容(类似分享)*/ 65 | ReqFromThirdAppShowContent, 66 | } 67 | TencentReqMessageType; 68 | 69 | typedef enum 70 | { 71 | RespFromTencentAppQueryContent, 72 | RespFromTencentAppShowContent, 73 | RespFromThirdAppQueryContent, 74 | RespFromThirdAppShowContent, 75 | } 76 | TencentRespMessageType; 77 | 78 | /** 79 | * TencentObjVersion 腾讯API消息类型枚举 80 | */ 81 | typedef enum 82 | { 83 | /** 文本类型 */ 84 | TencentTextObj, 85 | /** 图片类型 */ 86 | TencentImageObj, 87 | /** 音频类型 */ 88 | TencentAudioObj, 89 | /** 视频类型 */ 90 | TencentVideoObj, 91 | /** 图片视频类 */ 92 | TencentImageAndVideoObj, 93 | } 94 | TencentObjVersion; 95 | 96 | /** 97 | * \brief 请求包 98 | * 99 | * TencentApiReq用来向其他业务发送请求包 100 | */ 101 | @interface TencentApiReq : NSObject 102 | 103 | /** 104 | * 根据序列号生成一个请求包 105 | * \param apiSeq 请求序列号 106 | * \param type 请求类型 107 | * \return tencentApiReq实例 108 | */ 109 | + (TencentApiReq *)reqFromSeq:(NSInteger)apiSeq type:(TencentReqMessageType)type; 110 | 111 | /** 请求类型 */ 112 | @property (readonly, assign, nonatomic)TCRequiredInt nMessageType; 113 | 114 | /** 请求平台 */ 115 | @property (readonly, assign, nonatomic)NSInteger nPlatform; 116 | 117 | /** 请求的SDK版本号 */ 118 | @property (readonly, assign, nonatomic)NSInteger nSdkVersion; 119 | 120 | /** 请求序列号 */ 121 | @property (readonly, assign, nonatomic)TCRequiredInt nSeq; 122 | 123 | /** 第三方的APPID */ 124 | @property (nonatomic, retain)TCRequiredStr sAppID; 125 | 126 | /** 请求内容 TencentBaseMessageObj对象数组 */ 127 | @property (nonatomic, retain)TCOptionalArray arrMessage; 128 | 129 | /** 请求的描述 可以用于告诉对方这个请求的特定场景 */ 130 | @property (nonatomic, retain)TCOptionalStr sDescription; 131 | 132 | @end 133 | 134 | /** 135 | * \brief 答复包 136 | * 137 | * TencentApiResp用来向其他业务发送答复包 138 | */ 139 | @interface TencentApiResp : NSObject 140 | 141 | /** 142 | * 根据序列号生成一个答复包 143 | * \param req 答复对应的请求包(如果req不是TencentApiReq或者他的子类,会抛出异常) 144 | * \return 答复包体 145 | */ 146 | + (TencentApiResp *)respFromReq:(TencentApiReq *)req; 147 | 148 | /** 返回码 */ 149 | @property (nonatomic, assign)TCOptionalInt nRetCode; 150 | 151 | /** 返回消息 */ 152 | @property (nonatomic, retain)TCOptionalStr sRetMsg; 153 | 154 | /** 答复对应的请求包 */ 155 | @property (nonatomic, retain)TCOptionalReq objReq; 156 | 157 | @end 158 | 159 | /** 160 | * \brief 消息体 161 | * 162 | * TencentBaseMessageObj 应用之间传递消息体 163 | */ 164 | @interface TencentBaseMessageObj : NSObject 165 | 166 | /** 消息类型 */ 167 | @property (nonatomic, assign)NSInteger nVersion; 168 | 169 | /** 消息描述 */ 170 | @property (nonatomic, retain)NSString *sName; 171 | 172 | /** 消息的扩展信息 主要是可以用来进行一些请求消息体的描述 譬如图片要求的width height 文字的关键字什么的, 也可以不用填写*/ 173 | @property (nonatomic, retain)NSDictionary *dictExpandInfo; 174 | 175 | /** 176 | * 消息是否有效 177 | */ 178 | - (BOOL)isVaild; 179 | 180 | @end 181 | 182 | #pragma mark TencentTextMessage 183 | /** 184 | * \brief 文本的消息体 185 | * 186 | * TencentTextMessageObjV1 应用之间传递的文本消息体 187 | */ 188 | @interface TencentTextMessageObjV1 : TencentBaseMessageObj 189 | 190 | /** 191 | * 文本 192 | * \note 文本长度不能超过4096个字 193 | */ 194 | @property (nonatomic, retain) NSString *sText; 195 | 196 | 197 | /** 198 | * 初始化文本消息 199 | * \param text 文本 200 | * \return 初始化返回的文本消息 201 | */ 202 | - (id)initWithText:(NSString *)text; 203 | 204 | @end 205 | 206 | 207 | #pragma mark TecentImageMessage 208 | 209 | /** 210 | * TencentApiImageSourceType 图片数据类型(请求方对数据类型可能会有限制) 211 | */ 212 | typedef enum 213 | { 214 | /** 图片数据是url或二进制数据 */ 215 | AllImage, 216 | /** 图片数据是url */ 217 | UrlImage, 218 | /** 图片数据是二进制数据 */ 219 | DataImage, 220 | }TencentApiImageSourceType; 221 | 222 | /** 223 | * \brief 图片的消息体 224 | * 225 | * TencentImageMessageObjV1 应用之间传递的图片消息体 226 | */ 227 | @interface TencentImageMessageObjV1 : TencentBaseMessageObj 228 | 229 | /** 230 | * 图片数据 231 | * \note 图片不能大于10M 232 | */ 233 | @property (nonatomic, retain) NSData *dataImage; 234 | 235 | /** 236 | * 缩略图的数据 237 | * \note 图片不能大于1M 238 | */ 239 | @property (nonatomic, retain) NSData *dataThumbImage; 240 | 241 | /** 图片URL */ 242 | @property (nonatomic, retain) NSString *sUrl; 243 | 244 | /** 图片的描述 */ 245 | @property (nonatomic, retain) NSString *sDescription; 246 | 247 | /** 图片的size */ 248 | @property (nonatomic, assign) CGSize szImage; 249 | 250 | /** 251 | * 图片来源 252 | * \note TencentApiImageSourceType对应的类型 253 | */ 254 | @property (readonly, assign) NSInteger nType; 255 | 256 | /** 257 | * 初始化图片消息 258 | * \param dataImage 图片类型 259 | * \return 初始化返回的图片消息 260 | */ 261 | - (id)initWithImageData:(NSData *)dataImage; 262 | 263 | /** 264 | * 初始化图片消息 265 | * \param url 图片url 266 | * \return 初始化返回的图片消息 267 | */ 268 | - (id)initWithImageUrl:(NSString *)url; 269 | 270 | /** 271 | * 初始化图片消息 272 | * \param type 图片类型 273 | * \return 初始化返回的图片消息 274 | */ 275 | - (id)initWithType:(TencentApiImageSourceType)type; 276 | @end 277 | 278 | 279 | #pragma mark TencentAudioMessage 280 | /** 281 | * \brief 音频的消息体 282 | * 283 | * TencentAudioMessageObjV1 应用之间传递的音频消息体 284 | */ 285 | @interface TencentAudioMessageObjV1 : TencentBaseMessageObj 286 | 287 | /** 音频URL */ 288 | @property (nonatomic, retain) NSString *sUrl; 289 | 290 | /** 291 | * 音频的预览图 292 | * \note图片不能大于1M 293 | */ 294 | @property (nonatomic, retain) NSData *dataImagePreview; 295 | 296 | /** 音频的预览图URL */ 297 | @property (nonatomic, retain) NSString *sImagePreviewUrl; 298 | 299 | /** 音频的描述 */ 300 | @property (nonatomic, retain) NSString *sDescription; 301 | 302 | /** 303 | * 初始化图片消息 304 | * \param url 音频URL 305 | * \return 初始化返回的音频消息 306 | */ 307 | - (id)initWithAudioUrl:(NSString *)url; 308 | 309 | @end 310 | 311 | 312 | #pragma mark TencentVideoMessage 313 | 314 | /** 315 | * TencentApiVideoSourceType 视频数据类型(请求方对数据类型可能会有限制) 316 | */ 317 | 318 | typedef enum 319 | { 320 | /** 视频来源于本地或网络 */ 321 | AllVideo, 322 | /** 视频来源于本地 */ 323 | LocalVideo, 324 | /** 视频来源于网络 */ 325 | NetVideo, 326 | }TencentApiVideoSourceType; 327 | 328 | /** 329 | * \brief 视频的消息体 330 | * 331 | * TencentVideoMessageV1 应用之间传递的视频消息体 332 | */ 333 | @interface TencentVideoMessageV1 : TencentBaseMessageObj 334 | 335 | /** 336 | * 视频URL 337 | * \note 不能超过1024 338 | */ 339 | @property (nonatomic, retain) NSString *sUrl; 340 | 341 | /** 342 | * 视频来源 主要是用来让发起方指定视频的来源 343 | * \note TencentApiVideoSourceType 对应的类型 只读参数 344 | */ 345 | @property (readonly, assign, nonatomic) NSInteger nType; 346 | 347 | /** 348 | * 视频的预览图 349 | * \note 图片不能大于1M 350 | */ 351 | @property (nonatomic, retain) NSData *dataImagePreview; 352 | 353 | /** 视频的预览图URL */ 354 | @property (nonatomic, retain) NSString *sImagePreviewUrl; 355 | 356 | /** 视频的描述 */ 357 | @property (nonatomic, retain) NSString *sDescription; 358 | 359 | /** 360 | * 初始化视频消息 361 | * \param url 视频URL 362 | * \param type 视频来源类型 363 | * \return 初始化返回的视频消息 364 | */ 365 | - (id)initWithVideoUrl:(NSString *)url type:(TencentApiVideoSourceType)type; 366 | 367 | 368 | /** 369 | * 初始化视频消息 370 | * \param type 视频来源类型 371 | * \return 初始化返回的视频消息 372 | */ 373 | - (id)initWithType:(TencentApiVideoSourceType)type; 374 | @end 375 | 376 | #pragma mark TencentImageMessageObj 377 | /** 378 | * \brief 视频图片消息体 379 | * 380 | * TencentVideoMessageV1 这是一个扩展的类 是一个图片视频类 381 | * \note 图片视频可以任选一个内容填充 但是注意只能填一个 当有一种类型被填充后 另外一个种类型就无法填充了 382 | */ 383 | @interface TencentImageAndVideoMessageObjV1 : TencentBaseMessageObj 384 | 385 | /** 图片消息 */ 386 | @property (nonatomic, retain) TencentImageMessageObjV1 *objImageMessage; 387 | 388 | /** 视频消息 */ 389 | @property (nonatomic, retain) TencentVideoMessageV1 *objVideoMessage; 390 | 391 | /** 392 | * 初始化图片消息 393 | * \param dataImage 图片数据 394 | * \param url 视频url 395 | * \return 初始化返回的图片视频消息 396 | */ 397 | - (id)initWithMessage:(NSData *)dataImage videoUrl:(NSString *)url; 398 | 399 | /** 400 | * 设置图片 401 | * \param dataImage 图片数据 402 | */ 403 | - (void)setDataImage:(NSData *)dataImage; 404 | 405 | /** 406 | * 设置视频 407 | * \param videoUrl 视频URL 408 | */ 409 | - (void)setVideoUrl:(NSString *)videoUrl; 410 | @end 411 | 412 | #endif 413 | -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/Tencent3.1.0/TencentOpenAPI.framework/Headers/TencentOAuth.h: -------------------------------------------------------------------------------- 1 | /// 2 | /// \file TencentOAuth.h 3 | /// \brief QQ互联开放平台授权登录及相关开放接口实现类 4 | /// 5 | /// Created by Tencent on 12-12-21. 6 | /// Copyright (c) 2012年 Tencent. All rights reserved. 7 | /// 8 | 9 | #import 10 | #import "sdkdef.h" 11 | #import "TencentOAuthObject.h" 12 | #import "TencentApiInterface.h" 13 | 14 | @protocol TencentSessionDelegate; 15 | @protocol TencentLoginDelegate; 16 | @protocol TencentApiInterfaceDelegate; 17 | @protocol TencentWebViewDelegate; 18 | 19 | @class TencentApiReq; 20 | @class TencentApiResp; 21 | 22 | typedef enum 23 | { 24 | kTencentNotAuthorizeState, 25 | kTencentSSOAuthorizeState, 26 | kTencentWebviewAuthorzieState, 27 | } TencentAuthorizeState; 28 | 29 | typedef enum 30 | { 31 | kAuthModeClientSideToken, 32 | kAuthModeServerSideCode, 33 | } TencentAuthMode; 34 | 35 | #pragma mark - TencentOAuth(授权登录及相关开放接口调用) 36 | 37 | /** 38 | * \brief TencentOpenAPI授权登录及相关开放接口调用 39 | * 40 | * TencentOAuth实现授权登录逻辑以及相关开放接口的请求调用 41 | */ 42 | @interface TencentOAuth : NSObject 43 | { 44 | NSMutableDictionary* _apiRequests; 45 | NSString* _accessToken; 46 | NSDate* _expirationDate; 47 | id _sessionDelegate; 48 | NSString* _localAppId; 49 | NSString* _openId; 50 | NSString* _redirectURI; 51 | NSArray* _permissions; 52 | } 53 | 54 | /** Access Token凭证,用于后续访问各开放接口 */ 55 | @property(nonatomic, copy) NSString* accessToken; 56 | 57 | /** Access Token的失效期 */ 58 | @property(nonatomic, copy) NSDate* expirationDate; 59 | 60 | /** 已实现的开放接口的回调委托对象 */ 61 | @property(nonatomic, assign) id sessionDelegate; 62 | 63 | /** 第三方应用在开发过程中设置的URLSchema,用于浏览器登录后后跳到第三方应用 */ 64 | @property(nonatomic, copy) NSString* localAppId; 65 | 66 | /** 用户授权登录后对该用户的唯一标识 */ 67 | @property(nonatomic, copy) NSString* openId; 68 | 69 | /** 用户登录成功过后的跳转页面地址 */ 70 | @property(nonatomic, copy) NSString* redirectURI; 71 | 72 | /** 第三方应用在互联开放平台申请的appID */ 73 | @property(nonatomic, retain) NSString* appId; 74 | 75 | /** 主要是互娱的游戏设置uin */ 76 | @property(nonatomic, retain) NSString* uin; 77 | 78 | /** 主要是互娱的游戏设置鉴定票据 */ 79 | @property(nonatomic, retain) NSString* skey; 80 | 81 | /** 登陆透传的数据 */ 82 | @property(nonatomic, copy) NSDictionary* passData; 83 | 84 | /** 授权方式(Client Side Token或者Server Side Code) */ 85 | @property(nonatomic, assign) TencentAuthMode authMode; 86 | 87 | /** 88 | * 用来获得当前sdk的版本号 89 | * \return 返回sdk版本号 90 | **/ 91 | 92 | + (NSString*)sdkVersion; 93 | 94 | /** 95 | * 用来获得当前sdk的小版本号 96 | * \return 返回sdk小版本号 97 | **/ 98 | 99 | + (NSString*)sdkSubVersion; 100 | 101 | /** 102 | * 用来获得当前sdk的是否精简版 103 | * \return 返回YES表示精简版 104 | **/ 105 | 106 | + (BOOL)isLiteSDK; 107 | 108 | /** 109 | * 主要是用来帮助判断是否有登陆被发起,但是还没有过返回结果 110 | * \return 111 | * kTencentNotAuthorizeState:无授权 112 | * kTencentSSOAuthorizeState:有人发起了sso授权但无返回 113 | * kTencentWebviewAuthorzieState:有人发起了webview授权还未返回 114 | **/ 115 | 116 | + (TencentAuthorizeState *)authorizeState; 117 | 118 | /** 119 | * 用来获得当前手机qq的版本号 120 | * \return 返回手机qq版本号 121 | **/ 122 | + (QQVersion)iphoneQQVersion; 123 | 124 | /** 125 | * 初始化TencentOAuth对象 126 | * \param appId 第三方应用在互联开放平台申请的唯一标识 127 | * \param delegate 第三方应用用于接收请求返回结果的委托对象 128 | * \return 初始化后的授权登录对象 129 | */ 130 | - (id)initWithAppId:(NSString *)appId 131 | andDelegate:(id)delegate; 132 | 133 | 134 | /** 135 | * 判断用户手机上是否安装手机QQ 136 | * \return YES:安装 NO:没安装 137 | */ 138 | + (BOOL)iphoneQQInstalled; 139 | 140 | /** 141 | * 判断用户手机上的手机QQ是否支持SSO登录 142 | * \return YES:支持 NO:不支持 143 | */ 144 | + (BOOL)iphoneQQSupportSSOLogin; 145 | 146 | /** 147 | * 判断用户手机上是否安装手机QZone 148 | * \return YES:安装 NO:没安装 149 | */ 150 | + (BOOL)iphoneQZoneInstalled; 151 | 152 | /** 153 | * 判断用户手机上的手机QZone是否支持SSO登录 154 | * \return YES:支持 NO:不支持 155 | */ 156 | + (BOOL)iphoneQZoneSupportSSOLogin; 157 | 158 | /** 159 | * 登录授权 160 | * 161 | * \param permissions 授权信息列 162 | */ 163 | - (BOOL)authorize:(NSArray *)permissions; 164 | 165 | /** 166 | * 登录授权 167 | * \param permissions 授权信息列表 168 | * \param bInSafari 是否使用safari进行登录.IOS SDK 1.3版本开始此参数废除 169 | */ 170 | - (BOOL)authorize:(NSArray *)permissions 171 | inSafari:(BOOL)bInSafari; 172 | 173 | /** 174 | * 登录授权 175 | * \param permissions 授权信息列表 176 | * \param localAppId 应用APPID 177 | * \param bInSafari 是否使用safari进行登录.IOS SDK 1.3版本开始此参数废除 178 | */ 179 | - (BOOL)authorize:(NSArray *)permissions 180 | localAppId:(NSString *)localAppId 181 | inSafari:(BOOL)bInSafari; 182 | 183 | /** 184 | * 增量授权,因用户没有授予相应接口调用的权限,需要用户确认是否授权 185 | * \param permissions 需增量授权的信息列表 186 | * \return 增量授权调用是否成功 187 | */ 188 | - (BOOL)incrAuthWithPermissions:(NSArray *)permissions; 189 | 190 | /** 191 | * 重新授权,因token废除或失效导致接口调用失败,需用户重新授权 192 | * \param permissions 授权信息列表,同登录授权 193 | * \return 授权调用是否成功 194 | */ 195 | - (BOOL)reauthorizeWithPermissions:(NSArray *)permissions; 196 | 197 | /** 198 | * (静态方法)处理应用拉起协议 199 | * \param url 处理被其他应用呼起时的逻辑 200 | * \return 处理结果,YES表示成功,NO表示失败 201 | */ 202 | + (BOOL)HandleOpenURL:(NSURL *)url; 203 | 204 | /** 205 | * (静态方法)sdk是否可以处理应用拉起协议 206 | * \param url 处理被其他应用呼起时的逻辑 207 | * \return 处理结果,YES表示可以 NO表示不行 208 | */ 209 | + (BOOL)CanHandleOpenURL:(NSURL *)url; 210 | 211 | /** 212 | * (静态方法)获取TencentOAuth调用的上一次错误信息 213 | */ 214 | + (NSString *)getLastErrorMsg; 215 | 216 | /** 217 | * 以Server Side Code模式授权登录时,通过此接口获取返回的code值; 218 | * 以Client Side Token模式授权登录时,忽略此接口。 219 | */ 220 | - (NSString *)getServerSideCode; 221 | 222 | /** 223 | * 退出登录(退出登录后,TecentOAuth失效,需要重新初始化) 224 | * \param delegate 第三方应用用于接收请求返回结果的委托对象 225 | */ 226 | - (void)logout:(id)delegate; 227 | 228 | /** 229 | * 判断登录态是否有效 230 | * \return 处理结果,YES表示有效,NO表示无效,请用户重新登录授权 231 | */ 232 | - (BOOL)isSessionValid; 233 | 234 | /** 235 | * 获取用户个人信息 236 | * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 237 | */ 238 | - (BOOL)getUserInfo; 239 | 240 | /** 241 | * SDK内置webview实现定向分享时,第三方应用可以根据应用是否在白名单里来开启该配置开关,默认为关闭; 242 | * 在白名单里的应用调用该接口后,即打开sdk内置webview的二级白名单开关(相对与sdk后台的白名单), 243 | * 那么在sdk后台白名单校验请求失败的情况下,会继续先尝试采用内置webview进行分享。 244 | */ 245 | - (void)openSDKWebViewQQShareEnable; 246 | 247 | 248 | /** 249 | * 获取用户QZone相册列表 250 | * \attention 需\ref apply_perm 251 | * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 252 | */ 253 | - (BOOL)getListAlbum; 254 | 255 | /** 256 | * 获取用户QZone相片列表 257 | * \attention 需\ref apply_perm 258 | * \param params 参数字典,字典的关键字参见TencentOAuthObject.h中的\ref TCListPhotoDic 259 | * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 260 | */ 261 | - (BOOL)getListPhotoWithParams:(NSMutableDictionary *)params; 262 | 263 | 264 | /** 265 | * 分享到QZone 266 | * \param params 参数字典,字典的关键字参见TencentOAuthObject.h中的\ref TCAddShareDic 267 | * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 268 | */ 269 | - (BOOL)addShareWithParams:(NSMutableDictionary *)params; 270 | 271 | 272 | /** 273 | * 上传照片到QZone指定相册 274 | * \attention 需\ref apply_perm 275 | * \param params 参数字典,字典的关键字参见TencentOAuthObject.h中的\ref TCUploadPicDic 276 | * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 277 | */ 278 | - (BOOL)uploadPicWithParams:(NSMutableDictionary *)params; 279 | 280 | /** 281 | * 在QZone相册中创建一个新的相册 282 | * \attention 需\ref apply_perm 283 | * \param params 参数字典,字典的关键字参见TencentOAuthObject.h中的\ref TCAddAlbumDic 284 | * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 285 | */ 286 | - (BOOL)addAlbumWithParams:(NSMutableDictionary *)params; 287 | 288 | /** 289 | * 检查是否是QZone某个用户的粉丝 290 | * \param params 参数字典,字典的关键字参见TencentOAuthObject.h中的\ref TCCheckPageFansDic 291 | * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 292 | */ 293 | - (BOOL)checkPageFansWithParams:(NSMutableDictionary *)params; 294 | 295 | /** 296 | * 在QZone中发表一篇日志 297 | * \attention 需\ref apply_perm 298 | * \param params 参数字典,字典的关键字参见TencentOAuthObject.h中的\ref TCAddOneBlogDic 299 | * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 300 | */ 301 | - (BOOL)addOneBlogWithParams:(NSMutableDictionary *)params; 302 | 303 | /** 304 | * 在QZone中发表一条说说 305 | * \attention 需\ref apply_perm 306 | * \param params 参数字典,字典的关键字参见TencentOAuthObject.h中的\ref TCAddTopicDic 307 | * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 308 | */ 309 | - (BOOL)addTopicWithParams:(NSMutableDictionary *)params; 310 | 311 | /** 312 | * 设置QQ头像 使用默认的效果处理设置头像的界面 313 | * \attention 需\ref apply_perm 314 | * \param params 参数字典,字典的关键字参见TencentOAuthObject.h中的\ref TCSetUserHeadpic 315 | * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 316 | */ 317 | - (BOOL)setUserHeadpic:(NSMutableDictionary *)params; 318 | 319 | 320 | /** 321 | * 设置QQ头像 会返回设置头像由第三方自己处理界面的弹出方式 322 | * \attention 需\ref apply_perm 323 | * \param params 参数字典,字典的关键字参见TencentOAuthObject.h中的\ref TCSetUserHeadpic 324 | * \param viewController 设置头像的界面 325 | * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 326 | */ 327 | - (BOOL)setUserHeadpic:(NSMutableDictionary *)params andViewController:(UIViewController **)viewController; 328 | 329 | /** 330 | * 获取QQ会员信息(仅包括是否为QQ会员,是否为年费QQ会员) 331 | * \attention 需\ref apply_perm 332 | * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 333 | */ 334 | - (BOOL)getVipInfo; 335 | 336 | /** 337 | * 获取QQ会员详细信息 338 | * \attention 需\ref apply_perm 339 | * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 340 | */ 341 | - (BOOL)getVipRichInfo; 342 | 343 | /** 344 | * QZone定向分享,可以@到具体好友,完成后将触发responseDidReceived:forMessage:回调,message:“SendStory” 345 | * \param params 参数字典 346 | * \param fopenIdArray 第三方应用预传人好友列表,好友以openid标识 347 | * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 348 | */ 349 | - (BOOL)sendStory:(NSMutableDictionary *)params friendList:(NSArray *)fopenIdArray; 350 | 351 | /** 352 | * 发送应用邀请,完成后将触发responseDidReceived:forMessage:回调,message:“AppInvitation” 353 | * \param desc 应用的描述文字,不超过35字符,如果为nil或@“”则显示默认描述 354 | * \param imageUrl 应用的图标,如果为nil或者@“”则显示默认图标 355 | * \param source 透传参数,由开发者自定义该参数内容 356 | * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 357 | */ 358 | - (BOOL)sendAppInvitationWithDescription:(NSString *)desc imageURL:(NSString *)imageUrl source:(NSString *)source; 359 | 360 | /** 361 | * 发起PK或者发送炫耀,完成后将触发responseDidReceived:forMessage:回调,message:“AppChallenge” 362 | * \param receiver 必须指定一位进行PK或者炫耀的好友,填写其OpenID,填写多个OpenID将截取第一个 363 | * \param type 类型,"pk"或者“brag” 364 | * \param imageUrl 炫耀/挑战场景图的URL 365 | * \param message 炫耀/挑战中的内容描述,不超过50个字符,超过限制则自动截断 366 | * \param source 透传参数,由开发者自定义该参数内容 367 | * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 368 | */ 369 | - (BOOL)sendChallenge:(NSString *)receiver type:(NSString *)type imageURL:(NSString *)imageUrl message:(NSString *)message source:(NSString *)source; 370 | 371 | /** 372 | * 赠送或者请求礼物,完成后将触发responseDidReceived:forMessage:回调,message:“AppGiftRequest” 373 | * \param receiver 赠送或者请求礼物的好友的OpenID,支持填写多个,OpenID之用","分隔,为nil时将由用户通过好友选择器选择好友 374 | * \param exclude 用户通过好友选择器选择好友场景下,希望排除的好友(不显示在好友选择器) 375 | * \param specified 用户通过好友选择器选择好友场景下,希望出现的指定好友 376 | * \param only 是否只显示specified指定的好友 377 | * \param type 类型,"request"或者“freegift” 378 | * \param title 免费礼物或请求名称,不超过6个字符 379 | * \param message 礼物或请求的默认赠言,控制在35个汉字以内,超过限制自动截断 380 | * \param imageUrl 请求或礼物配图的URL,如果不传,则默认在弹框中显示应用的icon 381 | * \param source 透传参数,由开发者自定义该参数内容 382 | * \return 处理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录 383 | */ 384 | - (BOOL)sendGiftRequest:(NSString *)receiver exclude:(NSString *)exclude specified:(NSString *)specified only:(BOOL)only type:(NSString *)type title:(NSString *)title message:(NSString *)message imageURL:(NSString *)imageUrl source:(NSString *)source; 385 | 386 | 387 | /** 388 | * 退出指定API调用 389 | * \param userData 用户调用某条API的时候传入的保留参数 390 | * \return 处理结果,YES表示成功 NO表示失败 391 | */ 392 | - (BOOL)cancel:(id)userData; 393 | 394 | /** 395 | * CGI类任务创建接口 396 | * \param apiURL CGI请求的URL地址 397 | * \param method CGI请求方式:"GET","POST" 398 | * \param params CGI请求参数字典 399 | * \param callback CGI请求结果的回调接口对象 400 | * \return CGI请求任务实例,用于取消任务,返回nil代表任务创建失败 401 | */ 402 | - (TCAPIRequest *)cgiRequestWithURL:(NSURL *)apiURL method:(NSString *)method params:(NSDictionary *)params callback:(id)callback; 403 | 404 | /** 405 | * TencentOpenApi发送任务统一接口 406 | * \param request 请求发送的任务 407 | * \param callback 任务发送后的回调地址 408 | */ 409 | - (BOOL)sendAPIRequest:(TCAPIRequest *)request callback:(id)callback; 410 | 411 | - (NSString *)getUserOpenID; 412 | 413 | @end 414 | 415 | #pragma mark - TencentLoginDelegate(授权登录回调协议) 416 | 417 | /** 418 | * \brief TencentLoginDelegate iOS Open SDK 1.3 API回调协议 419 | * 420 | * 第三方应用实现登录的回调协议 421 | */ 422 | @protocol TencentLoginDelegate 423 | 424 | @required 425 | 426 | /** 427 | * 登录成功后的回调 428 | */ 429 | - (void)tencentDidLogin; 430 | 431 | /** 432 | * 登录失败后的回调 433 | * \param cancelled 代表用户是否主动退出登录 434 | */ 435 | - (void)tencentDidNotLogin:(BOOL)cancelled; 436 | 437 | /** 438 | * 登录时网络有问题的回调 439 | */ 440 | - (void)tencentDidNotNetWork; 441 | 442 | @optional 443 | /** 444 | * 登录时权限信息的获得 445 | */ 446 | - (NSArray *)getAuthorizedPermissions:(NSArray *)permissions withExtraParams:(NSDictionary *)extraParams; 447 | 448 | @end 449 | 450 | #pragma mark - TencentSessionDelegate(开放接口回调协议) 451 | 452 | /** 453 | * \brief TencentSessionDelegate iOS Open SDK 1.3 API回调协议 454 | * 455 | * 第三方应用需要实现每条需要调用的API的回调协议 456 | */ 457 | @protocol TencentSessionDelegate 460 | 461 | @optional 462 | 463 | /** 464 | * 退出登录的回调 465 | */ 466 | - (void)tencentDidLogout; 467 | 468 | /** 469 | * 因用户未授予相应权限而需要执行增量授权。在用户调用某个api接口时,如果服务器返回操作未被授权,则触发该回调协议接口,由第三方决定是否跳转到增量授权页面,让用户重新授权。 470 | * \param tencentOAuth 登录授权对象。 471 | * \param permissions 需增量授权的权限列表。 472 | * \return 是否仍然回调返回原始的api请求结果。 473 | * \note 不实现该协议接口则默认为不开启增量授权流程。若需要增量授权请调用\ref TencentOAuth#incrAuthWithPermissions: \n注意:增量授权时用户可能会修改登录的帐号 474 | */ 475 | - (BOOL)tencentNeedPerformIncrAuth:(TencentOAuth *)tencentOAuth withPermissions:(NSArray *)permissions; 476 | 477 | /** 478 | * [该逻辑未实现]因token失效而需要执行重新登录授权。在用户调用某个api接口时,如果服务器返回token失效,则触发该回调协议接口,由第三方决定是否跳转到登录授权页面,让用户重新授权。 479 | * \param tencentOAuth 登录授权对象。 480 | * \return 是否仍然回调返回原始的api请求结果。 481 | * \note 不实现该协议接口则默认为不开启重新登录授权流程。若需要重新登录授权请调用\ref TencentOAuth#reauthorizeWithPermissions: \n注意:重新登录授权时用户可能会修改登录的帐号 482 | */ 483 | - (BOOL)tencentNeedPerformReAuth:(TencentOAuth *)tencentOAuth; 484 | 485 | /** 486 | * 用户通过增量授权流程重新授权登录,token及有效期限等信息已被更新。 487 | * \param tencentOAuth token及有效期限等信息更新后的授权实例对象 488 | * \note 第三方应用需更新已保存的token及有效期限等信息。 489 | */ 490 | - (void)tencentDidUpdate:(TencentOAuth *)tencentOAuth; 491 | 492 | /** 493 | * 用户增量授权过程中因取消或网络问题导致授权失败 494 | * \param reason 授权失败原因,具体失败原因参见sdkdef.h文件中\ref UpdateFailType 495 | */ 496 | - (void)tencentFailedUpdate:(UpdateFailType)reason; 497 | 498 | /** 499 | * 获取用户个人信息回调 500 | * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse 501 | * \remarks 正确返回示例: \snippet example/getUserInfoResponse.exp success 502 | * 错误返回示例: \snippet example/getUserInfoResponse.exp fail 503 | */ 504 | - (void)getUserInfoResponse:(APIResponse*) response; 505 | 506 | 507 | /** 508 | * 获取用户QZone相册列表回调 509 | * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse 510 | * \remarks 正确返回示例: \snippet example/getListAlbumResponse.exp success 511 | * 错误返回示例: \snippet example/getListAlbumResponse.exp fail 512 | */ 513 | - (void)getListAlbumResponse:(APIResponse*) response; 514 | 515 | /** 516 | * 获取用户QZone相片列表 517 | * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse 518 | * \remarks 正确返回示例: \snippet example/getListPhotoResponse.exp success 519 | * 错误返回示例: \snippet example/getListPhotoResponse.exp fail 520 | */ 521 | - (void)getListPhotoResponse:(APIResponse*) response; 522 | 523 | /** 524 | * 检查是否是QZone某个用户的粉丝回调 525 | * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse 526 | * \remarks 正确返回示例: \snippet example/checkPageFansResponse.exp success 527 | * 错误返回示例: \snippet example/checkPageFansResponse.exp fail 528 | */ 529 | - (void)checkPageFansResponse:(APIResponse*) response; 530 | 531 | /** 532 | * 分享到QZone回调 533 | * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse 534 | * \remarks 正确返回示例: \snippet example/addShareResponse.exp success 535 | * 错误返回示例: \snippet example/addShareResponse.exp fail 536 | */ 537 | - (void)addShareResponse:(APIResponse*) response; 538 | 539 | /** 540 | * 在QZone相册中创建一个新的相册回调 541 | * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse 542 | * \remarks 正确返回示例: \snippet example/addAlbumResponse.exp success 543 | * 错误返回示例: \snippet example/addAlbumResponse.exp fail 544 | */ 545 | - (void)addAlbumResponse:(APIResponse*) response; 546 | 547 | /** 548 | * 上传照片到QZone指定相册回调 549 | * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse 550 | * \remarks 正确返回示例: \snippet example/uploadPicResponse.exp success 551 | * 错误返回示例: \snippet example/uploadPicResponse.exp fail 552 | */ 553 | - (void)uploadPicResponse:(APIResponse*) response; 554 | 555 | 556 | /** 557 | * 在QZone中发表一篇日志回调 558 | * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse 559 | * \remarks 正确返回示例: \snippet example/addOneBlogResponse.exp success 560 | * 错误返回示例: \snippet example/addOneBlogResponse.exp fail 561 | */ 562 | - (void)addOneBlogResponse:(APIResponse*) response; 563 | 564 | /** 565 | * 在QZone中发表一条说说回调 566 | * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse 567 | * \remarks 正确返回示例: \snippet example/addTopicResponse.exp success 568 | * 错误返回示例: \snippet example/addTopicResponse.exp fail 569 | */ 570 | - (void)addTopicResponse:(APIResponse*) response; 571 | 572 | /** 573 | * 设置QQ头像回调 574 | * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse 575 | * \remarks 正确返回示例: \snippet example/setUserHeadpicResponse.exp success 576 | * 错误返回示例: \snippet example/setUserHeadpicResponse.exp fail 577 | */ 578 | - (void)setUserHeadpicResponse:(APIResponse*) response; 579 | 580 | /** 581 | * 获取QQ会员信息回调 582 | * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse 583 | * \remarks 正确返回示例: \snippet example/getVipInfoResponse.exp success 584 | * 错误返回示例: \snippet example/getVipInfoResponse.exp fail 585 | */ 586 | - (void)getVipInfoResponse:(APIResponse*) response; 587 | 588 | /** 589 | * 获取QQ会员详细信息回调 590 | * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse 591 | */ 592 | - (void)getVipRichInfoResponse:(APIResponse*) response; 593 | 594 | /** 595 | * sendStory分享的回调(已废弃,使用responseDidReceived:forMessage:) 596 | * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse 597 | */ 598 | - (void)sendStoryResponse:(APIResponse*) response; 599 | 600 | 601 | /** 602 | * 社交API统一回调接口 603 | * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse 604 | * \param message 响应的消息,目前支持‘SendStory’,‘AppInvitation’,‘AppChallenge’,‘AppGiftRequest’ 605 | */ 606 | - (void)responseDidReceived:(APIResponse*)response forMessage:(NSString *)message; 607 | 608 | /** 609 | * post请求的上传进度 610 | * \param tencentOAuth 返回回调的tencentOAuth对象 611 | * \param bytesWritten 本次回调上传的数据字节数 612 | * \param totalBytesWritten 总共已经上传的字节数 613 | * \param totalBytesExpectedToWrite 总共需要上传的字节数 614 | * \param userData 用户自定义数据 615 | */ 616 | - (void)tencentOAuth:(TencentOAuth *)tencentOAuth didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite userData:(id)userData; 617 | 618 | 619 | /** 620 | * 通知第三方界面需要被关闭 621 | * \param tencentOAuth 返回回调的tencentOAuth对象 622 | * \param viewController 需要关闭的viewController 623 | */ 624 | - (void)tencentOAuth:(TencentOAuth *)tencentOAuth doCloseViewController:(UIViewController *)viewController; 625 | 626 | @end 627 | 628 | #pragma mark - TencentWebViewDelegate(H5登录webview旋转方向回调) 629 | 630 | /** 631 | * \brief TencentWebViewDelegate: H5登录webview旋转方向回调协议 632 | * 633 | * 第三方应用可以根据自己APP的旋转方向限制,通过此协议设置 634 | */ 635 | @protocol TencentWebViewDelegate 636 | @optional 637 | - (BOOL) tencentWebViewShouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation; 638 | - (NSUInteger) tencentWebViewSupportedInterfaceOrientationsWithWebkit; 639 | - (BOOL) tencentWebViewShouldAutorotateWithWebkit; 640 | @end 641 | -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/Tencent3.1.0/TencentOpenAPI.framework/Headers/TencentOAuthObject.h: -------------------------------------------------------------------------------- 1 | /// 2 | /// \file TencentOAuthObject.h 3 | /// 对开放接口的调用提供参数字典封装的辅助类 4 | /// 5 | /// Created by Tencent on 12-12-28. 6 | /// Copyright (c) 2012年 Tencent. All rights reserved. 7 | /// 8 | 9 | #import 10 | #import 11 | #import "sdkdef.h" 12 | 13 | 14 | #pragma mark - 15 | #pragma mark TCAddTopicDic 16 | 17 | /** 18 | * \brief 发表说说的参数字典定义 19 | * 20 | * 可以直接填写相应参数后将对象当作参数传入API中 21 | */ 22 | @interface TCAddTopicDic : TCAPIRequest 23 | 24 | /** 25 | * 返回一个对象用来进行API参数的填充 26 | * \note 不用释放,返回的对象是自动释放的 27 | */ 28 | + (TCAddTopicDic *) dictionary; 29 | 30 | /** 31 | * 发布心情时引用的信息的类型。 32 | * \note 1表示图片; 2表示网页; 3表示视频 33 | */ 34 | @property (nonatomic, retain) TCOptionalStr paramRichtype; 35 | 36 | /** 37 | * 发布心情时引用的信息的值。有richtype时必须有richval 38 | * 39 | * \note 40 | * -# 当richtype为图片(即richtype为1,应用场景为发布心情时引用某张图片)时,\n 41 | * richval需要传入该图片的相关参数。引用的图片来源分为两种:一种为网站图片,\n 42 | * 一种为QQ空间相册中的某张图片。 43 | * - 当引用的图片来自网站,richval包含下列参数的值:\n 44 | * | 参数名称 | 是否必须 | 类型 | 描述 | 45 | * | ------ | ------- | ------ | ----------------- | 46 | * | url | 必须 | string | 网站图片的URL | 47 | * | height | 必须 | string | 图片高度,单位: px | 48 | * | width | 必须 | string | 图片宽度,单位: px | 49 | * \n 50 | * 输入时每个值中间用“&”分隔,如下所示:\n 51 | * “url=http://qq.com/logo.png&width=25&height=21” 52 | * 53 | * - 当引用的图片来自QQ空间相册,richval包含下列参数的值。\n 54 | * 这些值都需要通过调用相册OpenAPI来获得。参数意义如下:\n 55 | * | 参数名称 | 是否必须 | 类型 | 描述 | 56 | * | --------- | ------ | ------ | ---------------------------------- | 57 | * | albumid | 必须 | string | 图片所属空间相册的ID | 58 | * | pictureid | 必须 | string | 图片ID | 59 | * | sloc | 必须 | string | 小图ID | 60 | * | pictype | | string | 图片类型(JPG = 1;GIF = 2;PNG = 3) | 61 | * | picheight | | string | 图片高度,单位: px | 62 | * | picwidth | | string | 图片宽度,单位: px | 63 | * 输入时每个值中间用逗号分隔,如下所示 :\n 64 | * “albumid,pictureid,sloc,pictype,picheight,picwidth” 65 | * -# 当richtype为网页(即richtype为2,应用场景为针对某网页发表评论)时,\n 66 | * richval需要传入该网页的URL,发表为feeds时,后台会自动将该URL转换为短URL。 67 | * -# 当richtype为视频(即richtype为3,应用场景为针对某视频发表评论)时,\n 68 | * richval需要传入该视频的URL,发表为feeds时,后台会对该URL进行解析,\n 69 | * 在feeds上显示播放器,视频源及缩略图。 70 | */ 71 | @property (nonatomic, retain) TCOptionalStr paramRichval; 72 | 73 | /** 74 | * 发布的心情的内容。 75 | */ 76 | @property (nonatomic, retain) TCRequiredStr paramCon; 77 | 78 | /** 79 | * 地址文。例如:广东省深圳市南山区高新科技园腾讯大厦。lbs_nm,lbs_x,lbs_y通常一起使用,来明确标识一个地址。 80 | */ 81 | @property (nonatomic, retain) TCOptionalStr paramLbs_nm; 82 | 83 | /** 84 | * 经度。-180.0到+180.0,+表示东经。lbs_nm,lbs_x,lbs_y通常一起使用,来明确标识一个地址。 85 | */ 86 | @property (nonatomic, retain) TCOptionalStr paramLbs_x; 87 | 88 | /** 89 | * 纬度。-90.0到+90.0,+表示北纬。lbs_nm,lbs_x,lbs_y通常一起使用,来明确标识一个地址。 90 | */ 91 | @property (nonatomic, retain) TCOptionalStr paramLbs_y; 92 | 93 | /** 94 | * 第三方应用的平台类型。 95 | * \note 1表示QQ空间; 2表示腾讯朋友; 3表示腾讯微博平台; 4表示腾讯Q+平台。 96 | */ 97 | @property (nonatomic, retain) TCOptionalStr paramThirdSource; 98 | @end 99 | 100 | 101 | #pragma mark - 102 | #pragma mark TCAddOneBlogDic 103 | /** 104 | * \brief 发表日志的参数字典定义 105 | * 106 | * 可以直接填写相应参数后将对象当作参数传入API中 107 | */ 108 | @interface TCAddOneBlogDic : TCAPIRequest 109 | 110 | /** 111 | * 返回一个对象用来进行API参数的填充 112 | * \note 不用释放,返回的对象是自动释放的 113 | */ 114 | + (TCAddOneBlogDic *) dictionary; 115 | 116 | /** 117 | * 日志标题(纯文本,最大长度128个字节,utf-8编码)。 118 | */ 119 | @property (nonatomic, retain) TCRequiredStr paramTitle; 120 | 121 | /** 122 | * content 文章内容(html数据,最大长度100*1024个字节,utf-8编码) 123 | */ 124 | @property (nonatomic, retain) TCRequiredStr paramContent; 125 | @end 126 | 127 | #pragma mark - 128 | #pragma mark TCAddAlbumDic 129 | /** 130 | * \brief 创建空间相册的参数字典定义 131 | * 132 | * 可以直接填写相应参数后将对象当作参数传入API中 133 | */ 134 | @interface TCAddAlbumDic : TCAPIRequest 135 | 136 | /** 137 | * 返回一个对象用来进行API参数的填充 138 | * 139 | * \note 不用释放,返回的对象是自动释放的 140 | */ 141 | + (TCAddAlbumDic *) dictionary; 142 | 143 | /** 144 | * albumname 必须 string 相册名 不能超过30个字符。 145 | */ 146 | @property (nonatomic, retain) TCRequiredStr paramAlbumname; 147 | 148 | 149 | /** 150 | * albumdesc string 相册描述,不能超过200个字符。 151 | */ 152 | @property (nonatomic, retain) TCOptionalStr paramAlbumdesc; 153 | 154 | /** 155 | * priv string 相册权限 156 | * 157 | * \note 其取值含义为: 1=公开;3=只主人可见; 4=QQ好友可见; 5=问答加密。\n 158 | * 不传则相册默认为公开权限。\n 159 | * 如果priv取值为5,即相册是问答加密的,则必须包含问题和答案两个参数:\n 160 | * - question: 问题,不能超过30个字符。 161 | * - answer: 答案,不能超过30个字符。 162 | */ 163 | @property (nonatomic, retain) TCOptionalStr paramPriv; 164 | 165 | /** 166 | * question 问题,不能超过30个字符。 167 | * \note 如果priv取值为5,必须包含这个参数: 168 | **/ 169 | @property (nonatomic, retain) TCOptionalStr paramQuestion; 170 | 171 | /** 172 | * answer 答案,不能超过30个字符。 173 | * \note 如果priv取值为5,必须包含这个参数: 174 | **/ 175 | @property (nonatomic, retain) TCOptionalStr paramAnswer; 176 | 177 | @end 178 | 179 | #pragma mark - 180 | #pragma mark TCUploadPicDic 181 | /** 182 | * \brief 上传一张照片到QQ空间相册的参数字典定义 183 | * 184 | * 可以直接填写相应参数后将对象当作参数传入API中 185 | */ 186 | @interface TCUploadPicDic : TCAPIRequest 187 | 188 | /** 189 | * 返回一个对象用来进行API参数的填充 190 | * \note 不用释放,返回的对象是自动释放的 191 | */ 192 | + (TCUploadPicDic *) dictionary; 193 | 194 | /** 195 | * photodesc string 照片描述,注意照片描述不能超过200个字符。 196 | */ 197 | @property (nonatomic, retain) TCOptionalStr paramPhotodesc; 198 | /** 199 | * string 照片的命名,必须以.jpg, .gif, .png, .jpeg, .bmp此类后缀结尾。 200 | */ 201 | @property (nonatomic, retain) TCOptionalStr paramTitle; 202 | 203 | /** 204 | * string 相册id。可不填,不填时则根据“mobile”标识选择默认上传的相册。 205 | */ 206 | @property (nonatomic, retain) TCOptionalStr paramAlbumid; 207 | 208 | /** 209 | * 标志位 210 | * 211 | * \note 0表示PC,1表示手机。用于当不传相册id时(即albumid为空时)控制是否传到手机相册。\n 212 | * -# 如果传1,则当albumid为空时,图片会上传到手机相册; 213 | * -# 如果不传或传0,则当albumid为空时,图片会上传到贴图相册; 214 | */ 215 | @property (nonatomic, assign) TCOptionalStr paramMobile; 216 | 217 | /** 218 | * x string 照片拍摄时的地理位置的经度。请使用原始数据(纯经纬度,0-360)。 219 | */ 220 | @property (nonatomic, retain) TCOptionalStr paramX; 221 | 222 | /** 223 | * y string 照片拍摄时的地理位置的纬度。请使用原始数据(纯经纬度,0-360)。 224 | */ 225 | @property (nonatomic, retain) TCOptionalStr paramY; 226 | 227 | /** 228 | * picture 必须 string 上传照片的文件名以及图片的内容(在发送请求时,图片内容以二进制数据流的形式发送,见下面的请求示例),注意照片名称不能超过30个字符。 229 | */ 230 | @property (nonatomic, retain) TCRequiredImage paramPicture; 231 | 232 | /** 233 | * needfeed int 标识上传照片时是否要发feed 234 | * \note(0:不发feed; 1:发feed)。如果不填则默认为发feed。 235 | */ 236 | @property (nonatomic, assign)TCOptionalStr paramNeedfeed; 237 | 238 | /** 239 | * successnum int 批量上传照片时,已成功上传的张数,指明上传完成情况。 240 | * \note 单张上传时可以不填,不填则默认为0。 241 | */ 242 | @property (nonatomic, assign)TCOptionalStr paramSuccessnum; 243 | 244 | /** 245 | * picnum int 批量上传照片的总张数,如果不填则默认为1。 246 | * \note 247 | * - 如果picnum=1,为单张上传,发送单张上传feed; 248 | * - 如果picnum>1,为批量上传,发送批量上传feed。 249 | * 批量上传方式:picnum为一次上传照片的张数,successnum初始值为0,每调用一次照片上传接口后递增其值。 250 | * 信息中心中的feed表现形式:批量上传时最新的7张在feed中展示。其中最新上传的一张图片展示为大图,剩下的 251 | * 六张按从新到旧的顺序展示为小图,其他图片不在feed中展示。 252 | */ 253 | @property (nonatomic, assign)TCOptionalStr paramPicnum; 254 | 255 | @end 256 | 257 | #pragma mark - 258 | #pragma mark TCAddShareDic 259 | /** 260 | * \brief 同步分享到QQ空间,腾讯微博的参数字典定义 261 | * 262 | * 可以直接填写相应参数后将对象当作参数传入API中 263 | */ 264 | @interface TCAddShareDic : TCAPIRequest 265 | 266 | /** 267 | * 返回一个对象用来进行API参数的填充 268 | * 269 | * \note 不用释放,返回的对象是自动释放的 270 | */ 271 | + (TCAddShareDic *) dictionary; 272 | 273 | /** 274 | * title 必须 string feeds的标题 最长36个中文字,超出部分会被截断。 275 | */ 276 | @property (nonatomic, retain) TCRequiredStr paramTitle; 277 | 278 | 279 | /** 280 | * url 必须 string 分享所在网页资源的链接,点击后跳转至第三方网页,对应上文接口说明中2的超链接。请以http://开头。 281 | */ 282 | @property (nonatomic, retain) TCRequiredStr paramUrl; 283 | 284 | 285 | /** 286 | * comment string 用户评论内容,也叫发表分享时的分享理由 禁止使用系统生产的语句进行代替。 287 | * 最长40个中文字,超出部分会被截断。 288 | */ 289 | @property (nonatomic, retain) TCOptionalStr paramComment; 290 | 291 | 292 | /** 293 | * summary string 所分享的网页资源的摘要内容,或者是网页的概要描述 最长80个中文字,超出部分会被截断。 294 | */ 295 | @property (nonatomic, retain) TCOptionalStr paramSummary; 296 | 297 | /** 298 | * images string 所分享的网页资源的代表性图片链接",请以http://开头,长度限制255字符。多张图片以竖线(|)分隔,目前只有第一张图片有效,图片规格100*100为佳。 299 | */ 300 | @property (nonatomic, retain) TCOptionalStr paramImages; 301 | 302 | /** 303 | * type string 分享内容的类型。 304 | * 305 | * \note 4表示网页;5表示视频(type=5时,必须传入playurl) 306 | */ 307 | @property (nonatomic, retain) TCOptionalStr paramType; 308 | 309 | /** 310 | * playurl string 长度限制为256字节。仅在type=5的时候有效,表示视频的swf播放地址。 311 | */ 312 | @property (nonatomic, retain) TCOptionalStr paramPlayurl; 313 | 314 | /** 315 | * site 必须 string 分享的来源网站名称,请填写网站申请接入时注册的网站名称 316 | */ 317 | @property (nonatomic, retain) TCRequiredStr paramSite; 318 | 319 | /** 320 | * fromurl 必须 string 分享的来源网站对应的网站地址url 请以http://开头。 321 | */ 322 | @property (nonatomic, retain) TCRequiredStr paramFromurl; 323 | 324 | /** 325 | * nswb string 值为1时,表示分享不默认同步到微博,其他值或者不传此参数表示默认同步到微博。 326 | */ 327 | @property (nonatomic, retain) TCOptionalStr paramNswb; 328 | 329 | @end 330 | 331 | #pragma mark - 332 | #pragma mark TCCheckPageFansDic 333 | /** 334 | * \brief 验证是否认证空间粉丝tttyttyyyu的参数字典定义 335 | * 336 | * 可以直接填写相应参数后将对象当作参数传入API中 337 | */ 338 | @interface TCCheckPageFansDic : TCAPIRequest 339 | 340 | /** 341 | * 返回一个对象用来进行API参数的填充 342 | * 343 | * \note 不用释放,返回的对象是自动释放的 344 | */ 345 | + (TCCheckPageFansDic *) dictionary; 346 | 347 | /** 348 | * 表示认证空间的QQ号码 349 | */ 350 | @property (nonatomic, retain) TCRequiredStr paramPage_id; 351 | @end 352 | 353 | #pragma mark - 354 | #pragma mark TCSetUserHeadpic 355 | /** 356 | * \brief 设置用户头像 357 | * 358 | * 可以直接填写相应参数后将对象当作参数传入API中 359 | */ 360 | @interface TCSetUserHeadpic : TCAPIRequest 361 | 362 | /** 363 | * 返回一个对象用来进行API参数的填充 364 | * \note 不用释放,返回的对象是自动释放的 365 | */ 366 | + (TCSetUserHeadpic *) dictionary; 367 | 368 | /** 369 | * 设置用户头像的图片 370 | */ 371 | @property (nonatomic, retain) TCRequiredImage paramImage; 372 | 373 | /** 374 | * 图片的文件名 375 | */ 376 | @property (nonatomic, retain) TCOptionalStr paramFileName; 377 | @end 378 | 379 | #pragma mark - 380 | #pragma mark TCListPhotoDic 381 | 382 | /** 383 | * \brief 获取用户QQ空间相册中的照片列表 384 | * 385 | * 可以直接填写相应参数后将对象当作参数传入API中 386 | */ 387 | @interface TCListPhotoDic : TCAPIRequest 388 | 389 | /** 390 | * 返回一个对象用来进行API参数的填充 391 | * 392 | * \note 不用释放,返回的对象是自动释放的 393 | */ 394 | + (TCListPhotoDic *) dictionary; 395 | 396 | /** 397 | * 表示要获取的照片列表所在的相册ID 398 | */ 399 | @property (nonatomic, retain) TCRequiredStr paramAlbumid; 400 | 401 | @end 402 | 403 | #pragma mark - 404 | #pragma mark TCSendStoryDic 405 | /** 406 | * \brief QQ空间定向分享的参数字典定义 407 | * 408 | * 该分享支持@到指定好友,最多支持10个好友。 409 | * 其中第三方应用可预传最多5个指定好友的openid,其余好友由用户自行选择。 410 | * 该分享形式仅提供跳QZone分享和本地Html5分享两种形式。 411 | * sendStroy不支持userData参数 412 | */ 413 | @interface TCSendStoryDic : TCAPIRequest 414 | 415 | /** 416 | * 返回一个对象用来进行API参数的填充 417 | * 418 | * \note 不用释放,返回的对象是自动释放的 419 | */ 420 | + (TCSendStoryDic *) dictionary; 421 | 422 | /** 423 | * 分享的标题 424 | */ 425 | @property (nonatomic, retain) TCRequiredStr paramTitle; 426 | 427 | /** 428 | * 故事摘要,最多不超过50个汉字,可以为空 429 | */ 430 | @property (nonatomic, retain) TCOptionalStr paramSummary; 431 | 432 | /** 433 | * 默认展示在输入框里的分享理由,最多120个汉字,可以为空 434 | */ 435 | @property (nonatomic, retain) TCOptionalStr paramDescription; 436 | 437 | /** 438 | * 图片url 439 | */ 440 | @property (nonatomic, retain) TCOptionalStr paramPics; 441 | 442 | /** 443 | * 如果不填,则默认为"进入应用" 444 | */ 445 | @property (nonatomic, retain) TCRequiredStr paramAct; 446 | 447 | /** 448 | * 点击分享的Url 449 | */ 450 | @property (nonatomic, retain) TCOptionalStr paramShareUrl; 451 | 452 | @end 453 | -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/Tencent3.1.0/TencentOpenAPI.framework/Headers/sdkdef.h: -------------------------------------------------------------------------------- 1 | /// 2 | /// \file sdkdef.h 3 | /// \brief SDK中相关常量定义 4 | /// 5 | /// Created by Tencent on 12-12-25. 6 | /// Copyright (c) 2012年 Tencent. All rights reserved. 7 | /// 8 | 9 | #import 10 | #import 11 | 12 | /** 13 | * \brief 设置sdk的log等级 14 | */ 15 | typedef enum { 16 | TCOLogLevel_Disabled = -1, // 关闭所有log 17 | TCOLogLevel_Error = 0, 18 | TCOLogLevel_Warning, 19 | TCOLogLevel_Info, 20 | TCOLogLevel_Debug, 21 | } TCOLogLevel; 22 | 23 | /** 24 | * \brief 手机qq的当前版本 25 | */ 26 | typedef enum QQVersion 27 | { 28 | kQQUninstall, 29 | kQQVersion3_0, 30 | kQQVersion4_0, //支持sso登陆 31 | kQQVersion4_2_1, //ios7兼容 32 | kQQVersion4_5, //4.5版本,wpa会话 33 | kQQVersion4_6, //4.6版本,sso登陆信令通道切换 34 | kQQVersion4_7, //4.7版本 不确定新支持了什么样的属性 35 | } QQVersion; 36 | 37 | /** 38 | * \brief APIResponse.retCode可能的枚举常量 39 | */ 40 | typedef enum 41 | { 42 | URLREQUEST_SUCCEED = 0, /**< 网络请求成功发送至服务器,并且服务器返回数据格式正确 43 | * \note 这里包括所请求业务操作失败的情况,例如没有授权等原因导致 44 | */ 45 | 46 | URLREQUEST_FAILED = 1, /**< 网络异常,或服务器返回的数据格式不正确导致无法解析 */ 47 | } REPONSE_RESULT; 48 | 49 | /** 50 | * \brief 增量授权失败原因 51 | * 52 | * \note 增量授权失败不影响原token的有效性(原token已失效的情况除外) 53 | */ 54 | typedef enum 55 | { 56 | kUpdateFailUnknown = 1, ///< 未知原因 57 | kUpdateFailUserCancel, ///< 用户取消 58 | kUpdateFailNetwork, ///< 网络问题 59 | } UpdateFailType; 60 | 61 | /** 62 | * \brief 封装服务器返回的结果 63 | * 64 | * APIResponse用于封装所有请求的返回结果,包括错误码、错误信息、原始返回数据以及返回数据的json格式字典 65 | */ 66 | @interface APIResponse : NSObject { 67 | int _detailRetCode; 68 | int _retCode; 69 | int _seq; 70 | NSString *_errorMsg; 71 | NSDictionary *_jsonResponse; 72 | NSString *_message; 73 | id _userData; 74 | } 75 | 76 | /** 77 | * 新增的详细错误码\n 78 | * detailRetCode主要用于区分不同的错误情况,参见\ref OpenSDKError 79 | */ 80 | @property (nonatomic, assign) int detailRetCode; 81 | 82 | /** 83 | * 网络请求是否成功送达服务器,以及服务器返回的数据格式是否正确\n 84 | * retCode具体取值可参考\ref REPONSE_RESULT 85 | */ 86 | @property (nonatomic, assign) int retCode; 87 | 88 | /** 89 | * 网络请求对应的递增序列号,方便内部管理 90 | */ 91 | @property (nonatomic, assign) int seq; 92 | 93 | /** 94 | * 错误提示语 95 | */ 96 | @property (nonatomic, retain) NSString *errorMsg; 97 | 98 | /** 99 | * 服务器返回数据的json格式字典\n 100 | * 字典内具体参数的命名和含义请参考\ref api_spec 101 | */ 102 | @property (nonatomic, retain) NSDictionary *jsonResponse; 103 | 104 | /** 105 | * 服务器返回的原始数据字符串 106 | */ 107 | @property (nonatomic, retain) NSString *message; 108 | 109 | /** 110 | * 用户保留数据 111 | */ 112 | @property (nonatomic, retain) id userData; 113 | 114 | @end 115 | 116 | 117 | /** 118 | * 用户自定义的保留字段 119 | */ 120 | FOUNDATION_EXTERN NSString * const PARAM_USER_DATA; 121 | 122 | /** 123 | * \name 应用邀请参数字段定义 124 | */ 125 | ///@{ 126 | 127 | /** 应用邀请展示图片url的key */ 128 | FOUNDATION_EXTERN NSString * const PARAM_APP_ICON; 129 | 130 | /** 应用邀请描述文本的key */ 131 | FOUNDATION_EXTERN NSString * const PARAM_APP_DESC; 132 | 133 | /** 应用邀请好友列表的key */ 134 | FOUNDATION_EXTERN NSString * const PARAM_APP_INVITED_OPENIDS; 135 | 136 | ///@} 137 | 138 | /** 139 | * \name sendStory新分享参数字段定义 140 | */ 141 | ///@{ 142 | 143 | /** 预填入接受人列表的key */ 144 | FOUNDATION_EXTERN NSString * const PARAM_SENDSTORY_RECEIVER; 145 | 146 | /** 分享feeds标题的key */ 147 | FOUNDATION_EXTERN NSString * const PARAM_SENDSTORY_TITLE; 148 | 149 | /** 分享feeds评论内容的key */ 150 | FOUNDATION_EXTERN NSString * const PARAM_SENDSTORY_COMMENT; 151 | 152 | /** 分享feeds摘要的key */ 153 | FOUNDATION_EXTERN NSString * const PARAM_SENDSTORY_SUMMARY; 154 | 155 | /** 分享feeds展示图片url的key */ 156 | FOUNDATION_EXTERN NSString * const PARAM_SENDSTORY_IMAGE; 157 | 158 | /** 分享feeds跳转链接url的key */ 159 | FOUNDATION_EXTERN NSString * const PARAM_SENDSTORY_URL; 160 | 161 | /** 分享feeds点击操作默认行为的key */ 162 | FOUNDATION_EXTERN NSString * const PARAM_SENDSTORY_ACT; 163 | 164 | ///@} 165 | 166 | /** 167 | * \name 设置头像参数字段定义 168 | */ 169 | ///@{ 170 | 171 | /** 头像图片数据的key */ 172 | FOUNDATION_EXTERN NSString * const PARAM_SETUSERHEAD_PIC; 173 | 174 | /** 头像图片文件名的key */ 175 | FOUNDATION_EXTERN NSString * const PARAM_SETUSERHEAD_FILENAME; 176 | 177 | ///@} 178 | 179 | /** 180 | * \name 服务器返回数据的参数字段定义 181 | */ 182 | ///@{ 183 | 184 | /** 服务器返回码的key */ 185 | FOUNDATION_EXTERN NSString * const PARAM_RETCODE; 186 | 187 | /** 服务器返回错误信息的key */ 188 | FOUNDATION_EXTERN NSString * const PARAM_MESSAGE; 189 | 190 | /** 服务器返回额外数据的key */ 191 | FOUNDATION_EXTERN NSString * const PARAM_DATA; 192 | 193 | ///@} 194 | 195 | /** 196 | * \name 错误信息相关常量定义 197 | */ 198 | ///@{ 199 | 200 | /** 详细错误信息字典中额外信息的key */ 201 | FOUNDATION_EXTERN NSString * const TCOpenSDKErrorKeyExtraInfo; 202 | 203 | /** 详细错误信息字典中返回码的key */ 204 | FOUNDATION_EXTERN NSString * const TCOpenSDKErrorKeyRetCode; 205 | 206 | /** 详细错误信息字典中错误语句的key */ 207 | FOUNDATION_EXTERN NSString * const TCOpenSDKErrorKeyMsg; 208 | 209 | /** 不支持的接口 */ 210 | FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgUnsupportedAPI; 211 | 212 | /** 操作成功 */ 213 | FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgSuccess; 214 | 215 | /** 未知错误 */ 216 | FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgUnknown; 217 | 218 | /** 用户取消 */ 219 | FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgUserCancel; 220 | 221 | /** 请重新登录 */ 222 | FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgReLogin; 223 | 224 | /** 应用没有操作权限 */ 225 | FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgOperationDeny; 226 | 227 | /** 网络异常或没有网络 */ 228 | FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgNetwork; 229 | 230 | /** URL格式或协议错误 */ 231 | FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgURL; 232 | 233 | /** 解析数据出错 */ 234 | FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgDataParse; 235 | 236 | /** 传入参数有误 */ 237 | FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgParam; 238 | 239 | /** 连接超时 */ 240 | FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgTimeout; 241 | 242 | /** 安全问题 */ 243 | FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgSecurity; 244 | 245 | /** 文件读写错误 */ 246 | FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgIO; 247 | 248 | /** 服务器端错误 */ 249 | FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgServer; 250 | 251 | /** 页面错误 */ 252 | FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgWebPage; 253 | 254 | /** 设置头像图片过大 */ 255 | FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgUserHeadPicLarge; 256 | 257 | ///@} 258 | 259 | /** 260 | * \brief SDK新增详细错误常量 261 | */ 262 | typedef enum 263 | { 264 | kOpenSDKInvalid = -1, ///< 无效的错误码 265 | kOpenSDKErrorUnsupportedAPI = -2, ///< 不支持的接口 266 | 267 | /** 268 | * \name CommonErrorCode 269 | * 公共错误码 270 | */ 271 | ///@{ 272 | kOpenSDKErrorSuccess = 0, ///< 成功 273 | kOpenSDKErrorUnknown, ///< 未知错误 274 | kOpenSDKErrorUserCancel, ///< 用户取消 275 | kOpenSDKErrorReLogin, ///< token无效或用户未授权相应权限需要重新登录 276 | kOpenSDKErrorOperationDeny, ///< 第三方应用没有该api操作的权限 277 | ///@} 278 | 279 | /** 280 | * \name NetworkRelatedErrorCode 281 | * 网络相关错误码 282 | */ 283 | ///@{ 284 | kOpenSDKErrorNetwork, ///< 网络错误,网络不通或连接不到服务器 285 | kOpenSDKErrorURL, ///< URL格式或协议错误 286 | kOpenSDKErrorDataParse, ///< 数据解析错误,服务器返回的数据解析出错 287 | kOpenSDKErrorParam, ///< 传入参数错误 288 | kOpenSDKErrorConnTimeout, ///< http连接超时 289 | kOpenSDKErrorSecurity, ///< 安全问题 290 | kOpenSDKErrorIO, ///< 下载和文件IO错误 291 | kOpenSDKErrorServer, ///< 服务器端错误 292 | ///@} 293 | 294 | /** 295 | * \name WebViewRelatedError 296 | * webview特有错误 297 | */ 298 | ///@{ 299 | kOpenSDKErrorWebPage, ///< 页面错误 300 | ///@} 301 | 302 | /** 303 | * \name SetUserHeadRelatedErrorCode 304 | * 设置头像自定义错误码段 305 | */ 306 | ///@{ 307 | kOpenSDKErrorUserHeadPicLarge = 0x010000, ///< 图片过大 设置头像自定义错误码 308 | ///@} 309 | } OpenSDKError; 310 | 311 | /** 312 | * \name SDK版本(v1.3)支持的授权列表常量 313 | */ 314 | ///@{ 315 | 316 | /** 发表一条说说到QQ空间(需要申请权限) */ 317 | FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_ADD_TOPIC; 318 | 319 | /** 发表一篇日志到QQ空间(需要申请权限) */ 320 | FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_ADD_ONE_BLOG; 321 | 322 | /** 创建一个QQ空间相册(需要申请权限) */ 323 | FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_ADD_ALBUM; 324 | 325 | /** 上传一张照片到QQ空间相册(需要申请权限) */ 326 | FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_UPLOAD_PIC; 327 | 328 | /** 获取用户QQ空间相册列表(需要申请权限) */ 329 | FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_LIST_ALBUM; 330 | 331 | /** 同步分享到QQ空间、腾讯微博 */ 332 | FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_ADD_SHARE; 333 | 334 | /** 验证是否认证空间粉丝 */ 335 | FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_CHECK_PAGE_FANS; 336 | 337 | /** 获取登录用户自己的详细信息 */ 338 | FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_GET_INFO; 339 | 340 | /** 获取其他用户的详细信息 */ 341 | FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_GET_OTHER_INFO; 342 | 343 | /** 获取会员用户基本信息 */ 344 | FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_GET_VIP_INFO; 345 | 346 | /** 获取会员用户详细信息 */ 347 | FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_GET_VIP_RICH_INFO; 348 | 349 | /** 获取用户信息 */ 350 | FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_GET_USER_INFO; 351 | 352 | /** 移动端获取用户信息 */ 353 | FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_GET_SIMPLE_USER_INFO; 354 | ///@} 355 | 356 | 357 | /** 358 | * \name CGI接口相关参数类型定义 359 | */ 360 | ///@{ 361 | 362 | /** 必填的字符串类型参数 */ 363 | typedef NSString *TCRequiredStr; 364 | 365 | /** 必填的UIImage类型参数 */ 366 | typedef UIImage *TCRequiredImage; 367 | 368 | /** 必填的整型参数 */ 369 | typedef NSInteger TCRequiredInt; 370 | 371 | /** 必填的数字类型 */ 372 | typedef NSNumber *TCRequiredNumber; 373 | 374 | /** 必填的NSData参数 */ 375 | typedef NSData *TCRequiredData; 376 | 377 | /** 可选的字符串类型参数 */ 378 | typedef NSString *TCOptionalStr; 379 | 380 | /** 可选的UIImage类型参数 */ 381 | typedef UIImage *TCOptionalImage; 382 | 383 | /** 可选的整型参数 */ 384 | typedef NSInteger TCOptionalInt; 385 | 386 | /** 可选的数字类型 */ 387 | typedef NSNumber *TCOptionalNumber; 388 | 389 | /** 可选的不定类型参数 */ 390 | typedef id TCRequiredId; 391 | ///@} 392 | 393 | 394 | /** 395 | * \brief CGI请求的参数字典封装辅助基类 396 | * 397 | * 将相应属性的值以key-value的形式保存到参数字典中 398 | */ 399 | @interface TCAPIRequest : NSMutableDictionary 400 | 401 | /** CGI请求的URL地址 */ 402 | @property (nonatomic, readonly) NSURL *apiURL; 403 | 404 | /** CGI请求方式:"GET","POST" */ 405 | @property (nonatomic, readonly) NSString *method; 406 | 407 | /** 408 | * API参数中的保留字段,可以塞入任意字典支持的类型,再调用完成后会带回给调用方 409 | */ 410 | @property (nonatomic, retain) TCRequiredId paramUserData; 411 | 412 | /** 413 | * APIResponse,API的返回结果 414 | */ 415 | @property (nonatomic, readonly) APIResponse *response; 416 | 417 | /** 取消相应的CGI请求任务 */ 418 | - (void)cancel; 419 | 420 | @end 421 | 422 | @protocol TCAPIRequestDelegate 423 | @optional 424 | - (void)cgiRequest:(TCAPIRequest *)request didResponse:(APIResponse *)response; 425 | 426 | @end 427 | 428 | -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/Tencent3.1.0/TencentOpenAPI.framework/Resources/ios_open_sdk_3.1.0.3_iphone: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/Tencent3.1.0/TencentOpenAPI.framework/Resources/ios_open_sdk_3.1.0.3_iphone -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/Tencent3.1.0/TencentOpenAPI.framework/TencentOpenAPI: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/Tencent3.1.0/TencentOpenAPI.framework/TencentOpenAPI -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/Tencent3.1.0/TencentOpenApi_IOS_Bundle.bundle/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/Tencent3.1.0/TencentOpenApi_IOS_Bundle.bundle/error.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/Tencent3.1.0/TencentOpenApi_IOS_Bundle.bundle/local.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 社交渠道 7 | 8 | 9 | 10 | 17 | 18 | 19 |
20 |
21 |

22 | 返回 23 | 24 |
25 |
26 |
27 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/Tencent3.1.0/TencentOpenApi_IOS_Bundle.bundle/qqicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/Tencent3.1.0/TencentOpenApi_IOS_Bundle.bundle/qqicon.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/Tencent3.1.0/TencentOpenApi_IOS_Bundle.bundle/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/Tencent3.1.0/TencentOpenApi_IOS_Bundle.bundle/success.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/WeChatSDK_1.7.1/README.txt: -------------------------------------------------------------------------------- 1 | 重要! 2 | 3 | SDK1.7.1 4 | 1. 支持兼容ipv6(提升稳定性) 5 | 2. xCode Version 7.3.1 (7D1014) 编译 6 | 7 | SDK1.7 8 | 1. 支持兼容ipv6 9 | 2. 修复若干问题增强稳定性 10 | 11 | SDK1.6.3 12 | 1. xCode7.2 构建的sdk包。 13 | 2. 请使用xCode7.2进行编译。 14 | 3. 需要在Build Phases中Link Security.framework 15 | 4. 修复若干小问题。 16 | 17 | SDK1.6.2 18 | 1、xCode7.1 构建的sdk包 19 | 2、请使用xCode7.1进行编译 20 | 21 | SDK1.6.1 22 | 1、修复armv7s下,bitcode可能编译不过 23 | 2、解决warning 24 | 25 | SDK1.6 26 | 1、iOS 9系统策略更新,限制了http协议的访问,此外应用需要在“Info.plist”中将要使用的URL Schemes列为白名单,才可正常检查其他应用是否安装。 27 | 受此影响,当你的应用在iOS 9中需要使用微信SDK的相关能力(分享、收藏、支付、登录等)时,需要在“Info.plist”里增加如下代码: 28 | LSApplicationQueriesSchemes 29 | 30 | weixin 31 | 32 | NSAppTransportSecurity 33 | 34 | NSAllowsArbitraryLoads 35 | 36 | 37 | 2、开发者需要在工程中链接上 CoreTelephony.framework 38 | 3、解决bitcode编译不过问题 39 | 40 | SDK1.5 41 | 1、废弃safeSendReq:接口,使用sendReq:即可。 42 | 2、新增+(BOOL) sendAuthReq:(SendAuthReq*) req viewController : (UIViewController*) viewController delegate:(id) delegate; 43 | 支持未安装微信情况下Auth,具体见WXApi.h接口描述 44 | 3、微信开放平台新增了微信模块用户统计功能,便于开发者统计微信功能模块的用户使用和活跃情况。开发者需要在工程中链接上:SystemConfiguration.framework,libz.dylib,libsqlite3.0.dylib。 -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/WeChatSDK_1.7.1/WXApi.h: -------------------------------------------------------------------------------- 1 | // 2 | // WXApi.h 3 | // 所有Api接口 4 | // 5 | // Created by Wechat on 12-2-28. 6 | // Copyright (c) 2012年 Tencent. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "WXApiObject.h" 11 | 12 | 13 | #pragma mark - WXApiDelegate 14 | /*! @brief 接收并处理来自微信终端程序的事件消息 15 | * 16 | * 接收并处理来自微信终端程序的事件消息,期间微信界面会切换到第三方应用程序。 17 | * WXApiDelegate 会在handleOpenURL:delegate:中使用并触发。 18 | */ 19 | @protocol WXApiDelegate 20 | @optional 21 | 22 | /*! @brief 收到一个来自微信的请求,第三方应用程序处理完后调用sendResp向微信发送结果 23 | * 24 | * 收到一个来自微信的请求,异步处理完成后必须调用sendResp发送处理结果给微信。 25 | * 可能收到的请求有GetMessageFromWXReq、ShowMessageFromWXReq等。 26 | * @param req 具体请求内容,是自动释放的 27 | */ 28 | -(void) onReq:(BaseReq*)req; 29 | 30 | 31 | 32 | /*! @brief 发送一个sendReq后,收到微信的回应 33 | * 34 | * 收到一个来自微信的处理结果。调用一次sendReq后会收到onResp。 35 | * 可能收到的处理结果有SendMessageToWXResp、SendAuthResp等。 36 | * @param resp具体的回应内容,是自动释放的 37 | */ 38 | -(void) onResp:(BaseResp*)resp; 39 | 40 | @end 41 | 42 | 43 | 44 | #pragma mark - WXApi 45 | 46 | /*! @brief 微信Api接口函数类 47 | * 48 | * 该类封装了微信终端SDK的所有接口 49 | */ 50 | @interface WXApi : NSObject 51 | 52 | /*! @brief WXApi的成员函数,向微信终端程序注册第三方应用。 53 | * 54 | * 需要在每次启动第三方应用程序时调用。第一次调用后,会在微信的可用应用列表中出现。 55 | * iOS7及以上系统需要调起一次微信才会出现在微信的可用应用列表中。 56 | * @attention 请保证在主线程中调用此函数 57 | * @param appid 微信开发者ID 58 | * @param typeFlag 应用支持打开的文件类型 59 | * @return 成功返回YES,失败返回NO。 60 | */ 61 | +(BOOL) registerApp:(NSString *)appid; 62 | 63 | 64 | /*! @brief WXApi的成员函数,向微信终端程序注册第三方应用。 65 | * 66 | * 需要在每次启动第三方应用程序时调用。第一次调用后,会在微信的可用应用列表中出现。 67 | * @see registerApp 68 | * @param appid 微信开发者ID 69 | * @param appdesc 应用附加信息,长度不超过1024字节 70 | * @return 成功返回YES,失败返回NO。 71 | */ 72 | +(BOOL) registerApp:(NSString *)appid withDescription:(NSString *)appdesc; 73 | 74 | 75 | /*! @brief WXApi的成员函数,向微信终端程序注册应用支持打开的文件类型。 76 | * 77 | * 需要在每次启动第三方应用程序时调用。调用后并第一次成功分享数据到微信后,会在微信的可用应用列表中出现。 78 | * @see registerApp 79 | * @param typeFlag 应用支持打开的数据类型, enAppSupportContentFlag枚举类型 “|” 操作后结果 80 | */ 81 | +(void) registerAppSupportContentFlag:(UInt64)typeFlag; 82 | 83 | 84 | 85 | /*! @brief 处理微信通过URL启动App时传递的数据 86 | * 87 | * 需要在 application:openURL:sourceApplication:annotation:或者application:handleOpenURL中调用。 88 | * @param url 微信启动第三方应用时传递过来的URL 89 | * @param delegate WXApiDelegate对象,用来接收微信触发的消息。 90 | * @return 成功返回YES,失败返回NO。 91 | */ 92 | +(BOOL) handleOpenURL:(NSURL *) url delegate:(id) delegate; 93 | 94 | 95 | 96 | /*! @brief 检查微信是否已被用户安装 97 | * 98 | * @return 微信已安装返回YES,未安装返回NO。 99 | */ 100 | +(BOOL) isWXAppInstalled; 101 | 102 | 103 | 104 | /*! @brief 判断当前微信的版本是否支持OpenApi 105 | * 106 | * @return 支持返回YES,不支持返回NO。 107 | */ 108 | +(BOOL) isWXAppSupportApi; 109 | 110 | 111 | 112 | /*! @brief 获取微信的itunes安装地址 113 | * 114 | * @return 微信的安装地址字符串。 115 | */ 116 | +(NSString *) getWXAppInstallUrl; 117 | 118 | 119 | 120 | /*! @brief 获取当前微信SDK的版本号 121 | * 122 | * @return 返回当前微信SDK的版本号 123 | */ 124 | +(NSString *) getApiVersion; 125 | 126 | 127 | 128 | /*! @brief 打开微信 129 | * 130 | * @return 成功返回YES,失败返回NO。 131 | */ 132 | +(BOOL) openWXApp; 133 | 134 | 135 | 136 | /*! @brief 发送请求到微信,等待微信返回onResp 137 | * 138 | * 函数调用后,会切换到微信的界面。第三方应用程序等待微信返回onResp。微信在异步处理完成后一定会调用onResp。支持以下类型 139 | * SendAuthReq、SendMessageToWXReq、PayReq等。 140 | * @param req 具体的发送请求,在调用函数后,请自己释放。 141 | * @return 成功返回YES,失败返回NO。 142 | */ 143 | +(BOOL) sendReq:(BaseReq*)req; 144 | 145 | /*! @brief 发送Auth请求到微信,支持用户没安装微信,等待微信返回onResp 146 | * 147 | * 函数调用后,会切换到微信的界面。第三方应用程序等待微信返回onResp。微信在异步处理完成后一定会调用onResp。支持SendAuthReq类型。 148 | * @param req 具体的发送请求,在调用函数后,请自己释放。 149 | * @param viewController 当前界面对象。 150 | * @param delegate WXApiDelegate对象,用来接收微信触发的消息。 151 | * @return 成功返回YES,失败返回NO。 152 | */ 153 | +(BOOL) sendAuthReq:(SendAuthReq*)req viewController:(UIViewController*)viewController delegate:(id)delegate; 154 | 155 | 156 | /*! @brief 收到微信onReq的请求,发送对应的应答给微信,并切换到微信界面 157 | * 158 | * 函数调用后,会切换到微信的界面。第三方应用程序收到微信onReq的请求,异步处理该请求,完成后必须调用该函数。可能发送的相应有 159 | * GetMessageFromWXResp、ShowMessageFromWXResp等。 160 | * @param resp 具体的应答内容,调用函数后,请自己释放 161 | * @return 成功返回YES,失败返回NO。 162 | */ 163 | +(BOOL) sendResp:(BaseResp*)resp; 164 | 165 | 166 | @end 167 | -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/WeChatSDK_1.7.1/WXApiObject.h: -------------------------------------------------------------------------------- 1 | // 2 | // MMApiObject.h 3 | // Api对象,包含所有接口和对象数据定义 4 | // 5 | // Created by Wechat on 12-2-28. 6 | // Copyright (c) 2012年 Tencent. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /*! @brief 错误码 12 | * 13 | */ 14 | enum WXErrCode { 15 | WXSuccess = 0, /**< 成功 */ 16 | WXErrCodeCommon = -1, /**< 普通错误类型 */ 17 | WXErrCodeUserCancel = -2, /**< 用户点击取消并返回 */ 18 | WXErrCodeSentFail = -3, /**< 发送失败 */ 19 | WXErrCodeAuthDeny = -4, /**< 授权失败 */ 20 | WXErrCodeUnsupport = -5, /**< 微信不支持 */ 21 | }; 22 | 23 | 24 | 25 | /*! @brief 请求发送场景 26 | * 27 | */ 28 | enum WXScene { 29 | WXSceneSession = 0, /**< 聊天界面 */ 30 | WXSceneTimeline = 1, /**< 朋友圈 */ 31 | WXSceneFavorite = 2, /**< 收藏 */ 32 | }; 33 | 34 | 35 | 36 | enum WXAPISupport { 37 | WXAPISupportSession = 0, 38 | }; 39 | 40 | 41 | 42 | /*! @brief 跳转profile类型 43 | * 44 | */ 45 | enum WXBizProfileType{ 46 | WXBizProfileType_Normal = 0, //**< 普通公众号 */ 47 | WXBizProfileType_Device = 1, //**< 硬件公众号 */ 48 | }; 49 | 50 | 51 | 52 | /*! @brief 跳转mp网页类型 53 | * 54 | */ 55 | enum WXMPWebviewType { 56 | WXMPWebviewType_Ad = 0, /**< 广告网页 **/ 57 | }; 58 | 59 | 60 | /*! @brief 应用支持接收微信的文件类型 61 | * 62 | */ 63 | typedef NS_ENUM(UInt64, enAppSupportContentFlag) 64 | { 65 | MMAPP_SUPPORT_NOCONTENT = 0x0, 66 | MMAPP_SUPPORT_TEXT = 0x1, 67 | MMAPP_SUPPORT_PICTURE = 0x2, 68 | MMAPP_SUPPORT_LOCATION = 0x4, 69 | MMAPP_SUPPORT_VIDEO = 0x8, 70 | MMAPP_SUPPORT_AUDIO = 0x10, 71 | MMAPP_SUPPORT_WEBPAGE = 0x20, 72 | 73 | // Suport File Type 74 | MMAPP_SUPPORT_DOC = 0x40, // doc 75 | MMAPP_SUPPORT_DOCX = 0x80, // docx 76 | MMAPP_SUPPORT_PPT = 0x100, // ppt 77 | MMAPP_SUPPORT_PPTX = 0x200, // pptx 78 | MMAPP_SUPPORT_XLS = 0x400, // xls 79 | MMAPP_SUPPORT_XLSX = 0x800, // xlsx 80 | MMAPP_SUPPORT_PDF = 0x1000, // pdf 81 | }; 82 | 83 | #pragma mark - BaseReq 84 | /*! @brief 该类为微信终端SDK所有请求类的基类 85 | * 86 | */ 87 | @interface BaseReq : NSObject 88 | 89 | /** 请求类型 */ 90 | @property (nonatomic, assign) int type; 91 | /** 由用户微信号和AppID组成的唯一标识,发送请求时第三方程序必须填写,用于校验微信用户是否换号登录*/ 92 | @property (nonatomic, retain) NSString* openID; 93 | 94 | @end 95 | 96 | 97 | 98 | #pragma mark - BaseResp 99 | /*! @brief 该类为微信终端SDK所有响应类的基类 100 | * 101 | */ 102 | @interface BaseResp : NSObject 103 | /** 错误码 */ 104 | @property (nonatomic, assign) int errCode; 105 | /** 错误提示字符串 */ 106 | @property (nonatomic, retain) NSString *errStr; 107 | /** 响应类型 */ 108 | @property (nonatomic, assign) int type; 109 | 110 | @end 111 | 112 | 113 | 114 | #pragma mark - WXMediaMessage 115 | @class WXMediaMessage; 116 | 117 | /*! @brief 第三方向微信终端发起支付的消息结构体 118 | * 119 | * 第三方向微信终端发起支付的消息结构体,微信终端处理后会向第三方返回处理结果 120 | * @see PayResp 121 | */ 122 | @interface PayReq : BaseReq 123 | 124 | /** 商家向财付通申请的商家id */ 125 | @property (nonatomic, retain) NSString *partnerId; 126 | /** 预支付订单 */ 127 | @property (nonatomic, retain) NSString *prepayId; 128 | /** 随机串,防重发 */ 129 | @property (nonatomic, retain) NSString *nonceStr; 130 | /** 时间戳,防重发 */ 131 | @property (nonatomic, assign) UInt32 timeStamp; 132 | /** 商家根据财付通文档填写的数据和签名 */ 133 | @property (nonatomic, retain) NSString *package; 134 | /** 商家根据微信开放平台文档对数据做的签名 */ 135 | @property (nonatomic, retain) NSString *sign; 136 | 137 | @end 138 | 139 | 140 | 141 | #pragma mark - PayResp 142 | /*! @brief 微信终端返回给第三方的关于支付结果的结构体 143 | * 144 | * 微信终端返回给第三方的关于支付结果的结构体 145 | */ 146 | @interface PayResp : BaseResp 147 | 148 | /** 财付通返回给商家的信息 */ 149 | @property (nonatomic, retain) NSString *returnKey; 150 | 151 | @end 152 | 153 | 154 | 155 | /*! @brief 第三方向微信终端发起拆企业红包的消息结构体 156 | * 157 | * 第三方向微信终端发起拆企业红包的消息结构体,微信终端处理后会向第三方返回处理结果 158 | * @see HBReq 159 | */ 160 | @interface HBReq : BaseReq 161 | 162 | /** 随机串,防重发 */ 163 | @property (nonatomic, retain) NSString *nonceStr; 164 | /** 时间戳,防重发 */ 165 | @property (nonatomic, assign) UInt32 timeStamp; 166 | /** 商家根据微信企业红包开发文档填写的数据和签名 */ 167 | @property (nonatomic, retain) NSString *package; 168 | /** 商家根据微信企业红包开发文档对数据做的签名 */ 169 | @property (nonatomic, retain) NSString *sign; 170 | 171 | @end 172 | 173 | 174 | 175 | #pragma mark - HBResp 176 | /*! @brief 微信终端返回给第三方的关于拆企业红包结果的结构体 177 | * 178 | * 微信终端返回给第三方的关于拆企业红包结果的结构体 179 | */ 180 | @interface HBResp : BaseResp 181 | 182 | @end 183 | 184 | 185 | 186 | 187 | #pragma mark - SendAuthReq 188 | /*! @brief 第三方程序向微信终端请求认证的消息结构 189 | * 190 | * 第三方程序要向微信申请认证,并请求某些权限,需要调用WXApi的sendReq成员函数, 191 | * 向微信终端发送一个SendAuthReq消息结构。微信终端处理完后会向第三方程序发送一个处理结果。 192 | * @see SendAuthResp 193 | */ 194 | @interface SendAuthReq : BaseReq 195 | /** 第三方程序要向微信申请认证,并请求某些权限,需要调用WXApi的sendReq成员函数,向微信终端发送一个SendAuthReq消息结构。微信终端处理完后会向第三方程序发送一个处理结果。 196 | * @see SendAuthResp 197 | * @note scope字符串长度不能超过1K 198 | */ 199 | @property (nonatomic, retain) NSString* scope; 200 | /** 第三方程序本身用来标识其请求的唯一性,最后跳转回第三方程序时,由微信终端回传。 201 | * @note state字符串长度不能超过1K 202 | */ 203 | @property (nonatomic, retain) NSString* state; 204 | @end 205 | 206 | 207 | 208 | #pragma mark - SendAuthResp 209 | /*! @brief 微信处理完第三方程序的认证和权限申请后向第三方程序回送的处理结果。 210 | * 211 | * 第三方程序要向微信申请认证,并请求某些权限,需要调用WXApi的sendReq成员函数,向微信终端发送一个SendAuthReq消息结构。 212 | * 微信终端处理完后会向第三方程序发送一个SendAuthResp。 213 | * @see onResp 214 | */ 215 | @interface SendAuthResp : BaseResp 216 | @property (nonatomic, retain) NSString* code; 217 | /** 第三方程序发送时用来标识其请求的唯一性的标志,由第三方程序调用sendReq时传入,由微信终端回传 218 | * @note state字符串长度不能超过1K 219 | */ 220 | @property (nonatomic, retain) NSString* state; 221 | @property (nonatomic, retain) NSString* lang; 222 | @property (nonatomic, retain) NSString* country; 223 | @end 224 | 225 | 226 | 227 | #pragma mark - SendMessageToWXReq 228 | /*! @brief 第三方程序发送消息至微信终端程序的消息结构体 229 | * 230 | * 第三方程序向微信发送信息需要传入SendMessageToWXReq结构体,信息类型包括文本消息和多媒体消息, 231 | * 分别对应于text和message成员。调用该方法后,微信处理完信息会向第三方程序发送一个处理结果。 232 | * @see SendMessageToWXResp 233 | */ 234 | @interface SendMessageToWXReq : BaseReq 235 | /** 发送消息的文本内容 236 | * @note 文本长度必须大于0且小于10K 237 | */ 238 | @property (nonatomic, retain) NSString* text; 239 | /** 发送消息的多媒体内容 240 | * @see WXMediaMessage 241 | */ 242 | @property (nonatomic, retain) WXMediaMessage* message; 243 | /** 发送消息的类型,包括文本消息和多媒体消息两种,两者只能选择其一,不能同时发送文本和多媒体消息 */ 244 | @property (nonatomic, assign) BOOL bText; 245 | /** 发送的目标场景,可以选择发送到会话(WXSceneSession)或者朋友圈(WXSceneTimeline)。 默认发送到会话。 246 | * @see WXScene 247 | */ 248 | @property (nonatomic, assign) int scene; 249 | 250 | @end 251 | 252 | 253 | 254 | #pragma mark - SendMessageToWXResp 255 | /*! @brief 微信终端向第三方程序返回的SendMessageToWXReq处理结果。 256 | * 257 | * 第三方程序向微信终端发送SendMessageToWXReq后,微信发送回来的处理结果,该结果用SendMessageToWXResp表示。 258 | */ 259 | @interface SendMessageToWXResp : BaseResp 260 | @property(nonatomic, retain) NSString* lang; 261 | @property(nonatomic, retain) NSString* country; 262 | @end 263 | 264 | 265 | 266 | #pragma mark - GetMessageFromWXReq 267 | /*! @brief 微信终端向第三方程序请求提供内容的消息结构体。 268 | * 269 | * 微信终端向第三方程序请求提供内容,微信终端会向第三方程序发送GetMessageFromWXReq消息结构体, 270 | * 需要第三方程序调用sendResp返回一个GetMessageFromWXResp消息结构体。 271 | */ 272 | @interface GetMessageFromWXReq : BaseReq 273 | @property (nonatomic, retain) NSString* lang; 274 | @property (nonatomic, retain) NSString* country; 275 | @end 276 | 277 | 278 | 279 | #pragma mark - GetMessageFromWXResp 280 | /*! @brief 微信终端向第三方程序请求提供内容,第三方程序向微信终端返回的消息结构体。 281 | * 282 | * 微信终端向第三方程序请求提供内容,第三方程序调用sendResp向微信终端返回一个GetMessageFromWXResp消息结构体。 283 | */ 284 | @interface GetMessageFromWXResp : BaseResp 285 | /** 向微信终端提供的文本内容 286 | @note 文本长度必须大于0且小于10K 287 | */ 288 | @property (nonatomic, retain) NSString* text; 289 | /** 向微信终端提供的多媒体内容。 290 | * @see WXMediaMessage 291 | */ 292 | @property (nonatomic, retain) WXMediaMessage* message; 293 | /** 向微信终端提供内容的消息类型,包括文本消息和多媒体消息两种,两者只能选择其一,不能同时发送文本和多媒体消息 */ 294 | @property (nonatomic, assign) BOOL bText; 295 | @end 296 | 297 | 298 | 299 | #pragma mark - ShowMessageFromWXReq 300 | /*! @brief 微信通知第三方程序,要求第三方程序显示的消息结构体。 301 | * 302 | * 微信需要通知第三方程序显示或处理某些内容时,会向第三方程序发送ShowMessageFromWXReq消息结构体。 303 | * 第三方程序处理完内容后调用sendResp向微信终端发送ShowMessageFromWXResp。 304 | */ 305 | @interface ShowMessageFromWXReq : BaseReq 306 | /** 微信终端向第三方程序发送的要求第三方程序处理的多媒体内容 307 | * @see WXMediaMessage 308 | */ 309 | @property (nonatomic, retain) WXMediaMessage* message; 310 | @property (nonatomic, retain) NSString* lang; 311 | @property (nonatomic, retain) NSString* country; 312 | @end 313 | 314 | 315 | 316 | #pragma mark - ShowMessageFromWXResp 317 | /*! @brief 微信通知第三方程序,要求第三方程序显示或处理某些消息,第三方程序处理完后向微信终端发送的处理结果。 318 | * 319 | * 微信需要通知第三方程序显示或处理某些内容时,会向第三方程序发送ShowMessageFromWXReq消息结构体。 320 | * 第三方程序处理完内容后调用sendResp向微信终端发送ShowMessageFromWXResp。 321 | */ 322 | @interface ShowMessageFromWXResp : BaseResp 323 | @end 324 | 325 | 326 | 327 | #pragma mark - LaunchFromWXReq 328 | /*! @brief 微信终端打开第三方程序携带的消息结构体 329 | * 330 | * 微信向第三方发送的结构体,第三方不需要返回 331 | */ 332 | @interface LaunchFromWXReq : BaseReq 333 | @property (nonatomic, retain) WXMediaMessage* message; 334 | @property (nonatomic, retain) NSString* lang; 335 | @property (nonatomic, retain) NSString* country; 336 | @end 337 | 338 | #pragma mark - OpenTempSessionReq 339 | /* ! @brief 第三方通知微信,打开临时会话 340 | * 341 | * 第三方通知微信,打开临时会话 342 | */ 343 | @interface OpenTempSessionReq : BaseReq 344 | /** 需要打开的用户名 345 | * @attention 长度不能超过512字节 346 | */ 347 | @property (nonatomic, retain) NSString* username; 348 | /** 开发者自定义参数,拉起临时会话后会发给开发者后台,可以用于识别场景 349 | * @attention 长度不能超过32位 350 | */ 351 | @property (nonatomic, retain) NSString* sessionFrom; 352 | @end 353 | 354 | #pragma mark - OpenWebviewReq 355 | /* ! @brief 第三方通知微信启动内部浏览器,打开指定网页 356 | * 357 | * 第三方通知微信启动内部浏览器,打开指定Url对应的网页 358 | */ 359 | @interface OpenWebviewReq : BaseReq 360 | /** 需要打开的网页对应的Url 361 | * @attention 长度不能超过1024 362 | */ 363 | @property(nonatomic,retain)NSString* url; 364 | 365 | @end 366 | 367 | #pragma mark - OpenWebviewResp 368 | /*! @brief 微信终端向第三方程序返回的OpenWebviewReq处理结果 369 | * 370 | * 第三方程序向微信终端发送OpenWebviewReq后,微信发送回来的处理结果,该结果用OpenWebviewResp表示 371 | */ 372 | @interface OpenWebviewResp : BaseResp 373 | 374 | @end 375 | 376 | 377 | #pragma mark - OpenTempSessionResp 378 | /*! @brief 微信终端向第三方程序返回的OpenTempSessionReq处理结果。 379 | * 380 | * 第三方程序向微信终端发送OpenTempSessionReq后,微信发送回来的处理结果,该结果用OpenTempSessionResp表示。 381 | */ 382 | @interface OpenTempSessionResp : BaseResp 383 | 384 | @end 385 | 386 | #pragma mark - OpenRankListReq 387 | /* ! @brief 第三方通知微信,打开硬件排行榜 388 | * 389 | * 第三方通知微信,打开硬件排行榜 390 | */ 391 | @interface OpenRankListReq : BaseReq 392 | 393 | @end 394 | 395 | #pragma mark - OpenRanklistResp 396 | /*! @brief 微信终端向第三方程序返回的OpenRankListReq处理结果。 397 | * 398 | * 第三方程序向微信终端发送OpenRankListReq后,微信发送回来的处理结果,该结果用OpenRankListResp表示。 399 | */ 400 | @interface OpenRankListResp : BaseResp 401 | 402 | @end 403 | 404 | #pragma mark - JumpToBizProfileReq 405 | /* ! @brief 第三方通知微信,打开指定微信号profile页面 406 | * 407 | * 第三方通知微信,打开指定微信号profile页面 408 | */ 409 | @interface JumpToBizProfileReq : BaseReq 410 | /** 跳转到该公众号的profile 411 | * @attention 长度不能超过512字节 412 | */ 413 | @property (nonatomic, retain) NSString* username; 414 | /** 如果用户加了该公众号为好友,extMsg会上传到服务器 415 | * @attention 长度不能超过1024字节 416 | */ 417 | @property (nonatomic, retain) NSString* extMsg; 418 | /** 419 | * 跳转的公众号类型 420 | * @see WXBizProfileType 421 | */ 422 | @property (nonatomic, assign) int profileType; 423 | @end 424 | 425 | 426 | 427 | #pragma mark - JumpToBizWebviewReq 428 | /* ! @brief 第三方通知微信,打开指定usrname的profile网页版 429 | * 430 | */ 431 | @interface JumpToBizWebviewReq : BaseReq 432 | /** 跳转的网页类型,目前只支持广告页 433 | * @see WXMPWebviewType 434 | */ 435 | @property(nonatomic, assign) int webType; 436 | /** 跳转到该公众号的profile网页版 437 | * @attention 长度不能超过512字节 438 | */ 439 | @property(nonatomic, retain) NSString* tousrname; 440 | /** 如果用户加了该公众号为好友,extMsg会上传到服务器 441 | * @attention 长度不能超过1024字节 442 | */ 443 | @property(nonatomic, retain) NSString* extMsg; 444 | 445 | @end 446 | 447 | #pragma mark - WXCardItem 448 | 449 | @interface WXCardItem : NSObject 450 | /** 卡id 451 | * @attention 长度不能超过1024字节 452 | */ 453 | @property (nonatomic,retain) NSString* cardId; 454 | /** ext信息 455 | * @attention 长度不能超过2024字节 456 | */ 457 | @property (nonatomic,retain) NSString* extMsg; 458 | /** 459 | * @attention 卡的状态,req不需要填。resp:0为未添加,1为已添加。 460 | */ 461 | @property (nonatomic,assign) UInt32 cardState; 462 | /** 463 | * @attention req不需要填,chooseCard返回的。 464 | */ 465 | @property (nonatomic,retain) NSString* encryptCode; 466 | /** 467 | * @attention req不需要填,chooseCard返回的。 468 | */ 469 | @property (nonatomic,retain) NSString* appID; 470 | @end; 471 | 472 | #pragma mark - AddCardToWXCardPackageReq 473 | /* ! @brief 请求添加卡券至微信卡包 474 | * 475 | */ 476 | 477 | @interface AddCardToWXCardPackageReq : BaseReq 478 | /** 卡列表 479 | * @attention 个数不能超过40个 类型WXCardItem 480 | */ 481 | @property (nonatomic,retain) NSArray* cardAry; 482 | 483 | @end 484 | 485 | 486 | #pragma mark - AddCardToWXCardPackageResp 487 | /** ! @brief 微信返回第三方添加卡券结果 488 | * 489 | */ 490 | 491 | @interface AddCardToWXCardPackageResp : BaseResp 492 | /** 卡列表 493 | * @attention 个数不能超过40个 类型WXCardItem 494 | */ 495 | @property (nonatomic,retain) NSArray* cardAry; 496 | @end 497 | 498 | #pragma mark - WXChooseCardReq 499 | /* ! @brief 请求从微信选取卡券 500 | * 501 | */ 502 | 503 | @interface WXChooseCardReq : BaseReq 504 | @property(nonatomic, strong) NSString *appID; 505 | @property(nonatomic, assign) UInt32 shopID; 506 | @property(nonatomic, assign) UInt32 canMultiSelect; 507 | @property(nonatomic, strong) NSString *cardType; 508 | @property(nonatomic, strong) NSString *cardTpID; 509 | @property(nonatomic, strong) NSString *signType; 510 | @property(nonatomic, strong) NSString *cardSign; 511 | @property(nonatomic, assign) UInt32 timeStamp; 512 | @property(nonatomic, strong) NSString *nonceStr; 513 | @end 514 | 515 | 516 | #pragma mark - WXChooseCardResp 517 | /** ! @brief 微信返回第三方请求选择卡券结果 518 | * 519 | */ 520 | 521 | @interface WXChooseCardResp : BaseResp 522 | @property (nonatomic,retain) NSArray* cardAry; 523 | @end 524 | 525 | #pragma mark - WXMediaMessage 526 | 527 | /*! @brief 多媒体消息结构体 528 | * 529 | * 用于微信终端和第三方程序之间传递消息的多媒体消息内容 530 | */ 531 | @interface WXMediaMessage : NSObject 532 | 533 | +(WXMediaMessage *) message; 534 | 535 | /** 标题 536 | * @note 长度不能超过512字节 537 | */ 538 | @property (nonatomic, retain) NSString *title; 539 | /** 描述内容 540 | * @note 长度不能超过1K 541 | */ 542 | @property (nonatomic, retain) NSString *description; 543 | /** 缩略图数据 544 | * @note 大小不能超过32K 545 | */ 546 | @property (nonatomic, retain) NSData *thumbData; 547 | /** 548 | * @note 长度不能超过64字节 549 | */ 550 | @property (nonatomic, retain) NSString *mediaTagName; 551 | /** 552 | * 553 | */ 554 | @property (nonatomic, retain) NSString *messageExt; 555 | @property (nonatomic, retain) NSString *messageAction; 556 | /** 557 | * 多媒体数据对象,可以为WXImageObject,WXMusicObject,WXVideoObject,WXWebpageObject等。 558 | */ 559 | @property (nonatomic, retain) id mediaObject; 560 | 561 | /*! @brief 设置消息缩略图的方法 562 | * 563 | * @param image 缩略图 564 | * @note 大小不能超过32K 565 | */ 566 | - (void) setThumbImage:(UIImage *)image; 567 | 568 | @end 569 | 570 | 571 | 572 | #pragma mark - WXImageObject 573 | /*! @brief 多媒体消息中包含的图片数据对象 574 | * 575 | * 微信终端和第三方程序之间传递消息中包含的图片数据对象。 576 | * @note imageData成员不能为空 577 | * @see WXMediaMessage 578 | */ 579 | @interface WXImageObject : NSObject 580 | /*! @brief 返回一个WXImageObject对象 581 | * 582 | * @note 返回的WXImageObject对象是自动释放的 583 | */ 584 | +(WXImageObject *) object; 585 | 586 | /** 图片真实数据内容 587 | * @note 大小不能超过10M 588 | */ 589 | @property (nonatomic, retain) NSData *imageData; 590 | 591 | @end 592 | 593 | 594 | #pragma mark - WXMusicObject 595 | /*! @brief 多媒体消息中包含的音乐数据对象 596 | * 597 | * 微信终端和第三方程序之间传递消息中包含的音乐数据对象。 598 | * @note musicUrl和musicLowBandUrl成员不能同时为空。 599 | * @see WXMediaMessage 600 | */ 601 | @interface WXMusicObject : NSObject 602 | /*! @brief 返回一个WXMusicObject对象 603 | * 604 | * @note 返回的WXMusicObject对象是自动释放的 605 | */ 606 | +(WXMusicObject *) object; 607 | 608 | /** 音乐网页的url地址 609 | * @note 长度不能超过10K 610 | */ 611 | @property (nonatomic, retain) NSString *musicUrl; 612 | /** 音乐lowband网页的url地址 613 | * @note 长度不能超过10K 614 | */ 615 | @property (nonatomic, retain) NSString *musicLowBandUrl; 616 | /** 音乐数据url地址 617 | * @note 长度不能超过10K 618 | */ 619 | @property (nonatomic, retain) NSString *musicDataUrl; 620 | 621 | /**音乐lowband数据url地址 622 | * @note 长度不能超过10K 623 | */ 624 | @property (nonatomic, retain) NSString *musicLowBandDataUrl; 625 | 626 | @end 627 | 628 | 629 | 630 | #pragma mark - WXVideoObject 631 | /*! @brief 多媒体消息中包含的视频数据对象 632 | * 633 | * 微信终端和第三方程序之间传递消息中包含的视频数据对象。 634 | * @note videoUrl和videoLowBandUrl不能同时为空。 635 | * @see WXMediaMessage 636 | */ 637 | @interface WXVideoObject : NSObject 638 | /*! @brief 返回一个WXVideoObject对象 639 | * 640 | * @note 返回的WXVideoObject对象是自动释放的 641 | */ 642 | +(WXVideoObject *) object; 643 | 644 | /** 视频网页的url地址 645 | * @note 长度不能超过10K 646 | */ 647 | @property (nonatomic, retain) NSString *videoUrl; 648 | /** 视频lowband网页的url地址 649 | * @note 长度不能超过10K 650 | */ 651 | @property (nonatomic, retain) NSString *videoLowBandUrl; 652 | 653 | @end 654 | 655 | 656 | 657 | #pragma mark - WXWebpageObject 658 | /*! @brief 多媒体消息中包含的网页数据对象 659 | * 660 | * 微信终端和第三方程序之间传递消息中包含的网页数据对象。 661 | * @see WXMediaMessage 662 | */ 663 | @interface WXWebpageObject : NSObject 664 | /*! @brief 返回一个WXWebpageObject对象 665 | * 666 | * @note 返回的WXWebpageObject对象是自动释放的 667 | */ 668 | +(WXWebpageObject *) object; 669 | 670 | /** 网页的url地址 671 | * @note 不能为空且长度不能超过10K 672 | */ 673 | @property (nonatomic, retain) NSString *webpageUrl; 674 | 675 | @end 676 | 677 | 678 | 679 | #pragma mark - WXAppExtendObject 680 | /*! @brief 多媒体消息中包含的App扩展数据对象 681 | * 682 | * 第三方程序向微信终端发送包含WXAppExtendObject的多媒体消息, 683 | * 微信需要处理该消息时,会调用该第三方程序来处理多媒体消息内容。 684 | * @note url,extInfo和fileData不能同时为空 685 | * @see WXMediaMessage 686 | */ 687 | @interface WXAppExtendObject : NSObject 688 | /*! @brief 返回一个WXAppExtendObject对象 689 | * 690 | * @note 返回的WXAppExtendObject对象是自动释放的 691 | */ 692 | +(WXAppExtendObject *) object; 693 | 694 | /** 若第三方程序不存在,微信终端会打开该url所指的App下载地址 695 | * @note 长度不能超过10K 696 | */ 697 | @property (nonatomic, retain) NSString *url; 698 | /** 第三方程序自定义简单数据,微信终端会回传给第三方程序处理 699 | * @note 长度不能超过2K 700 | */ 701 | @property (nonatomic, retain) NSString *extInfo; 702 | /** App文件数据,该数据发送给微信好友,微信好友需要点击后下载数据,微信终端会回传给第三方程序处理 703 | * @note 大小不能超过10M 704 | */ 705 | @property (nonatomic, retain) NSData *fileData; 706 | 707 | @end 708 | 709 | 710 | 711 | #pragma mark - WXEmoticonObject 712 | /*! @brief 多媒体消息中包含的表情数据对象 713 | * 714 | * 微信终端和第三方程序之间传递消息中包含的表情数据对象。 715 | * @see WXMediaMessage 716 | */ 717 | @interface WXEmoticonObject : NSObject 718 | 719 | /*! @brief 返回一个WXEmoticonObject对象 720 | * 721 | * @note 返回的WXEmoticonObject对象是自动释放的 722 | */ 723 | +(WXEmoticonObject *) object; 724 | 725 | /** 表情真实数据内容 726 | * @note 大小不能超过10M 727 | */ 728 | @property (nonatomic, retain) NSData *emoticonData; 729 | 730 | @end 731 | 732 | 733 | 734 | #pragma mark - WXFileObject 735 | /*! @brief 多媒体消息中包含的文件数据对象 736 | * 737 | * @see WXMediaMessage 738 | */ 739 | @interface WXFileObject : NSObject 740 | 741 | /*! @brief 返回一个WXFileObject对象 742 | * 743 | * @note 返回的WXFileObject对象是自动释放的 744 | */ 745 | +(WXFileObject *) object; 746 | 747 | /** 文件后缀名 748 | * @note 长度不超过64字节 749 | */ 750 | @property (nonatomic, retain) NSString *fileExtension; 751 | 752 | /** 文件真实数据内容 753 | * @note 大小不能超过10M 754 | */ 755 | @property (nonatomic, retain) NSData *fileData; 756 | 757 | @end 758 | 759 | 760 | #pragma mark - WXLocationObject 761 | /*! @brief 多媒体消息中包含的地理位置数据对象 762 | * 763 | * 微信终端和第三方程序之间传递消息中包含的地理位置数据对象。 764 | * @see WXMediaMessage 765 | */ 766 | @interface WXLocationObject : NSObject 767 | 768 | /*! @brief 返回一个WXLocationObject对象 769 | * 770 | * @note 返回的WXLocationObject对象是自动释放的 771 | */ 772 | +(WXLocationObject *) object; 773 | 774 | /** 地理位置信息 775 | * @note 经纬度 776 | */ 777 | @property (nonatomic, assign) double lng; //经度 778 | @property (nonatomic, assign) double lat; //纬度 779 | 780 | @end 781 | 782 | 783 | #pragma mark - WXTextObject 784 | /*! @brief 多媒体消息中包含的文本数据对象 785 | * 786 | * 微信终端和第三方程序之间传递消息中包含的文本数据对象。 787 | * @see WXMediaMessage 788 | */ 789 | @interface WXTextObject : NSObject 790 | 791 | /*! @brief 返回一个WXTextObject对象 792 | * 793 | * @note 返回的WXTextObject对象是自动释放的 794 | */ 795 | +(WXTextObject *) object; 796 | 797 | /** 地理位置信息 798 | * @note 文本内容 799 | */ 800 | @property (nonatomic, retain) NSString *contentText; 801 | 802 | @end 803 | 804 | -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/WeChatSDK_1.7.1/WechatAuthSDK.h: -------------------------------------------------------------------------------- 1 | // 2 | // WechatAuthSDK.h 3 | // WechatAuthSDK 4 | // 5 | // Created by 李凯 on 13-11-29. 6 | // Copyright (c) 2013年 Tencent. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | enum AuthErrCode { 13 | WechatAuth_Err_Ok = 0, //Auth成功 14 | WechatAuth_Err_NormalErr = -1, //普通错误 15 | WechatAuth_Err_NetworkErr = -2, //网络错误 16 | WechatAuth_Err_GetQrcodeFailed = -3, //获取二维码失败 17 | WechatAuth_Err_Cancel = -4, //用户取消授权 18 | WechatAuth_Err_Timeout = -5, //超时 19 | }; 20 | 21 | @protocol WechatAuthAPIDelegate 22 | @optional 23 | 24 | - (void)onAuthGotQrcode:(UIImage *)image; //得到二维码 25 | - (void)onQrcodeScanned; //二维码被扫描 26 | - (void)onAuthFinish:(int)errCode AuthCode:(NSString *)authCode; //成功登录 27 | 28 | @end 29 | 30 | @interface WechatAuthSDK : NSObject{ 31 | NSString *_sdkVersion; 32 | __weak id _delegate; 33 | } 34 | 35 | @property(nonatomic, weak) id delegate; 36 | @property(nonatomic, readonly) NSString *sdkVersion; //authSDK版本号 37 | 38 | /*! @brief 发送登录请求,等待WechatAuthAPIDelegate回调 39 | * 40 | * @param appId 微信开发者ID 41 | * @param nonceStr 一个随机的尽量不重复的字符串,用来使得每次的signature不同 42 | * @param timeStamp 时间戳 43 | * @param scope 应用授权作用域,拥有多个作用域用逗号(,)分隔 44 | * @param signature 签名 45 | * @param schemeData 会在扫码后拼在scheme后 46 | * @return 成功返回YES,失败返回NO 47 | 注:该实现只保证同时只有一个Auth在运行,Auth未完成或未Stop再次调用Auth接口时会返回NO。 48 | */ 49 | 50 | - (BOOL)Auth:(NSString *)appId 51 | nonceStr:(NSString *)nonceStr 52 | timeStamp:(NSString*)timeStamp 53 | scope:(NSString *)scope 54 | signature:(NSString *)signature 55 | schemeData:(NSString *)schemeData; 56 | 57 | 58 | /*! @brief 暂停登录请求 59 | * 60 | * @return 成功返回YES,失败返回NO。 61 | */ 62 | - (BOOL)StopAuth; 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/WeChatSDK_1.7.1/libWeChatSDK.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/WeChatSDK_1.7.1/libWeChatSDK.a -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WBHttpRequest+WeiboGame.h: -------------------------------------------------------------------------------- 1 | // 2 | // WBHttpRequest+WeiboGame.h 3 | // WeiboSDK 4 | // 5 | // Created by insomnia on 15/3/11. 6 | // Copyright (c) 2015年 SINA iOS Team. All rights reserved. 7 | // 8 | 9 | #import "WBHttpRequest.h" 10 | 11 | @interface WBHttpRequest (WeiboGame) 12 | 13 | /*! 14 | @method 15 | 16 | @abstract 17 | 新增游戏对象。 在http://open.weibo.com/wiki/%E6%B8%B8%E6%88%8F%E6%8E%A5%E5%8F%A3 中有关于该接口的细节说明。 18 | 19 | @param userID 当前授权用户的uid 20 | 21 | @param accessToken 当前授权用户的accessToken 22 | 23 | @param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。 24 | 25 | @param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。 26 | 27 | @param handler 完成请求后会回调handler,处理完成请求后的逻辑。 28 | */ 29 | + (WBHttpRequest *)addGameObject:(NSString*)userID 30 | withAccessToken:(NSString*)accessToken 31 | andOtherProperties:(NSDictionary*)otherProperties 32 | queue:(NSOperationQueue*)queue 33 | withCompletionHandler:(WBRequestHandler)handler; 34 | 35 | /*! 36 | @method 37 | 38 | @abstract 39 | 游戏成就对象入库/更新。 在http://open.weibo.com/wiki/%E6%B8%B8%E6%88%8F%E6%8E%A5%E5%8F%A3 中有关于该接口的细节说明。 40 | 41 | @param userID 当前授权用户的uid 42 | 43 | @param accessToken 当前授权用户的accessToken 44 | 45 | @param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。 46 | 47 | @param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。 48 | 49 | @param handler 完成请求后会回调handler,处理完成请求后的逻辑。 50 | */ 51 | + (WBHttpRequest *)addGameAchievementObject:(NSString*)userID 52 | withAccessToken:(NSString*)accessToken 53 | andOtherProperties:(NSDictionary*)otherProperties 54 | queue:(NSOperationQueue*)queue 55 | withCompletionHandler:(WBRequestHandler)handler; 56 | 57 | /*! 58 | @method 59 | 60 | @abstract 61 | 用户获得游戏成就关系入库/更新。 在http://open.weibo.com/wiki/%E6%B8%B8%E6%88%8F%E6%8E%A5%E5%8F%A3 中有关于该接口的细节说明。 62 | 63 | @param userID 当前授权用户的uid 64 | 65 | @param accessToken 当前授权用户的accessToken 66 | 67 | @param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。 68 | 69 | @param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。 70 | 71 | @param handler 完成请求后会回调handler,处理完成请求后的逻辑。 72 | */ 73 | + (WBHttpRequest *)addGameAchievementGain:(NSString*)userID 74 | withAccessToken:(NSString*)accessToken 75 | andOtherProperties:(NSDictionary*)otherProperties 76 | queue:(NSOperationQueue*)queue 77 | withCompletionHandler:(WBRequestHandler)handler; 78 | 79 | /*! 80 | @method 81 | 82 | @abstract 83 | 用户游戏得分关系入库/更新。 在http://open.weibo.com/wiki/%E6%B8%B8%E6%88%8F%E6%8E%A5%E5%8F%A3 中有关于该接口的细节说明。 84 | 85 | @param userID 当前授权用户的uid 86 | 87 | @param accessToken 当前授权用户的accessToken 88 | 89 | @param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。 90 | 91 | @param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。 92 | 93 | @param handler 完成请求后会回调handler,处理完成请求后的逻辑。 94 | */ 95 | + (WBHttpRequest *)addGameScoreGain:(NSString*)userID 96 | withAccessToken:(NSString*)accessToken 97 | andOtherProperties:(NSDictionary*)otherProperties 98 | queue:(NSOperationQueue*)queue 99 | withCompletionHandler:(WBRequestHandler)handler; 100 | 101 | 102 | /*! 103 | @method 104 | 105 | @abstract 106 | 读取玩家游戏分数。 在http://open.weibo.com/wiki/%E6%B8%B8%E6%88%8F%E6%8E%A5%E5%8F%A3 中有关于该接口的细节说明。 107 | 108 | @param userID 当前授权用户的uid 109 | 110 | @param accessToken 当前授权用户的accessToken 111 | 112 | @param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。 113 | 114 | @param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。 115 | 116 | @param handler 完成请求后会回调handler,处理完成请求后的逻辑。 117 | */ 118 | + (WBHttpRequest *)requestForGameScore:(NSString*)userID 119 | withAccessToken:(NSString*)accessToken 120 | andOtherProperties:(NSDictionary*)otherProperties 121 | queue:(NSOperationQueue*)queue 122 | withCompletionHandler:(WBRequestHandler)handler; 123 | 124 | /*! 125 | @method 126 | 127 | @abstract 128 | 读取玩家互粉好友游戏分数。 在http://open.weibo.com/wiki/%E6%B8%B8%E6%88%8F%E6%8E%A5%E5%8F%A3 中有关于该接口的细节说明。 129 | 130 | @param userID 当前授权用户的uid 131 | 132 | @param accessToken 当前授权用户的accessToken 133 | 134 | @param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。 135 | 136 | @param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。 137 | 138 | @param handler 完成请求后会回调handler,处理完成请求后的逻辑。 139 | */ 140 | + (WBHttpRequest *)requestForFriendsGameScore:(NSString*)userID 141 | withAccessToken:(NSString*)accessToken 142 | andOtherProperties:(NSDictionary*)otherProperties 143 | queue:(NSOperationQueue*)queue 144 | withCompletionHandler:(WBRequestHandler)handler; 145 | 146 | /*! 147 | @method 148 | 149 | @abstract 150 | 读取玩家获取成就列表。 在http://open.weibo.com/wiki/%E6%B8%B8%E6%88%8F%E6%8E%A5%E5%8F%A3 中有关于该接口的细节说明。 151 | 152 | @param userID 当前授权用户的uid 153 | 154 | @param accessToken 当前授权用户的accessToken 155 | 156 | @param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。 157 | 158 | @param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。 159 | 160 | @param handler 完成请求后会回调handler,处理完成请求后的逻辑。 161 | */ 162 | + (WBHttpRequest *)requestForGameAchievementGain:(NSString*)userID 163 | withAccessToken:(NSString*)accessToken 164 | andOtherProperties:(NSDictionary*)otherProperties 165 | queue:(NSOperationQueue*)queue 166 | withCompletionHandler:(WBRequestHandler)handler; 167 | 168 | @end 169 | -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WBHttpRequest+WeiboShare.h: -------------------------------------------------------------------------------- 1 | // 2 | // WBHttpRequest+WeiboShare.h 3 | // WeiboSDK 4 | // 5 | // Created by DannionQiu on 14/10/31. 6 | // Copyright (c) 2014年 SINA iOS Team. All rights reserved. 7 | // 8 | 9 | #import "WBHttpRequest.h" 10 | 11 | @class WBImageObject; 12 | 13 | @interface WBHttpRequest (WeiboShare) 14 | 15 | /*! 16 | @method 17 | 18 | @abstract 19 | 获得当前授权用户的微博id列表。 20 | 21 | @param userID 当前授权用户的uid 22 | 23 | @param accessToken 当前授权用户的accessToken 24 | 25 | @param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。 26 | 27 | @param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。 28 | 29 | @param handler 完成请求后会回调handler,处理完成请求后的逻辑。 30 | */ 31 | + (WBHttpRequest *)requestForStatusIDsFromCurrentUser:(NSString*)userID 32 | withAccessToken:(NSString*)accessToken 33 | andOtherProperties:(NSDictionary*)otherProperties 34 | queue:(NSOperationQueue*)queue 35 | withCompletionHandler:(WBRequestHandler)handler; 36 | 37 | /*! 38 | @method 39 | 40 | @abstract 41 | 转发微博。转发微博id所对应的微博。 42 | 43 | @param statusID 微博id,微博的唯一标识符。 44 | 45 | @param text 添加的转发文本,内容不超过140个汉字,不填则默认为“转发微博”。 46 | 47 | @param accessToken 当前授权用户的accessToken 48 | 49 | @param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。 50 | 51 | @param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。 52 | 53 | @param handler 完成请求后会回调handler,处理完成请求后的逻辑。 54 | */ 55 | + (WBHttpRequest *)requestForRepostAStatus:(NSString*)statusID 56 | repostText:(NSString*)text 57 | withAccessToken:(NSString*)accessToken 58 | andOtherProperties:(NSDictionary*)otherProperties 59 | queue:(NSOperationQueue*)queue 60 | withCompletionHandler:(WBRequestHandler)handler; 61 | 62 | /*! 63 | @method 64 | 65 | @abstract 66 | 发表一个微博(无图或者带一张图片的微博)。 67 | 68 | @param statusText 要发布的微博文本内容,内容不超过140个汉字。 69 | 70 | @param imageObject 要上传的图片,仅支持JPEG、GIF、PNG格式,图片大小小于5M。这个参数可为nil。由于只能传一张图片,若imageObject和url都有值,请看@caution。 71 | 72 | @param url 图片的URL地址,必须以http开头。这个参数可为nil,由于只能传一张图片,若imageObject和url都有值,请看@caution。 73 | 74 | @param accessToken 当前授权用户的accessToken 75 | 76 | @param otherProperties 一个NSDictionary字典,承载任意想额外添加到请求中的参数。 77 | 78 | @param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。 79 | 80 | @param handler 完成请求后会回调handler,处理完成请求后的逻辑。 81 | 82 | @caution 注意,如果参数imageObject和url都有值,则发布带有imageObject所对应的图片,忽略url所对应的图片。 83 | */ 84 | + (WBHttpRequest *)requestForShareAStatus:(NSString*)statusText 85 | contatinsAPicture:(WBImageObject*)imageObject 86 | orPictureUrl:(NSString*)url 87 | withAccessToken:(NSString*)accessToken 88 | andOtherProperties:(NSDictionary*)otherProperties 89 | queue:(NSOperationQueue*)queue 90 | withCompletionHandler:(WBRequestHandler)handler; 91 | 92 | 93 | @end 94 | -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WBHttpRequest+WeiboToken.h: -------------------------------------------------------------------------------- 1 | // 2 | // WBHttpRequest+WeiboToken.h 3 | // WeiboSDK 4 | // 5 | // Created by DannionQiu on 14/11/6. 6 | // Copyright (c) 2014年 SINA iOS Team. All rights reserved. 7 | // 8 | 9 | #import "WBHttpRequest.h" 10 | 11 | @interface WBHttpRequest (WeiboToken) 12 | /*! 13 | @method 14 | 15 | @abstract 16 | 使用RefreshToken去换取新的身份凭证AccessToken. 17 | 18 | @discussion 19 | 在SSO授权登录后,服务器会下发有效期为7天的refreshToken以及有效期为1天的AccessToken。 20 | 当有效期为1天的AccessToken过期时,可以调用该接口带着refreshToken信息区换取新的AccessToken。 21 | @param refreshToken refreshToken 22 | 23 | @param queue 指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。 24 | 25 | @param handler 完成请求后会回调handler,处理完成请求后的逻辑。 26 | */ 27 | + (WBHttpRequest *)requestForRenewAccessTokenWithRefreshToken:(NSString*)refreshToken 28 | queue:(NSOperationQueue*)queue 29 | withCompletionHandler:(WBRequestHandler)handler; 30 | @end 31 | -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WBHttpRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // WBHttpRequest.h 3 | // WeiboSDK 4 | // 5 | // Created by DannionQiu on 14-9-18. 6 | // Copyright (c) 2014年 SINA iOS Team. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | #pragma mark - WBHttpRequest and WBHttpRequestDelegate 13 | @class WBHttpRequest; 14 | 15 | /** 16 | 接收并处理来自微博sdk对于网络请求接口的调用响应 以及openAPI 17 | 如inviteFriend、logOutWithToken的请求 18 | */ 19 | @protocol WBHttpRequestDelegate 20 | 21 | /** 22 | 收到一个来自微博Http请求的响应 23 | 24 | @param response 具体的响应对象 25 | */ 26 | @optional 27 | - (void)request:(WBHttpRequest *)request didReceiveResponse:(NSURLResponse *)response; 28 | 29 | /** 30 | 收到一个来自微博Http请求失败的响应 31 | 32 | @param error 错误信息 33 | */ 34 | @optional 35 | - (void)request:(WBHttpRequest *)request didFailWithError:(NSError *)error; 36 | 37 | /** 38 | 收到一个来自微博Http请求的网络返回 39 | 40 | @param result 请求返回结果 41 | */ 42 | @optional 43 | - (void)request:(WBHttpRequest *)request didFinishLoadingWithResult:(NSString *)result; 44 | 45 | /** 46 | 收到一个来自微博Http请求的网络返回 47 | 48 | @param data 请求返回结果 49 | */ 50 | @optional 51 | - (void)request:(WBHttpRequest *)request didFinishLoadingWithDataResult:(NSData *)data; 52 | 53 | /** 54 | 收到快速SSO授权的重定向 55 | 56 | @param URI 57 | */ 58 | @optional 59 | - (void)request:(WBHttpRequest *)request didReciveRedirectResponseWithURI:(NSURL *)redirectUrl; 60 | 61 | @end 62 | 63 | 64 | /** 65 | 微博封装Http请求的消息结构 66 | 67 | */ 68 | @interface WBHttpRequest : NSObject 69 | { 70 | NSURLConnection *connection; 71 | NSMutableData *responseData; 72 | } 73 | 74 | /** 75 | 用户自定义请求地址URL 76 | */ 77 | @property (nonatomic, strong) NSString *url; 78 | 79 | /** 80 | 用户自定义请求方式 81 | 82 | 支持"GET" "POST" 83 | */ 84 | @property (nonatomic, strong) NSString *httpMethod; 85 | 86 | /** 87 | 用户自定义请求参数字典 88 | */ 89 | @property (nonatomic, strong) NSDictionary *params; 90 | 91 | /** 92 | WBHttpRequestDelegate对象,用于接收微博SDK对于发起的接口请求的请求的响应 93 | */ 94 | @property (nonatomic, weak) id delegate; 95 | 96 | /** 97 | 用户自定义TAG 98 | 99 | 用于区分回调Request 100 | */ 101 | @property (nonatomic, strong) NSString* tag; 102 | 103 | /** 104 | 统一HTTP请求接口 105 | 调用此接口后,将发送一个HTTP网络请求 106 | @param url 请求url地址 107 | @param httpMethod 支持"GET" "POST" 108 | @param params 向接口传递的参数结构 109 | @param delegate WBHttpRequestDelegate对象,用于接收微博SDK对于发起的接口请求的请求的响应 110 | @param tag 用户自定义TAG,将通过回调WBHttpRequest实例的tag属性返回 111 | */ 112 | + (WBHttpRequest *)requestWithURL:(NSString *)url 113 | httpMethod:(NSString *)httpMethod 114 | params:(NSDictionary *)params 115 | delegate:(id)delegate 116 | withTag:(NSString *)tag; 117 | 118 | /** 119 | 统一微博Open API HTTP请求接口 120 | 调用此接口后,将发送一个HTTP网络请求(用于访问微博open api) 121 | @param accessToken 应用获取到的accessToken,用于身份验证 122 | @param url 请求url地址 123 | @param httpMethod 支持"GET" "POST" 124 | @param params 向接口传递的参数结构 125 | @param delegate WBHttpRequestDelegate对象,用于接收微博SDK对于发起的接口请求的请求的响应 126 | @param tag 用户自定义TAG,将通过回调WBHttpRequest实例的tag属性返回 127 | */ 128 | + (WBHttpRequest *)requestWithAccessToken:(NSString *)accessToken 129 | url:(NSString *)url 130 | httpMethod:(NSString *)httpMethod 131 | params:(NSDictionary *)params 132 | delegate:(id)delegate 133 | withTag:(NSString *)tag; 134 | 135 | 136 | 137 | /** 138 | 取消网络请求接口 139 | 调用此接口后,将取消当前网络请求,建议同时[WBHttpRequest setDelegate:nil]; 140 | 注意:该方法只对使用delegate的request方法有效。无法取消任何使用block的request的网络请求接口。 141 | */ 142 | - (void)disconnect; 143 | 144 | #pragma mark - block extension 145 | 146 | typedef void (^WBRequestHandler)(WBHttpRequest *httpRequest, 147 | id result, 148 | NSError *error); 149 | 150 | /** 151 | 统一微博Open API HTTP请求接口 152 | 调用此接口后,将发送一个HTTP网络请求(用于访问微博open api) 153 | @param url 请求url地址 154 | @param httpMethod 支持"GET" "POST" 155 | @param params 向接口传递的参数结构 156 | @param queue 发起请求的NSOperationQueue对象,如queue为nil,则在主线程([NSOperationQueue mainQueue])发起请求。 157 | @param handler 接口请求返回调用的block方法 158 | */ 159 | + (WBHttpRequest *)requestWithURL:(NSString *)url 160 | httpMethod:(NSString *)httpMethod 161 | params:(NSDictionary *)params 162 | queue:(NSOperationQueue*)queue 163 | withCompletionHandler:(WBRequestHandler)handler; 164 | 165 | 166 | /** 167 | 统一HTTP请求接口 168 | 调用此接口后,将发送一个HTTP网络请求 169 | @param url 请求url地址 170 | @param httpMethod 支持"GET" "POST" 171 | @param params 向接口传递的参数结构 172 | @param queue 发起请求的NSOperationQueue对象,如queue为nil,则在主线程([NSOperationQueue mainQueue])发起请求。 173 | @param handler 接口请求返回调用的block方法 174 | */ 175 | + (WBHttpRequest *)requestWithAccessToken:(NSString *)accessToken 176 | url:(NSString *)url 177 | httpMethod:(NSString *)httpMethod 178 | params:(NSDictionary *)params 179 | queue:(NSOperationQueue*)queue 180 | withCompletionHandler:(WBRequestHandler)handler; 181 | 182 | @end 183 | -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WBSDKBasicButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // WBSDKBasicButton.h 3 | // WeiboSDK 4 | // 5 | // Created by DannionQiu on 14/10/24. 6 | // Copyright (c) 2014年 SINA iOS Team. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class WBSDKBasicButton; 12 | typedef void (^WBSDKButtonHandler)(WBSDKBasicButton *button, 13 | BOOL isSuccess, 14 | NSDictionary *resultDict); 15 | 16 | @interface WBSDKBasicButton : UIButton 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WBSDKCommentButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // WBSDKCommentButton.h 3 | // WeiboSDK 4 | // 5 | // Created by DannionQiu on 14/10/26. 6 | // Copyright (c) 2014年 SINA iOS Team. All rights reserved. 7 | // 8 | 9 | #import "WBSDKBasicButton.h" 10 | 11 | @interface WBSDKCommentButton : WBSDKBasicButton 12 | 13 | /** 14 | 初始化一个社会化评论按钮 15 | @param frame 按钮的frame值 16 | @param accessToken 用户授权后获取的Token 17 | @param keyWord 社会化评论的热点词 18 | @param urlString 社会化评论链接,可传空 19 | @param category 领域ID, 此参数为必选参数。 20 | @param handler 回调函数,当用户点击按钮,进行完与社会化评论组件相关的交互之后,回调的函数。 21 | */ 22 | - (id)initWithFrame:(CGRect)frame 23 | accessToken:(NSString*)accessToken 24 | keyword:(NSString*)keyWord 25 | urlString:(NSString*)urlString 26 | category:(NSString*)category 27 | completionHandler:(WBSDKButtonHandler)handler; 28 | 29 | @property (nonatomic, strong)NSString* keyWord; 30 | @property (nonatomic, strong)NSString* accessToken; 31 | @property (nonatomic, strong)NSString* urlString; 32 | @property (nonatomic, strong)NSString* category; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WBSDKRelationshipButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // WBSDKRelationshipButton.h 3 | // WeiboSDK 4 | // 5 | // Created by DannionQiu on 14/10/26. 6 | // Copyright (c) 2014年 SINA iOS Team. All rights reserved. 7 | // 8 | 9 | #import "WBSDKBasicButton.h" 10 | 11 | enum 12 | { 13 | WBSDKRelationshipButtonStateFollow, 14 | WBSDKRelationshipButtonStateUnfollow 15 | }; 16 | typedef NSUInteger WBSDKRelationshipButtonState; 17 | 18 | 19 | 20 | @interface WBSDKRelationshipButton : WBSDKBasicButton 21 | 22 | /** 23 | 初始化一个关注组件按钮 24 | @param frame 按钮的frame值 25 | @param accessToken 用户授权后获取的Token 26 | @param currentUserID 当前用户的uid值 27 | @param followerUserID 希望当前用户加关注的用户uid值 28 | @param handler 回调函数,当用户点击按钮,进行完关注组件相关的交互之后,回调的函数。 29 | */ 30 | - (id)initWithFrame:(CGRect)frame 31 | accessToken:(NSString*)accessToken 32 | currentUser:(NSString*)currentUserID 33 | followUser:(NSString*)followerUserID 34 | completionHandler:(WBSDKButtonHandler)handler; 35 | 36 | @property (nonatomic, strong)NSString* accessToken; 37 | @property (nonatomic, strong)NSString* currentUserID; 38 | @property (nonatomic, strong)NSString* followUserID; 39 | 40 | 41 | @property (nonatomic, assign)WBSDKRelationshipButtonState currentRelationShip; 42 | 43 | 44 | /** 45 | 获取最新的关注状态 46 | 该方法会调用OpenApi,获取当前用户与目标用户之间的关注状态,并将按钮的状态改变为正确的状态。 47 | */ 48 | - (void)checkCurrentRelationship; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK+Statistics.h: -------------------------------------------------------------------------------- 1 | // 2 | // WeiboSDK+Statistics.h 3 | // WeiboSDK 4 | // 5 | // Created by DannionQiu on 15/4/13. 6 | // Copyright (c) 2015年 SINA iOS Team. All rights reserved. 7 | // 8 | 9 | #import "WeiboSDK.h" 10 | 11 | @interface WeiboSDK(Statistics) 12 | 13 | /** 设置是否开启统计模式, 默认为NO. 14 | @param value 为YES, SDK会开启统计功能,记录日志,并在合适的实际传上服务器。 15 | @return void. 16 | */ 17 | + (void)setStatisticsEnabled:(BOOL)value; 18 | 19 | #pragma mark - Optional Configs Setting 20 | /** 设置是否打印SDK的log信息, 默认NO(不打印log). 21 | @param value 设置为YES, WeiboSDK 会输出log信息可供调试参考. 除非特殊需要,否则发布产品时需改回NO. 22 | @return void. 23 | */ 24 | + (void)setStatisticsLogEnabled:(BOOL)value; 25 | 26 | /** 设置版本信息. 27 | @param version 版本号,为nil或@""时, 默认为Build号(CFBundleVersion) 28 | @return void. 29 | */ 30 | + (void)setVersion:(NSString*)version; 31 | 32 | /** 设置渠道信息. 33 | @param channelID 渠道名称, 为nil或@""时, 默认为@"AppStore"渠道 34 | @return void. 35 | */ 36 | + (void)setChannelID:(NSString*)channelID; 37 | 38 | /** 设定日志上传的发送间隔 39 | @param frequecy 单位为秒,最小30秒,最大8*60*60秒(8小时)。默认为180秒(3分钟) 40 | @return void. 41 | */ 42 | + (void)setUploadFrequecy:(NSTimeInterval)frequecy; 43 | 44 | #pragma mark - Statistics Api 45 | /** 自动页面时长统计, 开始记录某个页面展示时长. 46 | 使用方法:必须配对调用beginLogPageView:和endLogPageView:两个函数来完成自动统计,若只调用某一个函数不会生成有效数据。 47 | 在该页面展示时调用beginLogPageView:,当退出该页面时调用endLogPageView: 48 | @param pageName 统计的页面名称. 49 | @return void. 50 | */ 51 | + (void)beginLogPageView:(NSString *)pageName; 52 | 53 | /** 自动页面时长统计, 结束记录某个页面展示时长. 54 | 使用方法:必须配对调用beginLogPageView:和endLogPageView:两个函数来完成自动统计,若只调用某一个函数不会生成有效数据。 55 | 在该页面展示时调用beginLogPageView:,当退出该页面时调用endLogPageView: 56 | @param pageName 统计的页面名称. 57 | @return void. 58 | */ 59 | + (void)endLogPageView:(NSString *)pageName; 60 | 61 | 62 | /** 自动事件时长统计, 开始记录某个事示时长. 63 | 使用方法:调用event:函数来完成自动统计。 64 | @param eventID 统计的事件标识符. 65 | @warning eventID不能使用空格和特殊字符,且长度不能超过255个字符(否则将截取前255个字符) 66 | */ 67 | + (void)event:(NSString *)eventID; 68 | 69 | /** 自动事件时长统计, 开始记录某个事示时长. 70 | 使用方法:调用event:函数来完成自动统计。 71 | @param eventID 统计的事件标识符. 72 | @param pageName 事件发生时所在页面. 73 | @param userInfo 事件相关信息. 74 | @return void. 75 | 76 | @warning 每个event的userInfo不能超过10个 77 | eventID、pageName、userInfo中key和value都不能使用空格和特殊字符,且长度不能超过255个字符(否则将截取前255个字符) 78 | */ 79 | + (void)event:(NSString *)eventID onPageView:(NSString*)pageName withUserInfo:(NSDictionary*)userInfo; 80 | 81 | /** 强制日志上传 82 | 调用后,若距离上次成功上传日志时间不小于30秒,立刻上传日志。 83 | */ 84 | + (void)forceUploadRecords; 85 | 86 | 87 | 88 | 89 | @end 90 | -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/alert_error_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/alert_error_icon@2x.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/alert_success_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/alert_success_icon@2x.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/close.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/close@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/close@2x.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/common_button_big_blue@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/common_button_big_blue@2x.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/common_button_big_blue_disable@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/common_button_big_blue_disable@2x.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/common_button_big_blue_highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/common_button_big_blue_highlighted@2x.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/common_button_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/common_button_white.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/common_button_white@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/common_button_white@2x.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/common_button_white_highlighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/common_button_white_highlighted.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/common_button_white_highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/common_button_white_highlighted@2x.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/common_icon_arrow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/common_icon_arrow@2x.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/compose_keyboardbutton_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/compose_keyboardbutton_background.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/compose_keyboardbutton_background@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/compose_keyboardbutton_background@2x.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/compose_toolbar_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/compose_toolbar_background.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/compose_toolbar_background@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/compose_toolbar_background@2x.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/empty_failed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/empty_failed.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/empty_failed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/empty_failed@2x.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/login_background@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/login_background@2x.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/login_country_background@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/login_country_background@2x.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/login_country_background_highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/login_country_background_highlighted@2x.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/navigationbar_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/navigationbar_background.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/navigationbar_background@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/navigationbar_background@2x.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/navigationbar_background_os7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/navigationbar_background_os7.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/navigationbar_background_os7@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/navigationbar_background_os7@2x.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/progresshud_background@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/progresshud_background@2x.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/sdk_weibo_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/sdk_weibo_logo.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/sdk_weibo_logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/sdk_weibo_logo@2x.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/sdk_weibo_logo@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/sdk_weibo_logo@3x.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/timeline_relationship_icon_addattention.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/timeline_relationship_icon_addattention.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/timeline_relationship_icon_addattention@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/timeline_relationship_icon_addattention@2x.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/timeline_relationship_icon_addattention@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/timeline_relationship_icon_addattention@3x.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/timeline_relationship_icon_attention.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/timeline_relationship_icon_attention.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/timeline_relationship_icon_attention@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/timeline_relationship_icon_attention@2x.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/timeline_relationship_icon_attention@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/timeline_relationship_icon_attention@3x.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/verify_code_button@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/verify_code_button@2x.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/verify_code_button@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/verify_code_button@3x.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/verify_code_button_highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/verify_code_button_highlighted@2x.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/verify_code_button_highlighted@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/images/verify_code_button_highlighted@3x.png -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/others/countryList: -------------------------------------------------------------------------------- 1 | {"香港地区":{"code":"00852","rule":{"mcc":["454"]}},"台湾地区":{"code":"00886","rule":{"mcc":["466"]}},"澳门地区":{"code":"00853","rule":{"mcc":["455"]}},"日本":{"code":"0081","rule":{"mcc":["440","441"]}},"韩国":{"code":"0082","rule":{"mcc":["450"]}},"新加坡":{"code":"0065","rule":{"mcc":["525"]}},"马来西亚":{"code":"0060","rule":{"mcc":["502"]}},"美国":{"code":"001","rule":{"mcc":["310","311","316"]}},"加拿大":{"code":"001","rule":{"mcc":["302"]}},"澳大利亚":{"code":"0061","rule":{"mcc":["505"]}},"英国":{"code":"0044","rule":{"mcc":["234"]}},"法国":{"code":"0033","rule":{"mcc":["208"]}},"俄罗斯":{"code":"007","rule":{"mcc":["250"]}},"印度":{"code":"0091","rule":{"mcc":["404"]}},"泰国":{"code":"0066","rule":{"mcc":["520"]}},"德国":{"code":"0049","rule":{"mcc":["262"]}}} -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/others/mfp.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.bundle/others/mfp.cer -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboSDK.h: -------------------------------------------------------------------------------- 1 | // 2 | // WeiboSDKHeaders.h 3 | // WeiboSDKDemo 4 | // 5 | // Created by Wade Cheng on 4/3/13. 6 | // Copyright (c) 2013 SINA iOS Team. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | #import "WBHttpRequest.h" 13 | #import "WBHttpRequest+WeiboUser.h" 14 | #import "WBHttpRequest+WeiboShare.h" 15 | #import "WBHttpRequest+WeiboToken.h" 16 | #import "WBHttpRequest+WeiboGame.h" 17 | #import "WBSDKRelationshipButton.h" 18 | #import "WBSDKCommentButton.h" 19 | 20 | 21 | typedef NS_ENUM(NSInteger, WeiboSDKResponseStatusCode) 22 | { 23 | WeiboSDKResponseStatusCodeSuccess = 0,//成功 24 | WeiboSDKResponseStatusCodeUserCancel = -1,//用户取消发送 25 | WeiboSDKResponseStatusCodeSentFail = -2,//发送失败 26 | WeiboSDKResponseStatusCodeAuthDeny = -3,//授权失败 27 | WeiboSDKResponseStatusCodeUserCancelInstall = -4,//用户取消安装微博客户端 28 | WeiboSDKResponseStatusCodePayFail = -5,//支付失败 29 | WeiboSDKResponseStatusCodeShareInSDKFailed = -8,//分享失败 详情见response UserInfo 30 | WeiboSDKResponseStatusCodeUnsupport = -99,//不支持的请求 31 | WeiboSDKResponseStatusCodeUnknown = -100, 32 | }; 33 | 34 | @protocol WeiboSDKDelegate; 35 | @protocol WBHttpRequestDelegate; 36 | @class WBBaseRequest; 37 | @class WBBaseResponse; 38 | @class WBMessageObject; 39 | @class WBImageObject; 40 | @class WBBaseMediaObject; 41 | @class WBHttpRequest; 42 | @class WBOrderObject; 43 | /** 44 | 微博SDK接口类 45 | */ 46 | @interface WeiboSDK : NSObject 47 | 48 | /** 49 | 检查用户是否安装了微博客户端程序 50 | @return 已安装返回YES,未安装返回NO 51 | */ 52 | + (BOOL)isWeiboAppInstalled; 53 | 54 | /** 55 | 检查用户是否可以通过微博客户端进行分享 56 | @return 可以使用返回YES,不可以使用返回NO 57 | */ 58 | + (BOOL)isCanShareInWeiboAPP; 59 | 60 | /** 61 | 检查用户是否可以使用微博客户端进行SSO授权 62 | @return 可以使用返回YES,不可以使用返回NO 63 | */ 64 | + (BOOL)isCanSSOInWeiboApp; 65 | 66 | /** 67 | 打开微博客户端程序 68 | @return 成功打开返回YES,失败返回NO 69 | */ 70 | + (BOOL)openWeiboApp; 71 | 72 | /** 73 | 获取微博客户端程序的itunes安装地址 74 | @return 微博客户端程序的itunes安装地址 75 | */ 76 | + (NSString *)getWeiboAppInstallUrl; 77 | 78 | /** 79 | 获取当前微博客户端程序所支持的SDK最高版本 80 | @return 当前微博客户端程序所支持的SDK最高版本号,返回 nil 表示未安装微博客户端 81 | */ 82 | + (NSString *)getWeiboAppSupportMaxSDKVersion __attribute__((deprecated)); 83 | 84 | /** 85 | 获取当前微博SDK的版本号 86 | @return 当前微博SDK的版本号 87 | */ 88 | + (NSString *)getSDKVersion; 89 | 90 | 91 | extern NSString * const WeiboSDKGetAidSucessNotification; 92 | extern NSString * const WeiboSDKGetAidFailNotification; 93 | /** 94 | 获取当前微博SDK的aid 95 | 返回的aid值可能为 nil ,当值为 nil 时会尝试获取 aid 值。 96 | 当获取成功( aid 值变为有效值)时,SDK会发出名为 WeiboSDKGetAidSucessNotification 的通知,通知中带有 aid 值。 97 | 当获取失败时,SDK会发出名为 WeiboSDKGetAidFailNotification 的通知,通知中带有 NSError 对象。 98 | @return aid 用于广告的与设备信息相关的标识符 99 | */ 100 | + (NSString *)getWeiboAid; 101 | 102 | /** 103 | 向微博客户端程序注册第三方应用 104 | @param appKey 微博开放平台第三方应用appKey 105 | @return 注册成功返回YES,失败返回NO 106 | */ 107 | + (BOOL)registerApp:(NSString *)appKey; 108 | 109 | /** 110 | 处理微博客户端程序通过URL启动第三方应用时传递的数据 111 | 112 | 需要在 application:openURL:sourceApplication:annotation:或者application:handleOpenURL中调用 113 | @param url 启动第三方应用的URL 114 | @param delegate WeiboSDKDelegate对象,用于接收微博触发的消息 115 | @see WeiboSDKDelegate 116 | */ 117 | + (BOOL)handleOpenURL:(NSURL *)url delegate:(id)delegate; 118 | 119 | /** 120 | 发送请求给微博客户端程序,并切换到微博 121 | 122 | 请求发送给微博客户端程序之后,微博客户端程序会进行相关的处理,处理完成之后一定会调用 [WeiboSDKDelegate didReceiveWeiboResponse:] 方法将处理结果返回给第三方应用 123 | 124 | @param request 具体的发送请求 125 | 126 | @see [WeiboSDKDelegate didReceiveWeiboResponse:] 127 | @see WBBaseResponse 128 | */ 129 | + (BOOL)sendRequest:(WBBaseRequest *)request; 130 | 131 | /** 132 | 收到微博客户端程序的请求后,发送对应的应答给微博客户端端程序,并切换到微博 133 | 134 | 第三方应用收到微博的请求后,异步处理该请求,完成后必须调用该函数将应答返回给微博 135 | 136 | @param response 具体的应答内容 137 | @see WBBaseRequest 138 | */ 139 | + (BOOL)sendResponse:(WBBaseResponse *)response; 140 | 141 | /** 142 | 设置WeiboSDK的调试模式 143 | 144 | 当开启调试模式时,WeiboSDK会在控制台输出详细的日志信息,开发者可以据此调试自己的程序。默认为 NO 145 | @param enabled 开启或关闭WeiboSDK的调试模式 146 | */ 147 | + (void)enableDebugMode:(BOOL)enabled; 148 | 149 | /** 150 | 取消授权,登出接口 151 | 调用此接口后,token将失效 152 | @param token 第三方应用之前申请的Token 153 | @param delegate WBHttpRequestDelegate对象,用于接收微博SDK对于发起的接口请求的请求的响应 154 | @param tag 用户自定义TAG,将通过回调WBHttpRequest实例的tag属性返回 155 | 156 | */ 157 | + (void)logOutWithToken:(NSString *)token delegate:(id)delegate withTag:(NSString*)tag; 158 | 159 | /** 160 | 邀请好友使用应用 161 | 调用此接口后,将发送私信至好友,成功将返回微博标准私信结构 162 | @param data 邀请数据。必须为json字串的形式,必须做URLEncode,采用UTF-8编码。 163 | data参数支持的参数: 164 | 参数名称 值的类型 是否必填 说明描述 165 | text string true 要回复的私信文本内容。文本大小必须小于300个汉字。 166 | url string false 邀请点击后跳转链接。默认为当前应用地址。 167 | invite_logo string false 邀请Card展示时的图标地址,大小必须为80px X 80px,仅支持PNG、JPG格式。默认为当前应用logo地址。 168 | @param uid 被邀请人,需为当前用户互粉好友。 169 | @param access_token 第三方应用之前申请的Token 170 | @param delegate WBHttpRequestDelegate对象,用于接收微博SDK对于发起的接口请求的请求的响应 171 | @param tag 用户自定义TAG,将通过回调WBHttpRequest实例的tag属性返回 172 | 173 | */ 174 | + (void)inviteFriend:(NSString* )data withUid:(NSString *)uid withToken:(NSString *)access_token delegate:(id)delegate withTag:(NSString*)tag; 175 | 176 | /* 177 | 第三方调用微博短信注册或者登陆 178 | @param navTitle 为登陆页navigationBar的title,如果为空的话,默认为“验证码登陆” 179 | */ 180 | + (void)messageRegister:(NSString *)navTitle; 181 | @end 182 | 183 | /** 184 | 接收并处理来至微博客户端程序的事件消息 185 | */ 186 | @protocol WeiboSDKDelegate 187 | 188 | /** 189 | 收到一个来自微博客户端程序的请求 190 | 191 | 收到微博的请求后,第三方应用应该按照请求类型进行处理,处理完后必须通过 [WeiboSDK sendResponse:] 将结果回传给微博 192 | @param request 具体的请求对象 193 | */ 194 | - (void)didReceiveWeiboRequest:(WBBaseRequest *)request; 195 | 196 | /** 197 | 收到一个来自微博客户端程序的响应 198 | 199 | 收到微博的响应后,第三方应用可以通过响应类型、响应的数据和 WBBaseResponse.userInfo 中的数据完成自己的功能 200 | @param response 具体的响应对象 201 | */ 202 | - (void)didReceiveWeiboResponse:(WBBaseResponse *)response; 203 | 204 | @end 205 | 206 | 207 | #pragma mark - DataTransferObject and Base Request/Response 208 | 209 | /** 210 | 微博客户端程序和第三方应用之间传输数据信息的基类 211 | */ 212 | @interface WBDataTransferObject : NSObject 213 | 214 | /** 215 | 自定义信息字典,用于数据传输过程中存储相关的上下文环境数据 216 | 217 | 第三方应用给微博客户端程序发送 request 时,可以在 userInfo 中存储请求相关的信息。 218 | 219 | @warning userInfo中的数据必须是实现了 `NSCoding` 协议的对象,必须保证能序列化和反序列化 220 | @warning 序列化后的数据不能大于10M 221 | */ 222 | @property (nonatomic, strong) NSDictionary *userInfo; 223 | 224 | 225 | /** 226 | 发送该数据对象的SDK版本号 227 | 228 | 如果数据对象是自己生成的,则sdkVersion为当前SDK的版本号;如果是接收到的数据对象,则sdkVersion为数据发送方SDK版本号 229 | */ 230 | @property (strong, nonatomic, readonly) NSString *sdkVersion; 231 | 232 | 233 | /** 234 | 当用户没有安装微博客户端程序时是否提示用户打开微博安装页面 235 | 236 | 如果设置为YES,当用户未安装微博时会弹出Alert询问用户是否要打开微博App的安装页面。默认为YES 237 | */ 238 | @property (nonatomic, assign) BOOL shouldOpenWeiboAppInstallPageIfNotInstalled; 239 | 240 | 241 | @end 242 | 243 | 244 | /** 245 | 微博SDK所有请求类的基类 246 | */ 247 | @interface WBBaseRequest : WBDataTransferObject 248 | 249 | /** 250 | 返回一个 WBBaseRequest 对象 251 | 252 | @return 返回一个*自动释放的*WBBaseRequest对象 253 | */ 254 | + (id)request; 255 | 256 | @end 257 | 258 | 259 | /** 260 | 微博SDK所有响应类的基类 261 | */ 262 | @interface WBBaseResponse : WBDataTransferObject 263 | 264 | /** 265 | 对应的 request 中的自定义信息字典 266 | 267 | 如果当前 response 是由微博客户端响应给第三方应用的,则 requestUserInfo 中会包含原 request.userInfo 中的所有数据 268 | 269 | @see WBBaseRequest.userInfo 270 | */ 271 | @property (strong, nonatomic, readonly) NSDictionary *requestUserInfo; 272 | 273 | /** 274 | 响应状态码 275 | 276 | 第三方应用可以通过statusCode判断请求的处理结果 277 | */ 278 | @property (nonatomic, assign) WeiboSDKResponseStatusCode statusCode; 279 | 280 | /** 281 | 返回一个 WBBaseResponse 对象 282 | 283 | @return 返回一个*自动释放的*WBBaseResponse对象 284 | */ 285 | + (id)response; 286 | 287 | @end 288 | 289 | #pragma mark - Authorize Request/Response 290 | 291 | /** 292 | 第三方应用向微博客户端请求认证的消息结构 293 | 294 | 第三方应用向微博客户端申请认证时,需要调用 [WeiboSDK sendRequest:] 函数, 向微博客户端发送一个 WBAuthorizeRequest 的消息结构。 295 | 微博客户端处理完后会向第三方应用发送一个结构为 WBAuthorizeResponse 的处理结果。 296 | */ 297 | @interface WBAuthorizeRequest : WBBaseRequest 298 | 299 | /** 300 | 微博开放平台第三方应用授权回调页地址,默认为`http://` 301 | 302 | 参考 http://open.weibo.com/wiki/%E6%8E%88%E6%9D%83%E6%9C%BA%E5%88%B6%E8%AF%B4%E6%98%8E#.E5.AE.A2.E6.88.B7.E7.AB.AF.E9.BB.98.E8.AE.A4.E5.9B.9E.E8.B0.83.E9.A1.B5 303 | 304 | @warning 必须保证和在微博开放平台应用管理界面配置的“授权回调页”地址一致,如未进行配置则默认为`http://` 305 | @warning 不能为空,长度小于1K 306 | */ 307 | @property (nonatomic, strong) NSString *redirectURI; 308 | 309 | /** 310 | 微博开放平台第三方应用scope,多个scrope用逗号分隔 311 | 312 | 参考 http://open.weibo.com/wiki/%E6%8E%88%E6%9D%83%E6%9C%BA%E5%88%B6%E8%AF%B4%E6%98%8E#scope 313 | 314 | @warning 长度小于1K 315 | */ 316 | @property (nonatomic, strong) NSString *scope; 317 | 318 | /** 319 | 当用户没有安装微博客户端或微博客户端过低无法支持SSO的时候是否弹出SDK自带的Webview进行授权 320 | 321 | 如果设置为YES,当用户没有安装微博客户端或微博客户端过低无法支持SSO的时候会自动弹出SDK自带的Webview进行授权。 322 | 323 | 如果设置为NO,会根据 shouldOpenWeiboAppInstallPageIfNotInstalled 属性判断是否弹出安装/更新微博的对话框 324 | 325 | 默认为YES 326 | */ 327 | @property (nonatomic, assign) BOOL shouldShowWebViewForAuthIfCannotSSO; 328 | 329 | @end 330 | 331 | 332 | /** 333 | 微博客户端处理完第三方应用的认证申请后向第三方应用回送的处理结果 334 | 335 | WBAuthorizeResponse 结构中仅包含常用的 userID 、accessToken 和 expirationDate 信息,其他的认证信息(比如部分应用可以获取的 refresh_token 信息)会统一存放到 userInfo 中 336 | */ 337 | @interface WBAuthorizeResponse : WBBaseResponse 338 | 339 | /** 340 | 用户ID 341 | */ 342 | @property (nonatomic, strong) NSString *userID; 343 | 344 | /** 345 | 认证口令 346 | */ 347 | @property (nonatomic, strong) NSString *accessToken; 348 | 349 | /** 350 | 认证过期时间 351 | */ 352 | @property (nonatomic, strong) NSDate *expirationDate; 353 | 354 | /** 355 | 当认证口令过期时用于换取认证口令的更新口令 356 | */ 357 | @property (nonatomic, strong) NSString *refreshToken; 358 | 359 | @end 360 | 361 | #pragma mark - ProvideMessageForWeibo Request/Response 362 | 363 | /** 364 | 微博客户端向第三方程序请求提供内容的消息结构 365 | */ 366 | @interface WBProvideMessageForWeiboRequest : WBBaseRequest 367 | 368 | @end 369 | 370 | /** 371 | 微博客户端向第三方应用请求提供内容,第三方应用向微博客户端返回的消息结构 372 | */ 373 | @interface WBProvideMessageForWeiboResponse : WBBaseResponse 374 | 375 | /** 376 | 提供给微博客户端的消息 377 | */ 378 | @property (nonatomic, strong) WBMessageObject *message; 379 | 380 | /** 381 | 返回一个 WBProvideMessageForWeiboResponse 对象 382 | @param message 需要回送给微博客户端程序的消息对象 383 | @return 返回一个*自动释放的*WBProvideMessageForWeiboResponse对象 384 | */ 385 | + (id)responseWithMessage:(WBMessageObject *)message; 386 | 387 | @end 388 | 389 | #pragma mark - SendMessageToWeibo Request/Response 390 | 391 | /** 392 | 第三方应用发送消息至微博客户端程序的消息结构体 393 | */ 394 | @interface WBSendMessageToWeiboRequest : WBBaseRequest 395 | 396 | /** 397 | 发送给微博客户端的消息 398 | */ 399 | @property (nonatomic, strong) WBMessageObject *message; 400 | 401 | /** 402 | 返回一个 WBSendMessageToWeiboRequest 对象 403 | 此方法生成对象被[WeiboSDK sendRequest:]会唤起微博客户端的发布器进行分享,如果未安装微博客户端或客户端版本太低 404 | 会根据 shouldOpenWeiboAppInstallPageIfNotInstalled 属性判断是否弹出安装/更新微博的对话框 405 | @param message 需要发送给微博客户端的消息对象 406 | @return 返回一个*自动释放的*WBSendMessageToWeiboRequest对象 407 | */ 408 | + (id)requestWithMessage:(WBMessageObject *)message; 409 | 410 | /** 411 | 返回一个 WBSendMessageToWeiboRequest 对象 412 | 413 | 当用户安装了可以支持微博客户端內分享的微博客户端时,会自动唤起微博并分享 414 | 当用户没有安装微博客户端或微博客户端过低无法支持通过客户端內分享的时候会自动唤起SDK內微博发布器 415 | 416 | @param message 需要发送给微博的消息对象 417 | @param authRequest 授权相关信息,与access_token二者至少有一个不为空,当access_token为空并且需要弹出SDK內发布器时会通过此信息先进行授权后再分享 418 | @param access_token 第三方应用之前申请的Token,当此值不为空并且无法通过客户端分享的时候,会使用此token进行分享。 419 | @return 返回一个*自动释放的*WBSendMessageToWeiboRequest对象 420 | */ 421 | + (id)requestWithMessage:(WBMessageObject *)message 422 | authInfo:(WBAuthorizeRequest *)authRequest 423 | access_token:(NSString *)access_token; 424 | 425 | @end 426 | 427 | /** 428 | WBSendMessageToWeiboResponse 429 | */ 430 | @interface WBSendMessageToWeiboResponse : WBBaseResponse 431 | 432 | /** 433 | 可能在分享过程中用户进行了授权操作,当此值不为空时,为用户相应授权信息 434 | */ 435 | @property (nonatomic,strong) WBAuthorizeResponse *authResponse; 436 | @end 437 | 438 | #pragma mark - ShareMessageToContact Request/Response 439 | /** 440 | 第三方应用分享链接到私信 441 | */ 442 | @interface WBShareMessageToContactRequest : WBBaseRequest 443 | 444 | /** 445 | 分享链接的消息 446 | */ 447 | @property (nonatomic, strong) WBMessageObject *message; 448 | 449 | /** 450 | 返回一个 WBShareMessageToContactRequest 对象 451 | 此方法生成对象被[WeiboSDK sendRequest:]会唤起微博客户端的发布器进行分享 452 | @param message 需要发送给微博客户端的消息对象 453 | @return 返回一个*自动释放的*WBSendMessageToWeiboRequest对象 454 | */ 455 | + (id)requestWithMessage:(WBMessageObject *)message; 456 | @end 457 | 458 | /** 459 | WBSendMessageToWeiboResponse 460 | */ 461 | @interface WBShareMessageToContactResponse : WBBaseResponse 462 | 463 | /** 464 | 可能在分享过程中用户进行了授权操作,当此值不为空时,为用户相应授权信息 465 | */ 466 | @property (nonatomic,strong) WBAuthorizeResponse *authResponse; 467 | @end 468 | 469 | #pragma mark - AppRecomend Request/Response 470 | 471 | /** 472 | 第三方应用私信好友推荐app的请求 473 | */ 474 | @interface WBSDKAppRecommendRequest : WBBaseRequest 475 | /** 476 | 返回一个 WBSDKAppRecommendRequest 对象 477 | 478 | @param uids 为推荐的好友列表,为空时跳转到用户自选的页面 479 | @param access_token 第三方应用之前申请的Token,当此值不为空并且无法通过客户端分享的时候,会使用此token私信。 480 | @return 返回一个*自动释放的*WBSDKAppRecommendRequest对象 481 | */ 482 | + (id)requestWithUIDs:(NSArray *)uids access_token:(NSString *)access_token; 483 | 484 | /** 485 | 私信对象列表 486 | */ 487 | @property (nonatomic, strong) NSArray* uids; 488 | /** 489 | 用于认证的Token 490 | */ 491 | @property (nonatomic, strong) NSString *access_token; 492 | @end 493 | 494 | /** 495 | 第三方应用私信好友推荐app的响应 496 | 497 | WBSDKAppRecommendResponse 结构中仅包含常用的 userID 、accessToken 和 expirationDate 信息,其他的认证信息(比如部分应用可以获取的 refresh_token 信息)会统一存放到 userInfo 中 498 | */ 499 | @interface WBSDKAppRecommendResponse : WBBaseResponse 500 | @property (nonatomic,strong) WBAuthorizeResponse *authResponse; 501 | /** 502 | 用户ID 503 | */ 504 | @property (nonatomic, strong) NSString *userID; 505 | 506 | /** 507 | 认证口令 508 | */ 509 | @property (nonatomic, strong) NSString *accessToken; 510 | 511 | /** 512 | 认证过期时间 513 | */ 514 | @property (nonatomic, strong) NSDate *expirationDate; 515 | 516 | /** 517 | 当认证口令过期时用于换取认证口令的更新口令 518 | */ 519 | @property (nonatomic, strong) NSString *refreshToken; 520 | @end 521 | 522 | #pragma mark - Payment Request/Response 523 | 524 | /** 525 | 第三方应用发送消息至微博客户端程序的消息结构体 526 | */ 527 | @interface WBPaymentRequest : WBBaseRequest 528 | 529 | /** 530 | 发送给微博客户端的订单 531 | */ 532 | @property (nonatomic, strong) WBOrderObject *order; 533 | 534 | /** 535 | 返回一个 WBPaymentRequest 对象 536 | @param message 需要发送给微博客户端程序的消息对象 537 | @return 返回一个*自动释放的*WBSendMessageToWeiboRequest对象 538 | */ 539 | + (id)requestWithOrder:(WBOrderObject *)order; 540 | 541 | @end 542 | 543 | /** 544 | WBPaymentResponse 545 | */ 546 | @interface WBPaymentResponse : WBBaseResponse 547 | 548 | /** 549 | 支付返回状态码 550 | */ 551 | @property (nonatomic, strong) NSString *payStatusCode; 552 | 553 | /** 554 | 支付返回状态信息 555 | */ 556 | @property (nonatomic, strong) NSString *payStatusMessage; 557 | 558 | @end 559 | 560 | #pragma mark - MessageObject / ImageObject 561 | 562 | /** 563 | 微博客户端程序和第三方应用之间传递的消息结构 564 | 565 | 一个消息结构由三部分组成:文字、图片和多媒体数据。三部分内容中至少有一项不为空,图片和多媒体数据不能共存。 566 | */ 567 | @interface WBMessageObject : NSObject 568 | 569 | /** 570 | 消息的文本内容 571 | 572 | @warning 长度小于140个汉字 573 | */ 574 | @property (nonatomic, strong) NSString *text; 575 | 576 | /** 577 | 消息的图片内容 578 | 579 | @see WBImageObject 580 | */ 581 | @property (nonatomic, strong) WBImageObject *imageObject; 582 | 583 | /** 584 | 消息的多媒体内容 585 | 586 | @see WBBaseMediaObject 587 | */ 588 | @property (nonatomic, strong) WBBaseMediaObject *mediaObject; 589 | 590 | /** 591 | 返回一个 WBMessageObject 对象 592 | 593 | @return 返回一个*自动释放的*WBMessageObject对象 594 | */ 595 | + (id)message; 596 | 597 | @end 598 | 599 | /** 600 | 消息中包含的图片数据对象 601 | */ 602 | @interface WBImageObject : NSObject 603 | 604 | /** 605 | 图片真实数据内容 606 | 607 | @warning 大小不能超过10M 608 | */ 609 | @property (nonatomic, strong) NSData *imageData; 610 | 611 | /** 612 | 返回一个 WBImageObject 对象 613 | 614 | @return 返回一个*自动释放的*WBImageObject对象 615 | */ 616 | + (id)object; 617 | 618 | /** 619 | 返回一个 UIImage 对象 620 | 621 | @return 返回一个*自动释放的*UIImage对象 622 | */ 623 | - (UIImage *)image; 624 | 625 | @end 626 | 627 | #pragma mark - Message Media Objects 628 | 629 | /** 630 | 消息中包含的多媒体数据对象基类 631 | */ 632 | @interface WBBaseMediaObject : NSObject 633 | 634 | /** 635 | 对象唯一ID,用于唯一标识一个多媒体内容 636 | 637 | 当第三方应用分享多媒体内容到微博时,应该将此参数设置为被分享的内容在自己的系统中的唯一标识 638 | @warning 不能为空,长度小于255 639 | */ 640 | @property (nonatomic, strong) NSString *objectID; 641 | 642 | /** 643 | 多媒体内容标题 644 | @warning 不能为空且长度小于1k 645 | */ 646 | @property (nonatomic, strong) NSString *title; 647 | 648 | /** 649 | 多媒体内容描述 650 | @warning 长度小于1k 651 | */ 652 | @property (nonatomic, strong) NSString *description; 653 | 654 | /** 655 | 多媒体内容缩略图 656 | @warning 大小小于32k 657 | */ 658 | @property (nonatomic, strong) NSData *thumbnailData; 659 | 660 | /** 661 | 点击多媒体内容之后呼起第三方应用特定页面的scheme 662 | @warning 长度小于255 663 | */ 664 | @property (nonatomic, strong) NSString *scheme; 665 | 666 | /** 667 | 返回一个 WBBaseMediaObject 对象 668 | 669 | @return 返回一个*自动释放的*WBBaseMediaObject对象 670 | */ 671 | + (id)object; 672 | 673 | @end 674 | 675 | #pragma mark - Message Video Objects 676 | 677 | /** 678 | 消息中包含的视频数据对象 679 | */ 680 | @interface WBVideoObject : WBBaseMediaObject 681 | 682 | /** 683 | 视频网页的url 684 | 685 | @warning 不能为空且长度不能超过255 686 | */ 687 | @property (nonatomic, strong) NSString *videoUrl; 688 | 689 | /** 690 | 视频lowband网页的url 691 | 692 | @warning 长度不能超过255 693 | */ 694 | @property (nonatomic, strong) NSString *videoLowBandUrl; 695 | 696 | /** 697 | 视频数据流url 698 | 699 | @warning 长度不能超过255 700 | */ 701 | @property (nonatomic, strong) NSString *videoStreamUrl; 702 | 703 | /** 704 | 视频lowband数据流url 705 | 706 | @warning 长度不能超过255 707 | */ 708 | @property (nonatomic, strong) NSString *videoLowBandStreamUrl; 709 | 710 | @end 711 | 712 | #pragma mark - Message Music Objects 713 | 714 | /** 715 | 消息中包含的音乐数据对象 716 | */ 717 | @interface WBMusicObject : WBBaseMediaObject 718 | 719 | /** 720 | 音乐网页url地址 721 | 722 | @warning 不能为空且长度不能超过255 723 | */ 724 | @property (nonatomic, strong) NSString *musicUrl; 725 | 726 | /** 727 | 音乐lowband网页url地址 728 | 729 | @warning 长度不能超过255 730 | */ 731 | @property (nonatomic, strong) NSString *musicLowBandUrl; 732 | 733 | /** 734 | 音乐数据流url 735 | 736 | @warning 长度不能超过255 737 | */ 738 | @property (nonatomic, strong) NSString *musicStreamUrl; 739 | 740 | 741 | /** 742 | 音乐lowband数据流url 743 | 744 | @warning 长度不能超过255 745 | */ 746 | @property (nonatomic, strong) NSString *musicLowBandStreamUrl; 747 | 748 | @end 749 | 750 | #pragma mark - Message WebPage Objects 751 | 752 | /** 753 | 消息中包含的网页数据对象 754 | */ 755 | @interface WBWebpageObject : WBBaseMediaObject 756 | 757 | /** 758 | 网页的url地址 759 | 760 | @warning 不能为空且长度不能超过255 761 | */ 762 | @property (nonatomic, strong) NSString *webpageUrl; 763 | 764 | @end 765 | 766 | #pragma mark - OrderObject 767 | 768 | /** 769 | 微博客户端程序和第三方应用之间传递的订单结构 770 | */ 771 | @interface WBOrderObject : NSObject 772 | 773 | /** 774 | 订单编号 775 | */ 776 | @property (nonatomic, strong) NSString *orderString; 777 | 778 | 779 | /** 780 | 返回一个 WBOrderObject 对象 781 | 782 | @return 返回一个*自动释放的*WBOrderObject对象 783 | */ 784 | + (id)order; 785 | 786 | @end -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/WeiboUser.h: -------------------------------------------------------------------------------- 1 | // 2 | // WeiboUser.h 3 | // WeiboSDK 4 | // 5 | // Created by DannionQiu on 14-9-23. 6 | // Copyright (c) 2014年 SINA iOS Team. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /*@ 12 | You can get the latest WeiboUser field description on http://open.weibo.com/wiki/2/friendships/friends/en . 13 | */ 14 | @interface WeiboUser : NSObject 15 | 16 | - (instancetype)initWithDictionary:(NSDictionary*)paraDict; 17 | + (instancetype)userWithDictionary:(NSDictionary*)paraDict; 18 | 19 | // Validate the dictionary to be converted. 20 | + (BOOL)isValidForDictionary:(NSDictionary *)dict; 21 | 22 | - (BOOL)updateWithDictionary:(NSDictionary*)paraDict; 23 | 24 | 25 | @property(readwrite, strong, nonatomic) NSString* userID; 26 | @property(readwrite, strong, nonatomic) NSString* userClass; 27 | @property(readwrite, strong, nonatomic) NSString* screenName; 28 | @property(readwrite, strong, nonatomic) NSString* name; 29 | @property(readwrite, strong, nonatomic) NSString* province; 30 | @property(readwrite, strong, nonatomic) NSString* city; 31 | @property(readwrite, strong, nonatomic) NSString* location; 32 | @property(readwrite, strong, nonatomic) NSString* userDescription; 33 | @property(readwrite, strong, nonatomic) NSString* url; 34 | @property(readwrite, strong, nonatomic) NSString* profileImageUrl; 35 | @property(readwrite, strong, nonatomic) NSString* coverImageUrl; 36 | @property(readwrite, strong, nonatomic) NSString* coverImageForPhoneUrl; 37 | @property(readwrite, strong, nonatomic) NSString* profileUrl; 38 | @property(readwrite, strong, nonatomic) NSString* userDomain; 39 | @property(readwrite, strong, nonatomic) NSString* weihao; 40 | @property(readwrite, strong, nonatomic) NSString* gender; 41 | @property(readwrite, strong, nonatomic) NSString* followersCount; 42 | @property(readwrite, strong, nonatomic) NSString* friendsCount; 43 | @property(readwrite, strong, nonatomic) NSString* pageFriendsCount; 44 | @property(readwrite, strong, nonatomic) NSString* statusesCount; 45 | @property(readwrite, strong, nonatomic) NSString* favouritesCount; 46 | @property(readwrite, strong, nonatomic) NSString* createdTime; 47 | @property(readwrite, assign, nonatomic) BOOL isFollowingMe; 48 | @property(readwrite, assign, nonatomic) BOOL isFollowingByMe; 49 | @property(readwrite, assign, nonatomic) BOOL isAllowAllActMsg; 50 | @property(readwrite, assign, nonatomic) BOOL isAllowAllComment; 51 | @property(readwrite, assign, nonatomic) BOOL isGeoEnabled; 52 | @property(readwrite, assign, nonatomic) BOOL isVerified; 53 | @property(readwrite, strong, nonatomic) NSString* verifiedType; 54 | @property(readwrite, strong, nonatomic) NSString* remark; 55 | @property(readwrite, strong, nonatomic) NSString* statusID; 56 | @property(readwrite, strong, nonatomic) NSString* ptype; 57 | @property(readwrite, strong, nonatomic) NSString* avatarLargeUrl; 58 | @property(readwrite, strong, nonatomic) NSString* avatarHDUrl; 59 | @property(readwrite, strong, nonatomic) NSString* verifiedReason; 60 | @property(readwrite, strong, nonatomic) NSString* verifiedTrade; 61 | @property(readwrite, strong, nonatomic) NSString* verifiedReasonUrl; 62 | @property(readwrite, strong, nonatomic) NSString* verifiedSource; 63 | @property(readwrite, strong, nonatomic) NSString* verifiedSourceUrl; 64 | @property(readwrite, strong, nonatomic) NSString* verifiedState; 65 | @property(readwrite, strong, nonatomic) NSString* verifiedLevel; 66 | @property(readwrite, strong, nonatomic) NSString* onlineStatus; 67 | @property(readwrite, strong, nonatomic) NSString* biFollowersCount; 68 | @property(readwrite, strong, nonatomic) NSString* language; 69 | @property(readwrite, strong, nonatomic) NSString* star; 70 | @property(readwrite, strong, nonatomic) NSString* mbtype; 71 | @property(readwrite, strong, nonatomic) NSString* mbrank; 72 | @property(readwrite, strong, nonatomic) NSString* block_word; 73 | @property(readwrite, strong, nonatomic) NSString* block_app; 74 | @property(readwrite, strong, nonatomic) NSString* credit_score; 75 | @property(readwrite, strong, nonatomic) NSDictionary* originParaDict; 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /WTShare/WTShare/Lib/libWeiboSDK/libWeiboSDK.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderTong/WTShare/075cd0c8bc4ed4802da3142f791c8439b2624d2e/WTShare/WTShare/Lib/libWeiboSDK/libWeiboSDK.a -------------------------------------------------------------------------------- /WTShare/WTShare/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // WTShare 4 | // 5 | // Created by Mac on 16/6/30. 6 | // Copyright © 2016年 wutong. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /WTShare/WTShare/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // WTShare 4 | // 5 | // Created by Mac on 16/6/30. 6 | // Copyright © 2016年 wutong. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | #import "WTShareManager.h" 12 | #import "WTShareContentItem.h" 13 | 14 | @interface ViewController () 15 | 16 | @end 17 | 18 | @implementation ViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | // Do any additional setup after loading the view, typically from a nib. 23 | } 24 | 25 | - (void)didReceiveMemoryWarning { 26 | [super didReceiveMemoryWarning]; 27 | // Dispose of any resources that can be recreated. 28 | } 29 | - (IBAction)shareTo:(UIButton *)sender { 30 | 31 | if (sender.tag == WTShareTypeWeiBo) { 32 | 33 | [WTShareManager wt_shareWithContent:[WTShareContentItem shareWTShareContentItem] shareType:WTShareTypeWeiBo shareResult:^(NSString *shareResult) { 34 | NSLog(@"🐒🐒🐒🐒🐒🐒---%@", shareResult); 35 | }]; 36 | 37 | }else if (sender.tag == WTShareTypeQQ){ 38 | [WTShareManager wt_shareWithContent:[WTShareContentItem shareWTShareContentItem] shareType:WTShareTypeQQ shareResult:^(NSString *shareResult) { 39 | NSLog(@"🐒🐒🐒🐒🐒🐒---%@", shareResult); 40 | }]; 41 | }else if (sender.tag == WTShareTypeQQZone){ 42 | [WTShareManager wt_shareWithContent:[WTShareContentItem shareWTShareContentItem] shareType:WTShareTypeQQZone shareResult:^(NSString *shareResult) { 43 | NSLog(@"🐒🐒🐒🐒🐒🐒---%@", shareResult); 44 | }]; 45 | }else if (sender.tag == WTShareTypeWeiXinTimeline){ 46 | [WTShareManager wt_shareWithContent:[WTShareContentItem shareWTShareContentItem] shareType:WTShareTypeWeiXinTimeline shareResult:^(NSString *shareResult) { 47 | NSLog(@"🐒🐒🐒🐒🐒🐒---%@", shareResult); 48 | }]; 49 | }else if (sender.tag == WTShareTypeWeiXinSession){ 50 | [WTShareManager wt_shareWithContent:[WTShareContentItem shareWTShareContentItem] shareType:WTShareTypeWeiXinSession shareResult:^(NSString *shareResult) { 51 | NSLog(@"🐒🐒🐒🐒🐒🐒---%@", shareResult); 52 | }]; 53 | }else if (sender.tag == WTShareTypeWeiXinFavorite){ 54 | [WTShareManager wt_shareWithContent:[WTShareContentItem shareWTShareContentItem] shareType:WTShareTypeWeiXinFavorite shareResult:^(NSString *shareResult) { 55 | NSLog(@"🐒🐒🐒🐒🐒🐒---%@", shareResult); 56 | }]; 57 | } 58 | 59 | 60 | 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /WTShare/WTShare/WTShareContentItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // WTShareContentItem.h 3 | // WTShare 4 | // 5 | // Created by Mac on 16/7/1. 6 | // Copyright © 2016年 wutong. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface WTShareContentItem : NSObject 13 | @property (strong, nonatomic) UIImage *thumbImage; 14 | @property (strong, nonatomic) UIImage *bigImage; 15 | @property (strong, nonatomic) NSString *imageType; 16 | @property (strong, nonatomic) NSString *title; 17 | 18 | @property (strong, nonatomic) NSString *weixinPyqtitle; 19 | @property (strong, nonatomic) NSString *qqTitle; 20 | 21 | @property (strong, nonatomic) NSString *urlString;// 22 | @property (strong, nonatomic) NSString *urlImageString;// QQ,QQ空间分享加载图片用的 23 | @property (strong, nonatomic) NSURL *url; 24 | @property (strong, nonatomic) NSString *summary; 25 | @property (strong, nonatomic) NSString *type; 26 | 27 | @property (nonatomic, assign)BOOL isImageShareQQ; // yes 代表用图片 NO代表用URL 28 | @property (nonatomic, strong)NSString * sinaSummary; 29 | 30 | 31 | + (WTShareContentItem *)shareWTShareContentItem; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /WTShare/WTShare/WTShareContentItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // WTShareContentItem.m 3 | // WTShare 4 | // 5 | // Created by Mac on 16/7/1. 6 | // Copyright © 2016年 wutong. All rights reserved. 7 | // 8 | 9 | #import "WTShareContentItem.h" 10 | 11 | @implementation WTShareContentItem 12 | 13 | 14 | + (WTShareContentItem *)shareWTShareContentItem 15 | { 16 | WTShareContentItem * item = [[WTShareContentItem alloc]init]; 17 | item.title = @"分享测试"; 18 | item.thumbImage = [UIImage imageNamed:@"tu"]; 19 | item.bigImage = [UIImage imageNamed:@"tu"]; 20 | item.summary = @"哈哈哈哈哈哈哈哈哈2!!!"; 21 | item.urlString = @"https://www.baidu.com"; 22 | item.sinaSummary = @"一般情况新浪微博的Summary和微信,QQ的是不同的,新浪微博的是一般带链接的,而且总共字数不能超过140字"; 23 | return item; 24 | } 25 | 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /WTShare/WTShare/WTShareManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // WTShareManager.h 3 | // WTShare 4 | // 5 | // Created by Mac on 16/7/1. 6 | // Copyright © 2016年 wutong. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "WeiboSDK.h" 12 | #import "WXApi.h" 13 | #import 14 | #import 15 | #import 16 | 17 | @class WTShareContentItem; 18 | 19 | typedef NS_ENUM(NSInteger, WTShareType) { 20 | WTShareTypeWeiBo = 0, // 新浪微博 21 | WTShareTypeQQ, // QQ好友 22 | WTShareTypeQQZone, // QQ空间 23 | WTShareTypeWeiXinTimeline,// 朋友圈 24 | WTShareTypeWeiXinSession,// 微信朋友 25 | WTShareTypeWeiXinFavorite,// 微信收藏 26 | }; 27 | 28 | typedef NS_ENUM(NSInteger, WTShareWeiXinErrCode) { 29 | WTShareWeiXinErrCodeSuccess = 0, // 新浪微博 30 | WTShareWeiXinErrCodeCancel = -2, // QQ好友 31 | 32 | }; 33 | 34 | typedef void(^WTShareResultlBlock)(NSString * shareResult); 35 | 36 | @interface WTShareManager : NSObject 37 | 38 | 39 | 40 | + (instancetype)shareWTShareManager; 41 | // 判断QQ分享是否成功 42 | + (void)didReceiveTencentUrl:(NSURL *)url; 43 | + (void)wt_shareWithContent:(WTShareContentItem *)contentObj shareType:(WTShareType)shareType shareResult:(WTShareResultlBlock)shareResult; 44 | 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /WTShare/WTShare/WTShareManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // WTShareManager.m 3 | // WTShare 4 | // 5 | // Created by Mac on 16/7/1. 6 | // Copyright © 2016年 wutong. All rights reserved. 7 | // 8 | 9 | #import "WTShareManager.h" 10 | #import "WTShareContentItem.h" 11 | 12 | 13 | 14 | #define kAppKey @"2045436852" 15 | #define kRedirectURI @"http://www.sina.com" 16 | #define kWeixinAppId @"wxd930ea5d5a258f4f" 17 | #define kTencentAppId @"222222" 18 | 19 | #define kWTShareQQSuccess @"0" 20 | #define kWTShareQQFail @"-4" 21 | 22 | @interface WTShareManager () 23 | { 24 | TencentOAuth *_tencentOAuth; 25 | } 26 | @property (nonatomic, copy)WTShareResultlBlock shareResultlBlock; 27 | @end 28 | 29 | @implementation WTShareManager 30 | 31 | static WTShareManager * _instence; 32 | 33 | + (instancetype)allocWithZone:(struct _NSZone *)zone 34 | { 35 | static dispatch_once_t onceToken; 36 | dispatch_once(&onceToken, ^{ 37 | _instence = [super allocWithZone:zone]; 38 | [_instence setRegisterApps]; 39 | }); 40 | return _instence; 41 | } 42 | + (instancetype)shareWTShareManager 43 | { 44 | static dispatch_once_t onceToken; 45 | dispatch_once(&onceToken, ^{ 46 | _instence = [[self alloc]init]; 47 | [_instence setRegisterApps]; 48 | }); 49 | return _instence; 50 | } 51 | - (id)copyWithZone:(NSZone *)zone 52 | { 53 | return _instence; 54 | } 55 | 56 | 57 | // 注册appid 58 | - (void)setRegisterApps 59 | { 60 | // 注册Sina微博 61 | [WeiboSDK registerApp:kAppKey]; 62 | // 微信注册 63 | [WXApi registerApp:kWeixinAppId]; 64 | 65 | // 注册QQ 66 | _tencentOAuth = [[TencentOAuth alloc]initWithAppId:kTencentAppId andDelegate:self]; 67 | } 68 | 69 | 70 | 71 | #pragma mark - 分享方法------ 72 | + (void)wt_shareWithContent:(WTShareContentItem *)contentObj shareType:(WTShareType)shareType shareResult:(WTShareResultlBlock)shareResult 73 | { 74 | WTShareManager * shareManager = [WTShareManager shareWTShareManager]; 75 | shareManager.shareResultlBlock = shareResult; 76 | 77 | [self wt_shareWithContent:contentObj shareType:shareType]; 78 | } 79 | + (void)wt_shareWithContent:(WTShareContentItem *)contentObj shareType:(WTShareType)shareType 80 | { 81 | [WTShareManager shareWTShareManager]; 82 | 83 | switch (shareType) { 84 | case WTShareTypeWeiBo: 85 | { 86 | WBMessageObject *message = [WBMessageObject message]; 87 | message.text = contentObj.sinaSummary; 88 | 89 | if(contentObj.bigImage){ 90 | WBImageObject *webpage = [WBImageObject object]; 91 | webpage.imageData = UIImageJPEGRepresentation(contentObj.bigImage, 1.0f); 92 | 93 | message.imageObject = webpage; 94 | } 95 | 96 | WBSendMessageToWeiboRequest *request = [WBSendMessageToWeiboRequest requestWithMessage:message]; 97 | 98 | [WeiboSDK sendRequest:request]; 99 | break; 100 | } 101 | case WTShareTypeQQ: 102 | { 103 | NSString * shareTitle = [NSString string]; 104 | shareTitle = contentObj.qqTitle ? contentObj.qqTitle : contentObj.title; 105 | 106 | //分享跳转URL 107 | NSString *urlt = contentObj.urlString; 108 | QQApiNewsObject * newsObj ; 109 | 110 | if (contentObj.urlImageString) { 111 | newsObj = [QQApiNewsObject objectWithURL:[NSURL URLWithString:urlt] title:shareTitle description:contentObj.summary previewImageURL:[NSURL URLWithString:contentObj.urlImageString]]; 112 | }else if(contentObj.thumbImage){ 113 | // 如果分享的是图片的话 不能太大所以如果后台过来的的图片太大的话 可以调节如下的倍数 114 | NSData *imageData = UIImageJPEGRepresentation(contentObj.thumbImage, 1.0); 115 | newsObj = [QQApiNewsObject objectWithURL:[NSURL URLWithString:urlt] title:shareTitle description:contentObj.summary previewImageData:imageData]; 116 | } 117 | 118 | SendMessageToQQReq *req = [[SendMessageToQQReq alloc]init]; 119 | req.message = newsObj; 120 | req.type = ESENDMESSAGETOQQREQTYPE; 121 | //将内容分享到qq 122 | [QQApiInterface sendReq:req]; 123 | 124 | 125 | break; 126 | 127 | } 128 | case WTShareTypeQQZone: 129 | { 130 | //分享跳转URL 131 | NSString *urlt = contentObj.urlString; 132 | 133 | QQApiNewsObject * newsObj ; 134 | if (contentObj.urlImageString) { 135 | newsObj = [QQApiNewsObject objectWithURL:[NSURL URLWithString:urlt] title:contentObj.title description:contentObj.summary previewImageURL:[NSURL URLWithString:contentObj.urlImageString]]; 136 | }else if(contentObj.thumbImage){ 137 | 138 | NSData * imageData = UIImagePNGRepresentation(contentObj.thumbImage); 139 | 140 | newsObj = [QQApiNewsObject objectWithURL:[NSURL URLWithString:urlt] title:contentObj.title description:contentObj.summary previewImageData:imageData]; 141 | } 142 | 143 | SendMessageToQQReq *req = [[SendMessageToQQReq alloc]init]; 144 | req.message = newsObj; 145 | req.type = ESENDMESSAGETOQQREQTYPE; 146 | 147 | [QQApiInterface SendReqToQZone:req]; 148 | break; 149 | 150 | break; 151 | } 152 | case WTShareTypeWeiXinTimeline: // 微信朋友圈 153 | { 154 | WXMediaMessage * message = [WXMediaMessage message]; 155 | message.title = contentObj.weixinPyqtitle.length >0 ? contentObj.weixinPyqtitle : contentObj.title; 156 | [message setThumbImage:contentObj.thumbImage]; 157 | message.description = contentObj.summary; 158 | WXWebpageObject * ext = [WXWebpageObject object]; 159 | ext.webpageUrl = contentObj.urlString; 160 | message.mediaObject = ext; 161 | SendMessageToWXReq * req = [[SendMessageToWXReq alloc]init]; 162 | req.bText = NO; 163 | req.message = message; 164 | req.scene = WXSceneTimeline; 165 | [WXApi sendReq:req]; 166 | 167 | 168 | break; 169 | } 170 | case WTShareTypeWeiXinSession: 171 | { 172 | WXMediaMessage * message = [WXMediaMessage message]; 173 | message.title = contentObj.title; 174 | 175 | [message setThumbImage:contentObj.thumbImage]; 176 | message.description = contentObj.summary; 177 | WXWebpageObject * ext = [WXWebpageObject object]; 178 | ext.webpageUrl = contentObj.urlString; 179 | message.mediaObject = ext; 180 | 181 | SendMessageToWXReq *req = [[SendMessageToWXReq alloc]init]; 182 | req.bText = NO; 183 | req.message = message; 184 | req.scene = WXSceneSession; 185 | [WXApi sendReq:req]; 186 | 187 | break; 188 | } 189 | case WTShareTypeWeiXinFavorite: 190 | { 191 | WXMediaMessage * message = [WXMediaMessage message]; 192 | message.title = contentObj.title; 193 | 194 | [message setThumbImage:contentObj.thumbImage]; 195 | message.description = contentObj.summary; 196 | WXWebpageObject * ext = [WXWebpageObject object]; 197 | ext.webpageUrl = contentObj.urlString; 198 | message.mediaObject = ext; 199 | 200 | SendMessageToWXReq *req = [[SendMessageToWXReq alloc]init]; 201 | req.bText = NO; 202 | req.message = message; 203 | req.scene = WXSceneFavorite; 204 | [WXApi sendReq:req]; 205 | break; 206 | } 207 | 208 | default: 209 | break; 210 | } 211 | } 212 | 213 | 214 | #pragma mark - WeiboSDKDelegate 从新浪微博那边分享过来传回一些数据调用的方法 215 | /** 216 | 收到一个来自微博客户端程序的请求 217 | 218 | 收到微博的请求后,第三方应用应该按照请求类型进行处理,处理完后必须通过 [WeiboSDK sendResponse:] 将结果回传给微博 219 | @param request 具体的请求对象 220 | */ 221 | - (void)didReceiveWeiboRequest:(WBBaseRequest *)request{} 222 | /** 223 | 收到一个来自微博客户端程序的响应 224 | 225 | 收到微博的响应后,第三方应用可以通过响应类型、响应的数据和 WBBaseResponse.userInfo 中的数据完成自己的功能 226 | @param response 具体的响应对象 227 | */ 228 | - (void)didReceiveWeiboResponse:(WBBaseResponse *)response 229 | { 230 | /** 231 | 232 | WeiboSDKResponseStatusCodeSuccess = 0,//成功 233 | WeiboSDKResponseStatusCodeUserCancel = -1,//用户取消发送 234 | WeiboSDKResponseStatusCodeSentFail = -2,//发送失败 235 | WeiboSDKResponseStatusCodeAuthDeny = -3,//授权失败 236 | WeiboSDKResponseStatusCodeUserCancelInstall = -4,//用户取消安装微博客户端 237 | WeiboSDKResponseStatusCodePayFail = -5,//支付失败 238 | WeiboSDKResponseStatusCodeShareInSDKFailed = -8,//分享失败 详情见response UserInfo 239 | WeiboSDKResponseStatusCodeUnsupport = -99,//不支持的请求 240 | WeiboSDKResponseStatusCodeUnknown = -100, 241 | */ 242 | 243 | if (response.statusCode == WeiboSDKResponseStatusCodeSuccess) { 244 | //NSLog(@"微博----分享成功!!!"); 245 | self.shareResultlBlock(@"微博----分享成功!!!"); 246 | 247 | }else if(response.statusCode == WeiboSDKResponseStatusCodeUserCancel) 248 | { 249 | // NSLog(@"微博----用户取消发送"); 250 | self.shareResultlBlock(@"微博----用户取消发送"); 251 | }else if (response.statusCode == WeiboSDKResponseStatusCodeSentFail){ 252 | // NSLog(@"微博----发送失败!"); 253 | self.shareResultlBlock(@"微博----发送失败!"); 254 | } 255 | 256 | 257 | // NSLog(@"%@", response); 258 | } 259 | 260 | 261 | #pragma mark - WXApiDelegate 从微信那边分享过来传回一些数据调用的方法 262 | 263 | 264 | /*! @brief 发送一个sendReq后,收到微信的回应 265 | * 266 | * 收到一个来自微信的处理结果。调用一次sendReq后会收到onResp。 267 | * 可能收到的处理结果有SendMessageToWXResp、SendAuthResp等。 268 | * @param resp具体的回应内容,是自动释放的 269 | */ 270 | -(void) onResp:(BaseResp*)resp 271 | { 272 | 273 | // 成功回来 274 | // errCode 0 275 | // type 0 276 | 277 | // 取消分享回来 278 | // errCode -2 279 | // type 0 280 | 281 | if (resp.errCode == WTShareWeiXinErrCodeSuccess) { 282 | // NSLog(@"微信----分享成功!!"); 283 | self.shareResultlBlock(@"微信----分享成功!!"); 284 | }else{ 285 | // NSLog(@"微信----用户取消分享!!"); 286 | self.shareResultlBlock(@"微信----用户取消分享!!"); 287 | } 288 | // NSLog(@"%@", resp); 289 | 290 | } 291 | 292 | #pragma mark - 判断qq是否分享成功 293 | + (void)didReceiveTencentUrl:(NSURL *)url 294 | { 295 | NSString * urlStr = url.absoluteString; 296 | NSArray * array = [urlStr componentsSeparatedByString:@"error="]; 297 | if (array.count > 1) { 298 | NSString * lastStr = [array lastObject]; 299 | NSArray * lastStrArray = [lastStr componentsSeparatedByString:@"&"]; 300 | 301 | NSString * resultStr = [lastStrArray firstObject]; 302 | if ([resultStr isEqualToString:kWTShareQQSuccess]) { 303 | // NSLog(@"QQ------分享成功!"); 304 | [WTShareManager shareWTShareManager].shareResultlBlock(@"QQ------分享成功!"); 305 | }else if ([resultStr isEqualToString:kWTShareQQFail]){ 306 | // NSLog(@"QQ------分享失败!"); 307 | [WTShareManager shareWTShareManager].shareResultlBlock(@"QQ------分享失败!"); 308 | } 309 | 310 | } 311 | 312 | } 313 | 314 | @end 315 | -------------------------------------------------------------------------------- /WTShare/WTShare/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // WTShare 4 | // 5 | // Created by Mac on 16/6/30. 6 | // Copyright © 2016年 wutong. 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 | -------------------------------------------------------------------------------- /WTShare/WTShareTests/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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /WTShare/WTShareTests/WTShareTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // WTShareTests.m 3 | // WTShareTests 4 | // 5 | // Created by Mac on 16/7/2. 6 | // Copyright © 2016年 wutong. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface WTShareTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation WTShareTests 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 | -------------------------------------------------------------------------------- /WTShare/WTShareUITests/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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /WTShare/WTShareUITests/WTShareUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // WTShareUITests.m 3 | // WTShareUITests 4 | // 5 | // Created by Mac on 16/7/2. 6 | // Copyright © 2016年 wutong. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface WTShareUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation WTShareUITests 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 | --------------------------------------------------------------------------------