Permalink
Browse files

新版WBShareKit

新版中只有sina与qq,仅支持oauth2.0。
  • Loading branch information...
1 parent d40ffc7 commit 344a30f14f8af831d57ff8594796c4e7049dc377 @qdvictory committed Sep 13, 2012
Showing with 15,238 additions and 920 deletions.
  1. +10 −39 README.md
  2. +0 −49 WBShareKit/README.md
  3. +204 −129 WBShareKit/WBShareKit.xcodeproj/project.pbxproj
  4. BIN ...areKit.xcodeproj/project.xcworkspace/xcuserdata/Seamus.xcuserdatad/UserInterfaceState.xcuserstate
  5. +5 −0 WBShareKit/WBShareKit.xcodeproj/xcuserdata/Seamus.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
  6. BIN WBShareKit/WBShareKit/.DS_Store
  7. +28 −0 WBShareKit/WBShareKit/CHShareManager.h
  8. +208 −0 WBShareKit/WBShareKit/CHShareManager.m
  9. +470 −0 WBShareKit/WBShareKit/JSON/.svn/entries
  10. +50 −0 WBShareKit/WBShareKit/JSON/.svn/text-base/JSON.h.svn-base
  11. +68 −0 WBShareKit/WBShareKit/JSON/.svn/text-base/NSObject+SBJSON.h.svn-base
  12. +53 −0 WBShareKit/WBShareKit/JSON/.svn/text-base/NSObject+SBJSON.m.svn-base
  13. +58 −0 WBShareKit/WBShareKit/JSON/.svn/text-base/NSString+SBJSON.h.svn-base
  14. +55 −0 WBShareKit/WBShareKit/JSON/.svn/text-base/NSString+SBJSON.m.svn-base
  15. +75 −0 WBShareKit/WBShareKit/JSON/.svn/text-base/SBJSON.h.svn-base
  16. +212 −0 WBShareKit/WBShareKit/JSON/.svn/text-base/SBJSON.m.svn-base
  17. +86 −0 WBShareKit/WBShareKit/JSON/.svn/text-base/SBJsonBase.h.svn-base
  18. +78 −0 WBShareKit/WBShareKit/JSON/.svn/text-base/SBJsonBase.m.svn-base
  19. +87 −0 WBShareKit/WBShareKit/JSON/.svn/text-base/SBJsonParser.h.svn-base
  20. +475 −0 WBShareKit/WBShareKit/JSON/.svn/text-base/SBJsonParser.m.svn-base
  21. +129 −0 WBShareKit/WBShareKit/JSON/.svn/text-base/SBJsonWriter.h.svn-base
  22. +237 −0 WBShareKit/WBShareKit/JSON/.svn/text-base/SBJsonWriter.m.svn-base
  23. +50 −0 WBShareKit/WBShareKit/JSON/JSON.h
  24. +68 −0 WBShareKit/WBShareKit/JSON/NSObject+SBJSON.h
  25. +53 −0 WBShareKit/WBShareKit/JSON/NSObject+SBJSON.m
  26. +58 −0 WBShareKit/WBShareKit/JSON/NSString+SBJSON.h
  27. +55 −0 WBShareKit/WBShareKit/JSON/NSString+SBJSON.m
  28. +75 −0 WBShareKit/WBShareKit/JSON/SBJSON.h
  29. +212 −0 WBShareKit/WBShareKit/JSON/SBJSON.m
  30. +86 −0 WBShareKit/WBShareKit/JSON/SBJsonBase.h
  31. +78 −0 WBShareKit/WBShareKit/JSON/SBJsonBase.m
  32. +87 −0 WBShareKit/WBShareKit/JSON/SBJsonParser.h
  33. +475 −0 WBShareKit/WBShareKit/JSON/SBJsonParser.m
  34. +129 −0 WBShareKit/WBShareKit/JSON/SBJsonWriter.h
  35. +237 −0 WBShareKit/WBShareKit/JSON/SBJsonWriter.m
  36. +34 −0 WBShareKit/WBShareKit/NSString+URLEncoding.h
  37. +52 −0 WBShareKit/WBShareKit/NSString+URLEncoding.m
  38. BIN WBShareKit/WBShareKit/Oauth/.DS_Store
  39. +1 −1 WBShareKit/WBShareKit/WBShareKitAppDelegate.h
  40. +54 −54 WBShareKit/WBShareKit/WBShareKitAppDelegate.m
  41. +17 −14 WBShareKit/WBShareKit/WBShareKitViewController.h
  42. +30 −77 WBShareKit/WBShareKit/WBShareKitViewController.m
  43. BIN WBShareKit/WBShareKit/WeiBoSDK/.DS_Store
  44. +95 −0 WBShareKit/WBShareKit/WeiBoSDK/.svn/all-wcprops
  45. +559 −0 WBShareKit/WBShareKit/WeiBoSDK/.svn/entries
  46. +62 −0 WBShareKit/WBShareKit/WeiBoSDK/.svn/text-base/WBAuthorize.h.svn-base
  47. +196 −0 WBShareKit/WBShareKit/WeiBoSDK/.svn/text-base/WBAuthorize.m.svn-base
  48. +48 −0 WBShareKit/WBShareKit/WeiBoSDK/.svn/text-base/WBAuthorizeWebView.h.svn-base
  49. +332 −0 WBShareKit/WBShareKit/WeiBoSDK/.svn/text-base/WBAuthorizeWebView.m.svn-base
  50. +128 −0 WBShareKit/WBShareKit/WeiBoSDK/.svn/text-base/WBEngine.h.svn-base
  51. +339 −0 WBShareKit/WBShareKit/WeiBoSDK/.svn/text-base/WBEngine.m.svn-base
  52. +38 −0 WBShareKit/WBShareKit/WeiBoSDK/.svn/text-base/WBLogInAlertView.h.svn-base
  53. +128 −0 WBShareKit/WBShareKit/WeiBoSDK/.svn/text-base/WBLogInAlertView.m.svn-base
  54. +85 −0 WBShareKit/WBShareKit/WeiBoSDK/.svn/text-base/WBRequest.h.svn-base
  55. +359 −0 WBShareKit/WBShareKit/WeiBoSDK/.svn/text-base/WBRequest.m.svn-base
  56. +36 −0 WBShareKit/WBShareKit/WeiBoSDK/.svn/text-base/WBSDKGlobal.h.svn-base
  57. +81 −0 WBShareKit/WBShareKit/WeiBoSDK/.svn/text-base/WBSendView.h.svn-base
  58. +701 −0 WBShareKit/WBShareKit/WeiBoSDK/.svn/text-base/WBSendView.m.svn-base
  59. +42 −0 WBShareKit/WBShareKit/WeiBoSDK/.svn/text-base/WBUtil.h.svn-base
  60. +97 −0 WBShareKit/WBShareKit/WeiBoSDK/.svn/text-base/WBUtil.m.svn-base
  61. +23 −0 WBShareKit/WBShareKit/WeiBoSDK/CTMBase64/.svn/all-wcprops
  62. +130 −0 WBShareKit/WBShareKit/WeiBoSDK/CTMBase64/.svn/entries
  63. +184 −0 WBShareKit/WBShareKit/WeiBoSDK/CTMBase64/.svn/text-base/GTMBase64.h.svn-base
  64. +694 −0 WBShareKit/WBShareKit/WeiBoSDK/CTMBase64/.svn/text-base/GTMBase64.m.svn-base
  65. +388 −0 WBShareKit/WBShareKit/WeiBoSDK/CTMBase64/.svn/text-base/GTMDefines.h.svn-base
  66. +184 −0 WBShareKit/WBShareKit/WeiBoSDK/CTMBase64/GTMBase64.h
  67. +694 −0 WBShareKit/WBShareKit/WeiBoSDK/CTMBase64/GTMBase64.m
  68. +388 −0 WBShareKit/WBShareKit/WeiBoSDK/CTMBase64/GTMDefines.h
  69. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/.DS_Store
  70. +5 −0 WBShareKit/WBShareKit/WeiBoSDK/Resource/.svn/all-wcprops
  71. +31 −0 WBShareKit/WBShareKit/WeiBoSDK/Resource/.svn/entries
  72. +89 −0 WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/all-wcprops
  73. +504 −0 WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/entries
  74. +5 −0 WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/prop-base/bg.png.svn-base
  75. +5 −0 WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/prop-base/bg@2x.png.svn-base
  76. +5 −0 WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/prop-base/bg_land.png.svn-base
  77. +5 −0 WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/prop-base/bg_land@2x.png.svn-base
  78. +5 −0 WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/prop-base/btn.png.svn-base
  79. +5 −0 WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/prop-base/btn@2x.png.svn-base
  80. +5 −0 WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/prop-base/close.png.svn-base
  81. +5 −0 WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/prop-base/close@2x.png.svn-base
  82. +5 −0 WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/prop-base/close_btn.png.svn-base
  83. +5 −0 WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/prop-base/close_btn@2x.png.svn-base
  84. +5 −0 WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/prop-base/delete.png.svn-base
  85. +5 −0 WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/prop-base/delete@2x.png.svn-base
  86. +5 −0 WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/prop-base/logo.png.svn-base
  87. +5 −0 WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/prop-base/logo@2x.png.svn-base
  88. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/text-base/bg.png.svn-base
  89. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/text-base/bg@2x.png.svn-base
  90. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/text-base/bg_land.png.svn-base
  91. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/text-base/bg_land@2x.png.svn-base
  92. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/text-base/btn.png.svn-base
  93. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/text-base/btn@2x.png.svn-base
  94. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/text-base/close.png.svn-base
  95. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/text-base/close@2x.png.svn-base
  96. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/text-base/close_btn.png.svn-base
  97. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/text-base/close_btn@2x.png.svn-base
  98. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/text-base/delete.png.svn-base
  99. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/text-base/delete@2x.png.svn-base
  100. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/text-base/logo.png.svn-base
  101. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/.svn/text-base/logo@2x.png.svn-base
  102. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/bg.png
  103. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/bg@2x.png
  104. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/bg_land.png
  105. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/bg_land@2x.png
  106. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/btn.png
  107. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/btn@2x.png
  108. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/close.png
  109. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/close@2x.png
  110. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/close_btn.png
  111. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/close_btn@2x.png
  112. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/delete.png
  113. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/delete@2x.png
  114. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/logo.png
  115. BIN WBShareKit/WBShareKit/WeiBoSDK/Resource/Images/logo@2x.png
  116. +17 −0 WBShareKit/WBShareKit/WeiBoSDK/SFHFKeychainUtils/.svn/all-wcprops
  117. +96 −0 WBShareKit/WBShareKit/WeiBoSDK/SFHFKeychainUtils/.svn/entries
  118. +5 −0 WBShareKit/WBShareKit/WeiBoSDK/SFHFKeychainUtils/.svn/prop-base/SFHFKeychainUtils.h.svn-base
  119. +5 −0 WBShareKit/WBShareKit/WeiBoSDK/SFHFKeychainUtils/.svn/prop-base/SFHFKeychainUtils.m.svn-base
  120. +53 −0 WBShareKit/WBShareKit/WeiBoSDK/SFHFKeychainUtils/.svn/text-base/SFHFKeychainUtils.h.svn-base
  121. +434 −0 WBShareKit/WBShareKit/WeiBoSDK/SFHFKeychainUtils/.svn/text-base/SFHFKeychainUtils.m.svn-base
  122. +53 −0 WBShareKit/WBShareKit/WeiBoSDK/SFHFKeychainUtils/SFHFKeychainUtils.h
  123. +434 −0 WBShareKit/WBShareKit/WeiBoSDK/SFHFKeychainUtils/SFHFKeychainUtils.m
  124. +64 −0 WBShareKit/WBShareKit/WeiBoSDK/WBAuthorize.h
  125. +252 −0 WBShareKit/WBShareKit/WeiBoSDK/WBAuthorize.m
  126. +50 −0 WBShareKit/WBShareKit/WeiBoSDK/WBAuthorizeWebView.h
  127. +441 −0 WBShareKit/WBShareKit/WeiBoSDK/WBAuthorizeWebView.m
  128. +130 −0 WBShareKit/WBShareKit/WeiBoSDK/WBEngine.h
  129. +459 −0 WBShareKit/WBShareKit/WeiBoSDK/WBEngine.m
  130. +38 −0 WBShareKit/WBShareKit/WeiBoSDK/WBLogInAlertView.h
  131. +128 −0 WBShareKit/WBShareKit/WeiBoSDK/WBLogInAlertView.m
  132. +85 −0 WBShareKit/WBShareKit/WeiBoSDK/WBRequest.h
  133. +359 −0 WBShareKit/WBShareKit/WeiBoSDK/WBRequest.m
  134. +37 −0 WBShareKit/WBShareKit/WeiBoSDK/WBSDKGlobal.h
  135. +81 −0 WBShareKit/WBShareKit/WeiBoSDK/WBSendView.h
  136. +702 −0 WBShareKit/WBShareKit/WeiBoSDK/WBSendView.m
  137. +42 −0 WBShareKit/WBShareKit/WeiBoSDK/WBUtil.h
  138. +97 −0 WBShareKit/WBShareKit/WeiBoSDK/WBUtil.m
  139. +27 −557 WBShareKit/WBShareKit/en.lproj/WBShareKitViewController.xib
