Package zendesk.chat

Interface ProfileProvider



  • public interface ProfileProvider
    A provider to access and control visitor profile information.

    You can access it as follows:

         ProfileProvider profileProvider = Chat.INSTANCE.providers().profileProvider();
     

    Make sure to initialize Zendesk Chat SDK first before accessing the providers, see Chat.init(Context, String) for more details.

    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method and Description
      void addVisitorTags(java.util.List<java.lang.String> tags, <any> callback)
      Adds the tags to the visitor profile.
      void appendVisitorNote(java.lang.String note)
      Appends the note to an existing note on the visitor profile.
      void appendVisitorNote(java.lang.String note, <any> callback)
      Deprecated. 
      use #appendVisitorNote(String note) instead Appending visitor notes does not return an acknowledgement from the chat server. Therefore callbacks are redundant.
      void clearVisitorNotes(<any> callback)
      Clears all visitor notes.
      VisitorInfo getVisitorInfo()
      Gets the current information about the visitor
      void observeVisitorInfo(ObservationScope observationScope, <any> observer)
      Registers an observer to be notified when the visitor info changes.
      void removeVisitorTags(java.util.List<java.lang.String> tags, <any> callback)
      Removes the tags from the visitor profile.
      void setVisitorInfo(VisitorInfo visitorInfo, <any> callback)
      Sets the information about the visitor.
      void setVisitorNote(java.lang.String note)
      Sets the note on the visitor profile.
      void setVisitorNote(java.lang.String note, <any> callback)
      Deprecated. 
      use #setVisitorNote(String note) instead Setting visitor notes does not return an acknowledgement from the chat server. Therefore callbacks are redundant.
      void trackVisitorPath(VisitorPath visitorPath, <any> callback)
      Tracks the current location of the visitor.
    • Method Detail

      • trackVisitorPath

        void trackVisitorPath(VisitorPath visitorPath,
                              <any> callback)
        Tracks the current location of the visitor.

        Once the location is tracked, you can see the navigation history of the visitor in the Zendesk Chat dashboard. Sends a visitor path to the Zendesk Chat backend.

        Visitor paths persists across chat sessions.

        Parameters:
        visitorPath - an instance of VisitorPath
        callback - optional callback for success and error handling
      • setVisitorInfo

        void setVisitorInfo(VisitorInfo visitorInfo,
                            <any> callback)
        Sets the information about the visitor.

        Visitor information persists across chat sessions.

        Parameters:
        visitorInfo - the information about the visitor
        callback - optional callback for success and error handling
      • getVisitorInfo

        VisitorInfo getVisitorInfo()
        Gets the current information about the visitor
        Returns:
        The current VisitorInfo or null if there is no cached value
      • addVisitorTags

        void addVisitorTags(java.util.List<java.lang.String> tags,
                            <any> callback)
        Adds the tags to the visitor profile.

        Visitor tags persists across chat sessions.

        Parameters:
        tags - list of tags to be added
        callback - optional callback for success and error handling
      • removeVisitorTags

        void removeVisitorTags(java.util.List<java.lang.String> tags,
                               <any> callback)
        Removes the tags from the visitor profile.

        Visitor tags persists across chat sessions.

        Parameters:
        tags - list of tags to be removed
        callback - optional callback for success and error handling
      • setVisitorNote

        @Deprecated
        void setVisitorNote(java.lang.String note,
                            <any> callback)
        Deprecated. use #setVisitorNote(String note) instead Setting visitor notes does not return an acknowledgement from the chat server. Therefore callbacks are redundant.
        Sets the note on the visitor profile.

        This will overwrite any existing notes

        Visitor notes persists across chat sessions.

        Parameters:
        note - the String value to be set as a note
        callback - optional callback for success and error handling
      • setVisitorNote

        void setVisitorNote(java.lang.String note)
        Sets the note on the visitor profile.

        This will overwrite any existing notes

        Visitor notes persists across chat sessions.

        Parameters:
        note - the String value to be set as a note
      • appendVisitorNote

        @Deprecated
        void appendVisitorNote(java.lang.String note,
                               <any> callback)
        Deprecated. use #appendVisitorNote(String note) instead Appending visitor notes does not return an acknowledgement from the chat server. Therefore callbacks are redundant.
        Appends the note on the visitor profile.

        This will overwrite any existing notes

        Visitor notes persists across chat sessions.

        Parameters:
        note - the String value to be set as a note
        callback - optional callback for success and error handling
      • appendVisitorNote

        void appendVisitorNote(java.lang.String note)
        Appends the note to an existing note on the visitor profile.

        Visitor notes persists across chat sessions.

        Parameters:
        note - the note to append
      • clearVisitorNotes

        void clearVisitorNotes(<any> callback)
        Clears all visitor notes.
        Parameters:
        callback - optional callback for success and error handling
      • observeVisitorInfo

        void observeVisitorInfo(ObservationScope observationScope,
                                <any> observer)
        Registers an observer to be notified when the visitor info changes.

        The VisitorInfo can be changed by the visitor by calling #setVisitorInfo(VisitorInfo, ZendeskCallback) or by an agent in the dashboard.

        Parameters:
        observationScope - the lifespan of the observation
        observer - the observer to be notified