- Android
- iOS
- JavaScript
- Flutter
- ReactNative
Get information for a single Moment.
API Reference
/**
* get Moments post details
* @param momentId Moments post ID
* @param callback result callback
*/
void getMoment(String momentId, JIMConst.IResultCallback<Moment> callback);
Code Example
JIM.getInstance().getMomentManager().getMoment("momentId", new JIMConst.IResultCallback<Moment>() {
@Override
public void onSuccess(Moment data) {
}
@Override
public void onError(int errorCode) {
}
});
Get information for a single Moment.
API Reference
/// get Moments post details
/// - Parameters:
/// - momentId: Moments post ID
/// - completeBlock: result callback
- (void)getMoment:(nonnull NSString *)momentId
complete:(nullable void (^)(JErrorCode errorCode, JMoment * _Nullable moment))completeBlock;
Code Example
[JIM.shared.momentManager getMoment:@"momentId" complete:^(JErrorCode errorCode, JMoment * _Nullable moment) {
}];
Get information for a single Moment.
API Reference
/**
* get Moments post details
* @param momentId Moments post ID
* return Moment object
*/
Future<Result<Moment>> getMoment(String momentId) async
Code Example
Result<Moment> moment = await JuggleIm.instance.getMoment('momentId');
Get information for a single Moment.
API Reference
/**
* get Moments post details
* @param momentId Moments post ID
* return Promise<Moment> object
*/
getMoment(momentId: string): Promise<Moment>
Code Example
import { JuggleIMMoment } from 'juggleim-rnsdk';
const moment = await JuggleIMMoment.getMoment('momentId');
Get information for a single Moment.
Parameters
| Name | Type | Required | Default | Description | Version |
|---|---|---|---|---|---|
| params | Object | Yes | - | Moment information | 1.9.6 |
| params.momentId | String | Yes | - | Moment ID | 1.9.6 |
Callback Parameters
| Property | Type | Description | Version |
|---|---|---|---|
| result | Object | Query result | 1.9.6 |
| result.moment | Object | Moment object. See Moment. | 1.9.6 |
Code Example
// get a single Moments post
let momentId = '';
jim.getMoment({ momentId }).then((result) => {
console.log('getMoment successfully', result)
});