View
@@ -1,46 +1,17 @@
-1.WBShareKey.h中修改配置信息
+1.CHShareManager.m中修改配置信息
-2.app delegate中添加
+2.qq登录时回调url换成 qq.com
+ sina无需修改
- - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
- {
- [[WBShareKit mainShare] handleOpenURL:url];
- return YES;
- }
-
- - (void)sinaSuccess:(NSData *)_data
- {
- NSLog(@"sina ok:%@",_data);
- }
+3.添加Security.framework
- - (void)sinaError:(NSError *)_error
- {
- NSLog(@"sina error:%@",_error);
- }
-
- //[[WBShareKit mainShare] startSinaOauthWithSelector:@selector(sinaSuccess:) withFailedSelector:@selector(sinaError:)];
- //如上认证代码添加的@selector也将会在此调用
+4.调用查看WBShareKitViewController.m
-3.在info.plist中修改url types
-
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
- <plist version="1.0">
- <array>
- <dict>
- <key>CFBundleTypeRole</key>
- <string>Editor</string>
- <key>CFBundleURLName</key>
- <string>minroad.com</string>
- <key>CFBundleURLSchemes</key>
- <array>
- <string>oauth</string>
- </array>
- </dict>
- </array>
- </plist>
-
-4.具体调用请查看WBShareKitViewController.m
+5.新版WBShareKit只是将
+ [http://qzonestyle.gtimg.cn/qzone/vas/opensns/res/doc/Connect_IOS_SDK__V1.2.zip](http://qzonestyle.gtimg.cn/qzone/vas/opensns/res/doc/Connect_IOS_SDK__V1.2.zip)
+与
+ [http://code.google.com/p/sinaweibosdkforoauth2/downloads/list](http://code.google.com/p/sinaweibosdkforoauth2/downloads/list)
+合并,时间紧凑,代码有些乱,见谅
更多信息
View
@@ -1,49 +0,0 @@
-1.WBShareKey.h中修改配置信息
-
-2.app delegate中添加
-
- - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
- {
- [[WBShareKit mainShare] handleOpenURL:url];
- return YES;
- }
-
- - (void)sinaSuccess:(NSData *)_data
- {
- NSLog(@"sina ok:%@",_data);
- }
-
- - (void)sinaError:(NSError *)_error
- {
- NSLog(@"sina error:%@",_error);
- }
-
- //[[WBShareKit mainShare] startSinaOauthWithSelector:@selector(sinaSuccess:) withFailedSelector:@selector(sinaError:)];
- //如上认证代码添加的@selector也将会在此调用
-
-3.在info.plist中修改url types
-
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
- <plist version="1.0">
- <array>
- <dict>
- <key>CFBundleTypeRole</key>
- <string>Editor</string>
- <key>CFBundleURLName</key>
- <string>minroad.com</string>
- <key>CFBundleURLSchemes</key>
- <array>
- <string>oauth</string>
- </array>
- </dict>
- </array>
- </plist>
-
-4.具体调用请查看WBShareKitViewController.m
-
-更多信息
-
-http://www.chlova.com
-
-http://www.minroad.com

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Bucket
+ type = "1"
+ version = "1.0">
+</Bucket>
Binary file not shown.
@@ -0,0 +1,28 @@
+//
+// CHShareManager.h
+// isoccer
+//
+// Created by Seamus on 9/11/12.
+// Copyright (c) 2012 Chlova. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "WBEngine.h"
+
+@interface CHShareManager : NSObject<WBEngineDelegate>
+{
+ WBEngine *sinaEngine;
+ WBEngine *qqEngine;
+
+ UIViewController *vc;
+ SEL sel_success,sel_failed;
+
+}
+
++(CHShareManager *)mainManager;
+- (BOOL)sinaIsVailed;
+- (BOOL)qqIsVailed;
+//- (void)getProfile:(NSString *)_type vc:(UIViewController *)_vc;
+- (void)sendWeibo:(NSString *)_status image:(UIImage *)_img type:(NSString *)_type vc:(UIViewController *)_vc finish:(SEL)_success failed:(SEL)_failed;
+- (void)showLoginOnViewController:(UIViewController *)_vc type:(NSString *)_type finish:(SEL)_success failed:(SEL)_failed;
+@end
@@ -0,0 +1,208 @@
+//
+// CHShareManager.m
+// isoccer
+//
+// Created by Seamus on 9/11/12.
+// Copyright (c) 2012 Chlova. All rights reserved.
+//
+
+#import "CHShareManager.h"
+#define kWBAppkey @"2396343608"
+#define kWBSecret @"bb5bdc7df7609a13ffdf7201c32de2b0"
+#define kQQAppkey @"100304947"
+#define kQQSecret @""
+
+@implementation CHShareManager
+static CHShareManager *_console;
+
++(CHShareManager *)mainManager
+{
+ if (nil == _console) {
+ _console = [[CHShareManager alloc] init];
+ }
+
+ return _console;
+}
+
+- (id)init
+{
+ self = [super init];
+ if (self) {
+ sinaEngine = [[WBEngine alloc] initWithAppKey:kWBAppkey appSecret:kWBSecret];
+ sinaEngine.snsType = @"sina";
+// [sinaEngine setRootViewController:self];
+ [sinaEngine setDelegate:self];
+// [sinaEngine setRedirectURI:@"www.qq.com"];
+ [sinaEngine setIsUserExclusive:NO];
+
+// [sinaEngine logOut];
+
+ qqEngine = [[WBEngine alloc] initWithAppKey:kQQAppkey appSecret:kQQSecret];
+ qqEngine.snsType = @"qq";
+ // [sinaEngine setRootViewController:self];
+ [qqEngine setDelegate:self];
+ [qqEngine setRedirectURI:@"qq.com"];
+ [qqEngine setIsUserExclusive:NO];
+
+// [qqEngine logOut];
+
+ }
+ return self;
+}
+
+- (void)dealloc
+{
+ [sinaEngine release];
+ sinaEngine = nil;
+ [qqEngine release];
+ qqEngine = nil;
+ [vc release];
+ vc = nil;
+ [super dealloc];
+}
+
+
+#pragma mark -
+
+- (BOOL)sinaIsVailed
+{
+ return [sinaEngine isLoggedIn] && ![sinaEngine isAuthorizeExpired];
+}
+
+- (BOOL)qqIsVailed
+{
+ return [qqEngine isLoggedIn] && ![qqEngine isAuthorizeExpired];
+}
+
+- (void)showLoginOnViewController:(UIViewController *)_vc type:(NSString *)_type finish:(SEL)_success failed:(SEL)_failed
+{
+ [vc release];
+ vc = nil;
+ vc = [_vc retain];
+
+ sel_success = _success;
+ sel_failed = _failed;
+
+ WBEngine *e = nil;
+ if ([_type isEqualToString:@"sina"]) {
+ e = sinaEngine;
+ }
+ else if ([_type isEqualToString:@"qq"])
+ {
+ e = qqEngine;
+ }
+
+// [e setRootViewController:vc];
+ [e logIn];
+}
+
+//- (void)getProfile:(NSString *)_type vc:(UIViewController *)_vc
+//{
+// [vc release];
+// vc = nil;
+// vc = [_vc retain];
+//
+// if ([_type isEqualToString:@"sina"]) {
+// [sinaEngine loadRequestWithMethodName:@"users/show.json"
+// httpMethod:@"GET"
+// params:@{@"uid":sinaEngine.userID}
+// postDataType:kWBRequestPostDataTypeNone
+// httpHeaderFields:nil];
+// }
+// else if ([_type isEqualToString:@"qq"])
+// {
+// NSDictionary *params = @{@"format":@"json",@"oauth_consumer_key":qqEngine.appKey,@"openid":qqEngine.userID};
+// [qqEngine loadRequestWithMethodName:@"user/get_user_info"
+// httpMethod:@"GET"
+// params:params
+// postDataType:kWBRequestPostDataTypeNone
+// httpHeaderFields:nil];
+// }
+//}
+
+- (void)sendWeibo:(NSString *)_status image:(UIImage *)_img type:(NSString *)_type vc:(UIViewController *)_vc finish:(SEL)_success failed:(SEL)_failed
+{
+ [vc release];
+ vc = nil;
+ vc = [_vc retain];
+
+ sel_success = _success;
+ sel_failed = _failed;
+
+ if ([_type isEqualToString:@"qq"]) {
+ [qqEngine sendWeiBoWithText:_status image:_img];
+ }
+ else if ([_type isEqualToString:@"sina"])
+ {
+ [sinaEngine sendWeiBoWithText:_status image:_img];
+ }
+
+}
+
+#pragma mark - wbengine
+- (void)engineAlreadyLoggedIn:(WBEngine *)engine
+{
+ [vc release];
+ vc = nil;
+}
+
+- (void)engineDidLogIn:(WBEngine *)engine
+{
+ if ([vc respondsToSelector:sel_success]) {
+ [vc performSelector:sel_success withObject:engine];
+ }
+
+ // do sth.
+ [vc release];
+ vc = nil;
+}
+
+- (void)engine:(WBEngine *)engine didFailToLogInWithError:(NSError *)error
+{
+ if ([vc respondsToSelector:sel_failed]) {
+ [vc performSelector:sel_failed withObject:engine withObject:error];
+ }
+
+ [vc release];
+ vc = nil;
+}
+
+- (void)engineDidLogOut:(WBEngine *)engine
+{
+
+}
+
+- (void)engineNotAuthorized:(WBEngine *)engine
+{
+ [vc release];
+ vc = nil;
+}
+
+- (void)engineAuthorizeExpired:(WBEngine *)engine
+{
+ [vc release];
+ vc = nil;
+}
+
+- (void)engine:(WBEngine *)engine requestDidFailWithError:(NSError *)error
+{
+ if ([vc respondsToSelector:sel_failed]) {
+ [vc performSelector:sel_failed withObject:error];
+ }
+
+
+ [vc release];
+ vc = nil;
+}
+
+- (void)engine:(WBEngine *)engine requestDidSucceedWithResult:(id)result
+{
+ if ([vc respondsToSelector:sel_success]) {
+ [vc performSelector:sel_success withObject:result];
+ }
+
+ [vc release];
+ vc = nil;
+}
+
+@end
Oops, something went wrong.

0 comments on commit 344a30f

Please sign in to comment.