Events reference
The events the SDK emits while your users use the community, with their fields. To listen to them, see Analytics.
This page uses one canonical name per event and per field, in lowerCamelCase. Each platform follows its own naming convention (for example PostCreated on Android, PostCreatedEvent on Flutter and Unity), and a few fields differ: they are listed in Platform differences.
Content
postCreated
Sent when the current user creates a post.
| Field | Type | Description |
|---|---|---|
postId | String | The id of the post. |
content | PostContent | What the post contains: text, image, poll. |
groupId | String | The id of the group the post was published in. |
textLength | Int | The length of the text of the post. |
commentCreated
Sent when the current user creates a comment.
| Field | Type | Description |
|---|---|---|
commentId | String | The id of the comment. |
postId | String | The id of the post the comment was published on. |
textLength | Int | The length of the text of the comment. |
replyCreated
Sent when the current user creates a reply.
| Field | Type | Description |
|---|---|---|
replyId | String | The id of the reply. |
commentId | String | The id of the comment the reply was published on. |
textLength | Int | The length of the text of the reply. |
contentDeleted
Sent when the current user deletes one of their posts, comments or replies.
| Field | Type | Description |
|---|---|---|
contentId | String | The id of the deleted content. |
contentKind | ContentKind | The kind of the deleted content. |
reactionModified
Sent when the current user adds, changes or removes a reaction on a content.
| Field | Type | Description |
|---|---|---|
contentId | String | The id of the content. |
contentKind | ContentKind | The kind of the content. |
previousReaction | ReactionKind, optional | The previous reaction. Empty when the user had no reaction. |
newReaction | ReactionKind, optional | The new reaction. Empty when the user removed their reaction. |
pollVoted
Sent when the current user votes in a poll.
| Field | Type | Description |
|---|---|---|
contentId | String | The id of the post that holds the poll. |
optionId | String | The id of the option the user voted for. |
contentReported
Sent when the current user reports a content.
| Field | Type | Description |
|---|---|---|
contentId | String | The id of the reported content. |
reasons | list of ReportReason | The reasons the user selected. |
profileReported
Android availableiOS not availableFlutter availableReact Native availableUnity ≥ 1.12.2
Sent when the current user reports another member's profile.
| Field | Type | Description |
|---|---|---|
profileId | String | The id of the reported profile. |
reasons | list of ReportReason | The reasons the user selected. |
Gamification
Only the points earned or lost through an action of the user in the app are reported live. For example, when a moderator removes a post of this user, no event reports the points removed.
gamificationPointsGained
Sent when the current user gains gamification points.
| Field | Type | Description |
|---|---|---|
points | Int | The number of points gained. |
action | GamificationPointsGainedAction | The action that earned the points. |
gamificationPointsRemoved
Sent when the current user loses gamification points.
| Field | Type | Description |
|---|---|---|
points | Int | The number of points removed. |
action | GamificationPointsRemovedAction | The action that removed the points. |
Groups
groupFollowingChanged
Sent when the current user follows or unfollows a group.
| Field | Type | Description |
|---|---|---|
groupId | String | The id of the group. |
followed | Bool | true when the user followed the group, false when they unfollowed it. |
Navigation and UI
screenDisplayed
Sent when the user navigates to a screen of the community.
| Field | Type | Description |
|---|---|---|
screen | Screen | The screen that was displayed, with its own fields. |
Screen is one of:
| Screen | Fields | Displayed when |
|---|---|---|
mainFeed | feedId: String | The main feed, the list of posts selected for the user. |
groups | — | The list of groups. |
groupDetail | groupId: String, source: GroupDetailSource | A group and its posts. source is clientApp when your app opened the group through a bridge, community when the user opened it inside the community. |
postDetail | postId: String | A post and its comments. |
commentDetail | commentId: String | A comment and its replies. |
createPost | — | The post creation screen. |
profile | — | The profile of the current user. |
activity ≥ 1.13.0 | — | The activity of the current user. Emitted instead of profile when the community runs in Unified Profile mode. |
otherUserProfile | profileId: String | The profile of another member. |
otherUserPosts ≥ 1.13.0 | profileId: String | The posts of another member, as opposed to otherUserProfile (their profile summary). Emitted only in Unified Profile mode: when your app opens a member's posts by their client user id, or when a tap on a member resolves to a member with no client user id. Outside Unified Profile mode, a tap on a member emits otherUserProfile. |
editProfile | — | The profile edition screen. |
reportContent | — | The screen to report a content. |
reportProfile | — | The screen to report a profile. |
validateNickname | — | The nickname validation screen, shown after a user who kept the generated nickname creates a post. |
settingsList | — | The settings screen. |
settingsAccount | — | The account settings screen. Only shown with Octopus authentication, not with SSO. |
reportExplanation | — | The screen that explains reporting. |
deleteAccount | — | The account deletion screen. Only shown with Octopus authentication, not with SSO. |
postsFeed (deprecated) | feedId: String, relatedTopicId: String, optional | Deprecated: replaced by mainFeed and groupDetail. relatedTopicId is the id of the group of the feed, empty for a feed that spans several groups. |
Not every platform emits every screen: see Platform differences.
notificationClicked
Sent when the user taps a notification of the Octopus notification center.
| Field | Type | Description |
|---|---|---|
notificationId | String | The id of the notification. |
contentId | String, optional | The id of the content the notification points to. Empty when it points to no content. |
postClicked
Sent when the user taps a post.
| Field | Type | Description |
|---|---|---|
postId | String | The id of the post. |
source | PostClickedSource | Where the post was shown: feed (a feed of posts) or profile (the posts of a profile). |
translationButtonClicked
Sent when the user taps the translation button of a content.
| Field | Type | Description |
|---|---|---|
contentId | String | The id of the content. |
contentKind | ContentKind | The kind of the content. |
viewTranslated | Bool | true when the user asked for the translation, false when they went back to the original. |
commentButtonClicked
Sent when the user taps the comment button of a post.
| Field | Type | Description |
|---|---|---|
postId | String | The id of the post. |
replyButtonClicked
Sent when the user taps the reply button of a comment.
| Field | Type | Description |
|---|---|---|
commentId | String | The id of the comment. |
seeRepliesButtonClicked
Sent when the user taps the button that shows the replies of a comment.
| Field | Type | Description |
|---|---|---|
commentId | String | The id of the comment. |
Profile
profileModified
Sent when the current user modifies their profile: nickname, bio or picture. The shape of the event differs per platform.
- Android
- iOS
- Flutter
- React Native
- Unity
previousProfile: OctopusProfile?— the profile before the change.newProfile: OctopusProfile— the profile after the change.
is OctopusEvent.ProfileModified -> {
val bioUpdated = event.previousProfile?.bio != event.newProfile.bio
}
Android sends the whole profile before and after the change: compare the two to find what changed.
nickname: ProfileFieldUpdate<NicknameUpdateContext>—.unchanged, or.updatedwith its context.bio: ProfileFieldUpdate<BioUpdateContext>—.updatedcarriesbioLength: Int.picture: ProfileFieldUpdate<PictureUpdateContext>—.updatedcarrieshasPicture: Bool,falsewhen the user removed their picture.
case let .profileModified(context):
if case let .updated(bio) = context.bio {
print(bio.bioLength)
}
Each field is either .unchanged or .updated with the details of the change.
nicknameUpdated: bool— whether the nickname changed.bioUpdated: bool— whether the bio changed.bioLength: int?— the length of the new bio, when it changed.pictureUpdated: bool— whether the picture changed.hasPicture: bool?— when the picture changed,falseif the user removed it.
case ProfileModifiedEvent(:final bioUpdated, :final bioLength):
if (bioUpdated) debugPrint('New bio length: $bioLength');
bioLength and hasPicture are null when the matching field did not change.
nicknameUpdated: boolean— whether the nickname changed.bioUpdated: boolean— whether the bio changed.bioLength: number | null— the length of the new bio, when it changed.pictureUpdated: boolean— whether the picture changed.hasPicture: boolean | null— when the picture changed,falseif the user removed it.
if (event.type === 'profileModified' && event.bioUpdated) {
console.log('New bio length:', event.bioLength);
}
bioLength and hasPicture are null when the matching field did not change.
NicknameChanged: bool— whether the nickname changed.BioChanged: bool— whether the bio changed.BioLength: int— the length of the new bio.PictureChanged: bool— whether the picture changed.HasPicture: bool— whether the user has a picture after the change.
if (e is ProfileModifiedEvent profile && profile.BioChanged)
{
Debug.Log($"New bio length: {profile.BioLength}");
}
BioLength and HasPicture are only meaningful when BioChanged or PictureChanged is true.
Session
sessionStarted
Sent when an Octopus UI session starts.
| Field | Type | Description |
|---|---|---|
sessionId | String | The id of the session. |
sessionStopped
Sent when an Octopus UI session stops: when the Octopus UI is closed, or when the app goes to the background.
| Field | Type | Description |
|---|---|---|
sessionId | String | The id of the session. |
Types
ContentKind
post, comment or reply.
ReactionKind
heart, joy, mouthOpen, clap, cry or rage, plus unknown for a reaction this version of the SDK does not know.
PostContent
A set of text, image and poll: what the post contains.
ReportReason
hateSpeech, explicit, violence, spam, suicide, fakeProfile, childExploitation, intellectualProperty or other.
GamificationPointsGainedAction
post, comment, reply, reaction, vote, postCommented (another member commented a post of the user), profileCompleted or dailySession.
GamificationPointsRemovedAction
postDeleted, commentDeleted, replyDeleted or reactionDeleted.
Platform differences
- Android
- iOS
- Flutter
- React Native
- Unity
- Events are the subtypes of
sealed interface OctopusEvent, and enum values are UPPER_CASE (ContentKind.POST,PostClicked.Source.FEED). contentDeletedis one of three types,PostDeleted,CommentDeletedandReplyDeleted, which all implementContentDeleted(contentId,contentKind).pollVotedisPollVote.contentReportedalso carriescontentKind.reasonsholdsModeration.ReportReasonvalues, with long names such asHateSpeechOrDiscriminatoryContent.ReactionKindisReaction.Kind:Heart,Joy,MouthOpen,Clap,Cry,RageandUnknown(unicode).- Both gamification events use one
Gamification.Actionenum; a removal reports the kind of content removed (POST,COMMENT,REPLY,REACTION). groupDetailisGroupDetail, and itssourceisSource.BRIDGEorSource.COMMUNITY.postsFeedisPostsFeed(feedId, relatedGroupId);relatedTopicIdis a deprecated alias.profileModifiedhas its own shape: seeprofileModified.
activity and otherUserPosts are emitted on Android.
- Events are the cases of
enum OctopusEvent, each with an associated context. gamificationPointsGainedcarriespointsGainedandgamificationPointsRemovedcarriespointsRemoved, notpoints.contentDeletednames its kindkind, notcontentKind.postCreatedalso carriestopicId, a deprecated alias ofgroupId.reasonsholds long names such ashateSpeechOrDiscriminationOrHarassmentandfakeProfilesAndImpersonation.ReactionKind.unknowncarries the unicode of the reaction:unknown(String).groupDetail.sourceisGroupDetailSource.clientAppor.community.profileModifiedhas its own shape: seeprofileModified.
The iOS SDK does not emit profileReported nor the activity screen.
- Events are the subclasses of
OctopusEvent, suffixed withEvent(PostCreatedEvent); screens are suffixed withScreen(MainFeedScreen). postCreatedcarries the id of the group intopicId: String?, and has nogroupId.groupDetail.sourceisGroupDetailSource.bridge,.communityor.unknown.- Unknown events and screens arrive as
UnknownEventandUnknownScreen. profileModifiedhas its own shape: seeprofileModified.
OctopusEvent and Screen are sealed classes: a switch over them is exhaustive.
- Each event is an object whose
typeis the canonical name ('postCreated'). postCreatedalso carriestopicId, a deprecated alias ofgroupId, which can benull.screenDisplayed.screenis aScreenInfoobject:typeplus the optionalfeedId,relatedTopicId,groupId,postId,commentIdandprofileId.groupDetailhas nosourcefield.ScreenTypealso includesunknown.
Compare event.type to narrow an event to its fields in TypeScript.
- Events are the subclasses of
OctopusEvent, suffixed withEvent(PostCreatedEvent), with PascalCase fields;Kindgives theOctopusEventKind. screenDisplayedis a singleScreenDisplayedEvent:Screen(anOctopusScreen) plusFeedId,PostId,CommentId,GroupId,ProfileIdandSource.SourceisOctopusGroupDetailSource.ClientApp,CommunityorUnknown.PostCreatedEvent.Contentis anOctopusPostContentflags enum:Text,Image,Poll.- Both gamification events use one
OctopusGamificationActionenum; a removal reports the kind of content removed (Post,Comment,Reply,Reaction). ContentReportedEvent.ReasonsandProfileReportedEvent.Reasonsare strings.- Events a later SDK version adds arrive as
UnknownEvent, withRawType.
On an iOS device, Unity receives what the iOS SDK emits: no ProfileReportedEvent and no Activity screen. ContentDeletedEvent.ParentId and ContentReportedEvent.ContentKind are only filled on Android.
Next steps
- Analytics — listen to these events and forward them to your analytics tool.
- A/B testing — measure the impact of the community.