- Android
- iOS
- JavaScript
- Flutter
- ReactNative
Delete a comment by comment ID.
API Reference
/**
* delete a comment
* @param momentId Moments post ID
* @param commentId comment ID
* @param callback result callback
*/
void removeComment(String momentId, String commentId, IMessageManager.ISimpleCallback callback);
Code Example
JIM.getInstance().getMomentManager().removeComment("momentId", "commentId", new IMessageManager.ISimpleCallback() {
@Override
public void onSuccess() {
}
@Override
public void onError(int errorCode) {
}
});
Delete a comment by comment ID.
API Reference
/// delete a comment
/// - Parameters:
/// - commentId: comment ID
/// - momentId: Moments post ID
/// - completeBlock: result callback
- (void)removeComment:(nonnull NSString *)commentId
momentId:(nonnull NSString *)momentId
complete:(nullable void (^)(JErrorCode errorCode))completeBlock;
Code Example
[JIM.shared.momentManager removeComment:@"commentId" momentId:@"momentId" complete:^(JErrorCode errorCode) {
}];
Delete a comment by comment ID.
API Reference
/**
* delete a comment
* @param momentId Moments post ID
* @param commentId comment ID
* return result code; 0 indicates success
*/
Future<int> removeMomentComment(String momentId, String commentId) async
Code Example
int removeCommentResult = await JuggleIm.instance.removeMomentComment('momentId', 'commentId');
Delete a comment by comment ID.
API Reference
/**
* delete a comment
* @param momentId Moments post ID
* @param commentId comment ID
* return Promise<void>
*/
removeComment(momentId: string, commentId: string): Promise<void>
Code Example
import { JuggleIMMoment } from 'juggleim-rnsdk';
await JuggleIMMoment.removeComment('momentId', 'commentId');
Delete a comment by comment ID.
Parameters
| Name | Type | Required | Default | Description | Version |
|---|---|---|---|---|---|
| params | Object | Yes | - | Parameters for deleting a comment | 1.9.6 |
| params.momentId | String | Yes | - | Moment ID | 1.9.6 |
| params.commentIds | Array | Yes | - | Comment ID | 1.9.6 |
Code Example
// delete a comment
let params = {
momentId: 'momentId',
commentIds: ['commentId1', 'commentId2']
};
jim.removeComment(params).then(() => {
console.log('removeComment successfully');
});