- Android
- iOS
- JavaScript
- Flutter
获取单个朋友圈信息
接口说明
/**
* 获取朋友圈详情
* @param momentId 朋友圈 id
* @param callback 结果回调
*/
void getMoment(String momentId, JIMConst.IResultCallback<Moment> callback);
代码示例
JIM.getInstance().getMomentManager().getMoment("momentId", new JIMConst.IResultCallback<Moment>() {
@Override
public void onSuccess(Moment data) {
}
@Override
public void onError(int errorCode) {
}
});
获取单个朋友圈信息
接口说明
/// 获取朋友圈详情
/// - Parameters:
/// - momentId: 朋友圈 id
/// - completeBlock: 结果回调
- (void)getMoment:(nonnull NSString *)momentId
complete:(nullable void (^)(JErrorCode errorCode, JMoment * _Nullable moment))completeBlock;
代码示例
[JIM.shared.momentManager getMoment:@"momentId" complete:^(JErrorCode errorCode, JMoment * _Nullable moment) {
}];
获取单个朋友圈信息
接口说明
/**
* 获取朋友圈详情
* @param momentId 朋友圈 id
* return Moment 对象
*/
Future<Result<Moment>> getMoment(String momentId) async
代码示例
Result<Moment> moment = await JuggleIm.instance.getMoment('momentId');
获取单个朋友圈信息
参数说明
| 名称 | 类型 | 必填 | 默认值 | 描述 | 版本 |
|---|---|---|---|---|---|
| params | Object | 是 | - | 朋友圈信息 | 1.9.6 |
| params.momentId | String | 是 | - | 朋友圈 ID | 1.9.6 |
回调说明
| 属性 | 类型 | 描述 | 版本 |
|---|---|---|---|
| result | Object | 查询结果 | 1.9.6 |
| result.moment | Object | 朋友圈对象,结构请查看 Moment | 1.9.6 |
代码示例
// 获取单个朋友圈信息
let momentId = '';
jim.getMoment({ momentId }).then((result) => {
console.log('getMoment successfully', result)
});