Documents

          Docs / Api Docs /Events

          Api Docs / Events

          Get user presence


          Gets the user presence. The service must implement this method to retrieve the user presence live data. When data is updated from ayoba, then ayoba calls this javascript method on service to pass the new data

          onPresenceChanged(presence)
          

          Example


          function onPresenceChanged(presence) {
              currentPresence = presence
            }
          
          Parameters
          presence
          presence
          • 0 Offline
          • 1 Online
          Returns
          No return value
          Permissions
          UserPresence

          Get user profile


          1. On Nickname Changed


          Gets the user nickname. The service must implement this method to retrieve the user nickname live data. When data is updated from ayoba, then ayoba calls this javascript method on service to pass the new data

          Example


              function onNicknameChanged(nickname) {
              currentNickname = nickname
            }
          
          Parameters
          nickname
          Returns
          No return value
          Permissions
          UserProfile

          2. On Avatar Changed


          Gets the user avatar. The service must implement this method to retrieve the user avatar live data. When data is updated from ayoba, then ayoba calls this javascript method on service to pass the new data

          onAvatarChanged(avatar)
          

          Example


             function onAvatarChanged(avatar) {
              currentAvatarPath = avatarPath
            }
          
          Parameters
          • nickname user nickname
          • avatarPath user profile picture URI
          Returns
          No return value
          Permissions
          UserProfile

          Get language


          Gets the user language code in ISO-639-1

          Ayoba.getLanguage()
          

          Example


          var languageCode = Ayoba.getLanguage();
          

          Parameters
          No parameters
          Returns
          String: the user’s ISO-639-1 language code. Example: en
          Permissions
          UserLanguage

          Send Generic Event


          Send a generic event to Firebase Analytics.

          function sendGenericEvent(eventNumber, description) {
            Ayoba.sendGenericEvent(eventNumber, description);
          }
          

          Example


          
          <script type="text/javascript">
              Ayoba.sendGenericEvent(1, "Generic Event Number 2"); // This will send an event called "genericEvent2"
          </script>
          
          
          Parameters
          • eventNumber
          eventNumber
          • 0: genericEvent1
          • 1: genericEvent2
          • 2: genericEvent3
          • 3: genericEvent4
          Returns
          No return value
          Permissions
          No permissions

          Next Steps

          That’s all to read on the Events documents. Continue to learn more about our APIs, next is some documentation on our Payment APIs

          Previous
          Media

          Next
          Payment Process