Hive provides a list of Hive friends, sends Hive messages between friends, and invites friends. Those functions listed below can be performed by the user on the Hive homepage, and you can also provide them within the game using the Hive API.

Searching Hive Friend Lists

You must specify the types of friends when you request the Hive friend lists. Select the array type among friends types below, and then set the array type as a parameter to implement getFriends() method in the SocialHive class. User can get the friend lists as a result.

  • Hive friends installed the game which the user currently plays: FriendType.IN_GAME
  • Hive friends not installed the game which the user currently plays: FriendType.OUT_GAME
  • Hive friends inviting to the game which the user currently plays: FriendType.INVITED
  • All Hive friends: FriendType.ALL_GAME

Followings are sample codes to search the list of friends playing the same game.

Unity®

API Reference: hive.SocialHive.getFriends

C++

API Reference: SocialHive::getFriends

Android

API Reference: com.hive.SocialHive.getFriends

iOS

API Reference: HIVESocialHive:getFriends

Inviting Hive Friends

A Hive friend is a relationship that is made through the user’s address book, Facebook interlock, or Hive friend request and acceptance.

To display friend lists for sending invitations, see Searching Hive Friend Lists section.

To send invitations to Hive friends, implement sendInvitationMessage() method in the SocialHive class and ensure to deliver MessageContent object as the first parameter of this function.

Unity®

API Reference: hive.SocialHive.sendInvitationMessage

C++

API Reference: SocialHive::sendInvitationMessage

Android

API Reference: com.hive.SocialHive.sendInvitationMessage

iOS

API Reference: SocialHive:sendInvitationMessage

Sending Messages to Hive Friends

When user sends a message to Hive friend, Hive sends push notification to the message receiver. The medium of notification on receiver’s device is one of follows:

  • The game which sender delivers messages from
  • The game which receiver recently plays connected with Hive

Hive sends push notifications if users set to opt in the notifications on their device even when receivers does not play games. When the receiver gets a push notification and tap it, the relevant game starts. So, make sure to provide the UI which connects with Hive messages.

To send Hive messages, implement sendMessage() method in the SocialHive class. Ensure that MessageContent object, sent to the first parameter from this method contains messages as well as additional information. Check the result of implementing sendMessage() method through the callback function, onSendMessageHiveCB().

Followings are sample codes to send messages to Hive friends.

Unity®

API Reference: hive.SocialHive.sendMessage

C++

API Reference: SocialHive::sendMessage

Android

API Reference: com.hive.SocialHive.sendMessage

iOS

API Reference: SocialHive:sendMessage

Displaying Message Badge

Design a message icon as you want and apply it to games to display ‘New’ badge. Check whether ‘New’ badge is required or not only when Hive message icon is displayed.

Badge Display Policy

Comply with the following policies to display and hide badges

  • Display badges when: Unread new messages exist.
  • Hide badges when: All messages are read. Reading a message means that user reads the message at the detail page. That is, checking message list is not considered as reading messages.
  • Indicate badges: With capital letter N. Do not display the number of messages unread.

New message check

To display ‘New’ badge, check whether new messages exist. To check new messages, implement getBadgeInfo() method in the SocialHive class. You can check the result of implementation through the callback function, onSocialBadge().
Followings are sample codes to check new messages.

Unity®

API Reference: hive.SocialHive.getBadgeInfo

C++

API Reference: SocialHive::getBadgeInfo

Android

API Reference: com.hive.SocialHive.getBadgeInfo

iOS

API Reference: SocialHive:getBadgeInfo

Reference: MessageContent class

Name Type Description Required
vid String Message receiver’s VID

Ensure to define vid when uid field is null

Optional
uid String Message receiver’s UID

Optional
message String(512) The contents of message. Unlimited language Required
imageUrl String Image URL attached in messages Optional
thumbnailUrl String Thumbnail URL attached in messages.
It is required when imageUrl field is input
Optional
usePush Boolean Push notification type to use the OS notification on device or not

  • true: means push notification of receiver’s device is in use
  • false: means push notification of receiver’s device is not in use. The receiver cannot recognize new messages unless checking the message box while playing a game
  • Default: false
Optional