postActivity static method

Future<GetSocialActivity> postActivity(
  1. ActivityContent content,
  2. PostActivityTarget target
)

Post activity content to the specified target.

content Content to post. target Where to post the content.

Implementation

static Future<GetSocialActivity> postActivity(
    ActivityContent content, PostActivityTarget target) {
  Map<String, dynamic> postActivityBody = {
    'target': target.toJSON(),
    'content': content.toJSON()
  };
  return NativeBridge.async(
          'Communities.postActivity', jsonEncode(postActivityBody))
      .then((result) => GetSocialActivity.fromJSON(jsonDecode(result)));
}