目前支持 Weibo SDK
, WeChat SDK
, QQ SDK
- 启动的时候
ShareKit *share = [ShareKit sharedInstance];
// sinaweibo
[share sinaWeiboSetupWithAppKey:kSinaWeiboAppKey
appSecret:kSinaWeiboAppSecret
appRedirectURI:kSinaWeiboAppRedirectURI
ssoCallbackScheme:kSinaWeiboScheme];
// wechat
[share weChatSetupWithAppKey:kWeChatAppID];
- 接管URL
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
return [[ShareKit sharedInstance] handleOpenURL:url];
}
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
return [[ShareKit sharedInstance] handleOpenURL:url];
}
- 在相关的需要分享的地方
ShareKit *share = [ShareKit sharedInstance];
// 分享到微博
[share sinaWeiboSendWithText:text
imageData:imageData
authCompletion:^(NSError *error) {}
success:^{}
failure:^(NSError *error) {}]
更多请参考 ShareKit.h