|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
public interface IWeiboShareAPI
该类是进行微博分享的接口类。有以下两种方式进行微博分享:
方法摘要 | |
---|---|
boolean |
checkEnvironment(boolean bShowDownloadDialog)
检查微博客户端环境是否正常。 |
int |
getWeiboAppSupportAPI()
获取当前微博客户端程序支持的 SDK 的最高版本号。 |
boolean |
handleWeiboRequest(Intent intent,
com.sina.weibo.sdk.api.share.IWeiboHandler.Request handler)
处理微博客户端发送过来的请求。 |
boolean |
handleWeiboResponse(Intent intent,
com.sina.weibo.sdk.api.share.IWeiboHandler.Response handler)
处理微博客户端分享后的响应数据。 |
boolean |
isWeiboAppInstalled()
检查用户是否安装了微博客户端程序 |
boolean |
isWeiboAppSupportAPI()
检查微博是否支持此 SDK。 |
boolean |
launchWeibo()
启动微博客户端程序。 |
boolean |
registerApp()
注册第三方应用 到微博客户端中,注册成功后该应用将显示在微博的应用列表中。 |
void |
registerWeiboDownloadListener(com.sina.weibo.sdk.api.share.IWeiboDownloadListener listener)
注册微博客户端下载的监听器。 |
boolean |
sendRequest(com.sina.weibo.sdk.api.share.BaseRequest request)
发送微博分享请求给微博客户端程序。 |
boolean |
sendResponse(com.sina.weibo.sdk.api.share.BaseResponse response)
收到微博客户端程序的请求后,发送对应的应答内容给微博客户端程序。 |
方法详细信息 |
---|
boolean isWeiboAppInstalled()
boolean isWeiboAppSupportAPI()
int getWeiboAppSupportAPI()
ApiUtils.BUILD_INT_VER_2_2
,不支持 VoiceObject
如果微博版本号 < ApiUtils.BUILD_INT_VER_2_3
,不支持 CmdObject
boolean registerApp()
boolean handleWeiboResponse(Intent intent, com.sina.weibo.sdk.api.share.IWeiboHandler.Response handler)
当从当前应用唤起微博发博器并进行分享后,返回到当前应用时,需要在
Activity#onNewIntent
和 Activity#onCreate
函数中,主动调用该
函数处理分享后的响应数据。在 Activity#onCreate
函数中调用该函数是为了防
止该 Activity 处于后台时,可能会由于内存不足被杀掉了而导致的重新初始化。
执行流程:本应用->微博->本应用
intent
- 数据内容handler
- 处理应答对应的回调函数
IWeiboHandler.Response.onResponse(com.sina.weibo.sdk.api.share.BaseResponse)
;
失败返回 false,不调用上述回调boolean handleWeiboRequest(Intent intent, com.sina.weibo.sdk.api.share.IWeiboHandler.Request handler)
当微博客户端唤起当前应用并进行分享时,需要在 Activity#onCreate
和
Activity#onNewIntent
函数中,主动调用该函数来处理客户端发送过来的请求。
执行流程:微博->本应用->微博
intent
- 数据内容handler
- 处理请求后对应的回调函数
IWeiboHandler.Request.onRequest(com.sina.weibo.sdk.api.share.BaseRequest)
boolean launchWeibo()
boolean sendRequest(com.sina.weibo.sdk.api.share.BaseRequest request)
request
- 请求的内容。
boolean sendResponse(com.sina.weibo.sdk.api.share.BaseResponse response)
response
- 应答数据
void registerWeiboDownloadListener(com.sina.weibo.sdk.api.share.IWeiboDownloadListener listener)
IWeiboDownloadListener.onCancel()
函数被调用。
listener
- 监听微博客户端下载的 Listenerboolean checkEnvironment(boolean bShowDownloadDialog) throws com.sina.weibo.sdk.exception.WeiboShareException
bShowDownloadDialog
- 如果未安装微博,是否弹出对话框询问用户下载微博客户端
com.sina.weibo.sdk.exception.WeiboShareException
- 微博客户端不合法时,抛出异常
|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |