Skip to main content

You are viewing Agora Docs forBeta products and features. Switch to Docs

Release notes

The Agora Signaling SDK provides a streamlined and stable messaging mechanism for you to quickly implement real-time messaging for various scenarios. See product overview for more information.

This page contains information on the following releases:

v2.1.7

v2.1.7 was released on November 17, 2023.

v2.1.6

v2.1.6 was released on September 18, 2023.

Compatibility changes

If you use the features mentioned in this section, ensure that you modify the implementation of the relevant features after upgrading the SDK.

  1. Multiple connection region settings

    To support setting multiple connection regions simultaneously, this release changes the parameter type of areaCode from RtmAreaCode to EnumSet<RtmAreaCode>. Refer to the following sample code to update your implementation:


    _3
    // Before v2.1.6
    _3
    RtmConfig config = new RtmConfig();
    _3
    config.code = RtmConstants.RtmAreaCode.GLOB;


    _5
    // v2.1.6
    _5
    RtmConfig config = new RtmConfig.Builder(myAppId, mUserId)
    _5
    .eventListener(eventListener)
    _5
    .areaCode(EnumSet.of(RtmConstants.RtmAreaCode.AS, RtmConstants.RtmAreaCode.CN))
    _5
    .build();

  2. RTMConfig Constructor optimization

    This release changes the constructor pattern of RTMConfig to the builder pattern. Refer to the following sample code to update your implementation:


    _6
    // Before v2.1.6
    _6
    RtmConfig config = new RtmConfig();
    _6
    config.appId = myAppId;
    _6
    config.userId = mUserId;
    _6
    config.eventListener = eventListener;
    _6
    config.logConfig = logConfig;


    _5
    // v2.1.6
    _5
    RtmConfig config = new RtmConfig.Builder(myAppId, mUserId)
    _5
    .eventListener(eventListener)
    _5
    .logConfig(logConfig)
    _5
    .build();

  3. Callback name changes

    This release changes the name of the onConnectionStateChange callback to onConnectionStateChanged.

New features

  1. Multiple ways to add event listeners

    This release adds the addEventListener and removeEventListener methods. In addition to adding or removing an event listener object during initialization, you can also call the new methods to add or remove one or more event listener objects at any time during the app's lifecycle.

    Furthermore, to enhance the experience of setting event listeners, this release no longer requires implementing all events of the RtmEventListener. You only need to implement the events that you need. See the following sample code:


    _19
    RtmEventListener eventListener = new RtmEventListener() {
    _19
    @Override
    _19
    public void onMessageEvent(MessageEvent event) {
    _19
    String text = "Message received from " + event.publisher + " Message: " + event.message.getData() + "\n";
    _19
    writeToMessageHistory(text);
    _19
    }
    _19
    _19
    @Override
    _19
    public void onPresenceEvent(PresenceEvent event) {
    _19
    String text = "receive presence event, user: " + event.publisher + " event: " + event.type + "\n";
    _19
    writeToMessageHistory(text);
    _19
    }
    _19
    _19
    @Override
    _19
    public void onConnectionStateChanged(String mChannelName, RtmConstants.RtmConnectionState state, RtmConstants.RtmConnectionChangeReason reason) {
    _19
    String text = "Connection state changed to " + state + ", Reason: " + reason + "\n";
    _19
    writeToMessageHistory(text);
    _19
    }
    _19
    };

  2. New struct constructors

    This release adds the constructor for the following structs:

    • JoinChannelOptions
    • JoinTopicOptions
    • MetadataItem
    • MetadataOptions
    • GetOnlineUsersOptions
    • RtmEncryptionConfig
    • RtmLogConfig
    • RtmProxyConfig
    • StateItem
    • SubscribeOptions
    • TopicOptions

    You can continue using the previous implementation, or refer to the following sample code to update your implementation:


    _6
    // Before v2.1.6
    _6
    SubscribeOptions options = new SubscribeOptions();
    _6
    options.withMessage = true;
    _6
    options.withMetadata = false;
    _6
    options.withPresence = true;
    _6
    options.withLock = false;


    _9
    // v2.1.6
    _9
    // Method one: passing parameters
    _9
    SubscribeOptions options = new SubscribeOptions(true, true, false, false);
    _9
    // Method two: set method
    _9
    SubscribeOptions options = new SubscribeOptions();
    _9
    options.setWithMessage(true);
    _9
    options.setWithMetadata(false);
    _9
    options.setWithPresence(true);
    _9
    options.setWithLock(false);

Improvements

This release improves the performance of setting the presence event notification in JoinChannelOptions.

Fixed issues

This release fixed the following issues:

  • Occasional inability to log out of the RTM system when the network status changed.
  • Occasional inability to log in to the RTM system after logging out when the network status changed.
  • When the network was disconnected, users occasionally did not receive the SNAPSHOT event notification due to that the app did not clear data.
  • When a user joined a channel and switched the app to the background and then back to the foreground, the SDK occasionally triggered the REMOTE_JOIN event notification multiple times.

Signaling