# News: [Updated] LIFF v2.4.0 released

[Updated] LIFF v2.4.0 released

Added on September 24, 2020

LIFF v2.4.0 is no longer recommended due to a bug in the transition to another LIFF app without closing your current LIFF app feature.

Items Before the changes After the changes
LIFF SDK 2.4.0 2.4.1
LINE 10.16.0 10.18.0

If you are using LIFF v2.4.0, we recommend that you update to v2.4.1.

We have released LIFF v2.4.0. The changes in LIFF v2.4.0 are as follows:

# You can now use liff.closeWindow() before the LIFF app is initialized

You can now use the liff.closeWindow() method before the initialization of the LIFF app, even before the initialization of the LIFF app by liff.init() has finished.

Condition to execute the liff.closeWindow() method before initializing the LIFF app

To use the liff.closeWindow() method before the initialization of the LIFF app by liff.init() has finished, your LIFF SDK version must be v2.4.0 or later, and the user's LINE version must be 10.15.0 or later.

You can close the LIFF app with the liff.closeWindow() method if the LIFF app fails to initialize due to a network error, the user's LINE version, etc., as shown below.

liff
  .init({
    liffId: "123456-abcedfg" // Use own liffId
  })
  .then(() => {
    // Start to use liff's api
  })
  .catch((err) => {
    // Error happens during initialization
    console.log(err.code, err.message);
    liff.closeWindow();
  });

For more information, see liff.closeWindow() in the LIFF API Reference.

# You can now transition to another LIFF app without closing your current LIFF app

If you click the link to another LIFF app within a LIFF app whose screen is on Full display, you can display the other app while still having the LIFF browser open.
The LIFF browser doesn't close, so you can return to the original LIFF app with the return button from the LIFF browser.

Conditions for moving to another LIFF app without closing the current LIFF app (added on September 24, 2020)

There was a bug in LIFF v2.4.0 that prevented the feature from working properly. These changes have been made to the operating conditions for this feature:

  • LIFF SDK v2.4.1 or later and LINE 10.18.0 or later
  • The original LIFF app screen is set to Full display
  • The LIFF app to which you are moving is correctly initialized by liff.init()

LIFF-apps-transition

For more information, see Opening a LIFF app from another LIFF app in the LIFF Document.

# The error that LIFF URLs are redirected to unexpected URLs was fixed

An additional information (path/?key=value) specified in a LIFF URL is included in the liff.state query parameter for the primary redirected URL. When the liff.state query parameter contains an additional information, it might be redirected to an unexpected secondary redirected URL as follows.

Conditions that cause this error
  • When the liff.state query parameter doesn't begin with /
  • When setting Methods for converting additional information in the LIFF URL to Replace (Backward compatibility mode)

For example, if Endpoint URL is set to https://example.com and the liff.state query parameter is assigned to path, it was redirected to https://example.compath because the domain name and the path were not separated by /.
In the LIFF v2.4.0, this error has been fixed so that the URL above is now correctly redirected to https://example.com/path.

For more information on behaviors when accessing a LIFF URL, see Behaviors from accessing the LIFF URL to opening the LIFF app.

# liff.permanentLink.createUrl() error was fixed

When information, such as query parameter (?key=value) or URL fragment (#URL-fragment), was included in the LIFF endpoint URL, on occasion, the additional information section was not accurately reflected in the permanent link when liff.permanentLink.createUrl() was executed. This error has been fixed.

# The error of fragment not being included in the secondary redirct URL was fixed

When a fragment was included in the LIFF endpoint URL or LIFF URL, regardless of settings based on Methods for converting additional information in the LIFF URL, the secondary redirect URL would not include a fragment. This error has been fixed.

For more details on the secondary redirect URL or how it is affected by settings based on Methods for converting additional information in the LIFF URL, see the LIFF document Operation from accessing LIFF URL to opening LIFF App.