@garygchai
2016-07-12T11:07:52.000000Z
字数 5588
阅读 2064
reactnative
ReactNativeManager
描述
:获取当前请求域名 参数
:callback
回调函数 返回
:string
请求域名 举例
:
React.NativeModules.ReactNativeManager.getRequestUrl((serviceUrl) => {
//serviceUrl: http://live.kugou.com
});
描述
:获取客户端相关信息 参数
:callback
回调函数,callback 返回
:object
客户端信息,clientInfo 举例
:
React.NativeModules.ReactNativeManager.getClientInfo((clientInfo) => {
//clientInfo: offset=0&size=20&sign=3b9bfb69dbd95679&version=6572&platform=5
var url = serviceUrl + '/mv/cdn/getMvList4Native?' + clientInfo;
});
描述
:获取登录用户信息 参数
:callback
回调函数, 返回
:object
客户端信息,userInfo 举例
:
React.NativeModules.ReactNativeManager.getUserInfo((userInfo) => {
//TODO
});
描述
:通知native报错 参数
:string
错误信息 举例
:
React.NativeModules.ReactNativeManager.requestError("请求出错!");
KugouLiveManager
暂无
LiveReviewManager
, ConcertPageManager
描述
:获取当前请求域名 参数
:callback
回调函数 返回
:string
请求域名 举例
:
React.NativeModules.LiveReviewManager.currentUrlCallback((serviceUrl) => {
//serviceUrl: http://live.kugou.com
});
描述
:获取客户端相关信息 参数
:callback
回调函数,callback 返回
:object
客户端信息,clientInfo 举例
:
React.NativeModules.LiveReviewManager.getClientInfo((clientInfo) => {
//clientInfo: offset=0&size=20&sign=3b9bfb69dbd95679&version=6572&platform=5
var url = serviceUrl + '/mv/cdn/getMvList4Native?' + clientInfo;
});
描述
:通知native报错 参数
:string
错误信息 举例
:
React.NativeModules.LiveReviewManager.requestListError("请求出错!");
描述
:通知native播放下一个视频 参数
:string
hash 参数
:string
title 举例
:
React.NativeModules.LiveReviewManager.playNextMvWith(hash, title);
描述
:进入酷狗live直播间 参数
:string
concertId, string
concertTitle, int
vipSwitch, int
h5Switch, string
h5Url 举例
:
{
concertId: 331,
concertType: 1,
coverImg: "http://image.fanxing.kugou.com/fansbanner/20160627/20160627111739764595.jpg",
endTime: 1467811525088,
h5Switch: 0,
onlineCount: 0,
playNum: 1386,
roomId: 0,
singer: "魏晨",
starNum: 59161,
startTime: 1467804604000,
status: 2,
subscribeCount: 0,
summaryContent: "魏晨白日梦想家分享会,和魏晨的亲密约会,等你来赴约!说、唱、问、答、玩,花式互动360度全方位满足你的“白日梦想”。“橙”意十足,“魏”你而来!",
title: "魏晨·白日梦想家分享会",
vipSwitch: 0
});
React.NativeModules.ConcertPageManager.enterKugouLiveRoom(
concertId, concertTitle, vipSwitch, h5Switch, h5Url
);
描述
:进入酷狗live回顾页 参数
:string
回顾页json字符串 举例
:
var json = JSON.parse({
concertId: 331,
concertType: 1,
coverImg: "http://image.fanxing.kugou.com/fansbanner/20160627/20160627111739764595.jpg",
endTime: 1467811525088,
h5Switch: 0,
onlineCount: 0,
playNum: 1386,
roomId: 0,
singer: "魏晨",
starNum: 59161,
startTime: 1467804604000,
status: 2,
subscribeCount: 0,
summaryContent: "魏晨白日梦想家分享会,和魏晨的亲密约会,等你来赴约!说、唱、问、答、玩,花式互动360度全方位满足你的“白日梦想”。“橙”意十足,“魏”你而来!",
title: "魏晨·白日梦想家分享会",
vipSwitch: 0
});
React.NativeModules.ConcertPageManager.enterKugouLiveReviewPage(json);
描述
:进入酷狗live预约页 参数
:string
concertId, string
h5Url, boolen
subscribe 举例
:
React.NativeModules.ConcertPageManager.enterKugouLiveSubscribePage(concertId, h5Url, subscribe);
描述
:native通知RN播放下一个 举例
:
NativeAppEventEmitter.addListener('playNext', () => {
liveReviewManager.playNextMvWith(hash, title);
});
请求
: http://live.kugou.com/kugoulive/concert/cdn/getConcertList?sign=bb6f9c899a6dedd5&version=6575&platform=5 返回
:
{
code: 0,
data: [{
concertId: 130,
concertType: 1,
coverImg: "http://s10.fxwork.fanxing.com/fansbanner/20160425/20160425135751755982.jpg",
currentTime: 0,
endTime: 0,
h5Switch: 0,
h5Url: "http://test.m.fanxing.com/static/mobile/kugouLive/views/liveDetail.html?concertId=130",
onlineCount: 0,
playNum: 0,
roomId: 1013544,
singer: "黄子韬",
starNum: 0,
startTime: 1464775277000,
status: 0,
subscribeCount: 0,
title: "枕头大战测试",
vipSwitch: 0
}],
msg: "操作成功",
times: 1468287265
}
{
code: 0,
data: [{
concertId: 331,
concertType: 1,
coverImg: "http://image.fanxing.kugou.com/fansbanner/20160627/20160627111739764595.jpg",
endTime: 1467811525088,
h5Switch: 0,
onlineCount: 0,
playNum: 1386,
roomId: 0,
singer: "魏晨",
starNum: 59161,
startTime: 1467804604000,
status: 2,
subscribeCount: 0,
summaryContent: "魏晨白日梦想家分享会,和魏晨的亲密约会,等你来赴约!说、唱、问、答、玩,花式互动360度全方位满足你的“白日梦想”。“橙”意十足,“魏”你而来!",
title: "魏晨·白日梦想家分享会",
vipSwitch: 0
}],
msg: "操作成功",
times: 1468287265
}
{
code: 0,
data: {
1: false,
50: false,
51: false,
53: false,
59: false,
83: false,
86: true,
130: true
},
msg: "SUCCESS",
times: 1468292552
}
请求
: http://10.16.6.38:12011/kugoulive/mv/cdn/getMvList4Native?sign=f6a82bfca8d76ae4&concertId=88&version=6575&platform=5 返回
:
{
code: 0,
data: {
concertId: 88,
coverUrl: "http://s10.fxwork.fanxing.com/fansbanner/20160510/20160510171934396603.jpg",
listMv: [
{
hash: "5B8E19EC11AFB5DE5E996E7F9728EC5F",
mvId: 1,
singer: "通知推送测试",
summaryContent: "通知推送测试",
title: "通知推送测试"
}
],
starNum: 0,
startTime: 1464604214000,
summaryContent: "",
vipSwitch: 0
},
msg: "操作成功",
times: 1468292688
}
请求
: http://10.16.6.38:12011/kugoulive/concert/subscribe 参数
:
//POST 请求
sign=0dbf4a5ac0dfbcb8&appid=1131&channel=200&concertId=53&device=867516028242417%2458%3A44%3A98%3Abe%3A94%3Ae1&islogin=1&kugouId=842813124&muuid=ad58195b1e6abf7169c8f5414f3eedb4&phoneNum=0&pid=842813124&platform=5&sysVersion=21×=1468289365849&token=6004dc4909f525a1e42ce1bf432ec2fb86b2635e66d515e986d34d782779329b&type=1&version=6575
返回
:
{
"code":0,
"data":
{"1":false,"59":false,"50":false,"83":false,"51":false,"130":true,"53":false,"86":true
},
"msg":"SUCCESS",
"times":1468289367
}