This is a small web application that demonstrates the basic functionality of the LINE Front-end Framework (LIFF).
- A channel on the LINE Developers Console for your application.
- A channel access token
- A Heroku account or Azure account
- Click the above "Deploy to Heroku button".
- Fill in the required information on the "Create a New App" page in Heroku.
- Select Deploy app and confirm that your app is successfully deployed.
- Record the app URL (https://{Heroku app name}.herokuapp.com). You will set this URL when you add the app to LIFF.
- Click the above "Deploy to Azure" button.
- Fill in the required information on the "Custom deployment" page in Azure portal.
- BASIC
- Resource group: Select or Create new
- Location: Select one which is close to your location. e.g. (Asia Pacific) Japan East
- SETTINGS
- Web Site Name: Set your site name which will determine the URL (https://{websitename}.azurewebsites.net). You will set this URL when you add the app to LIFF.
- Click the "Purchase" button and confirm that your app is successfully deployed. (It won't cost any as long as you keep Sku App Svc Plan = F1 by default)
Add the app to LIFF. For more information, see Adding a LIFF app.
- To run this application, host these files on a web server.
- Set your LIFF's entryUrl to point to index.html.
- Open your LIFF in the LINE app.
To open the LIFF app within the LINE app, follow the steps below.
-
Tap
line://app/{liffId}
on the chat screen of the LINE app.{liffId}
is the LIFF app ID returned to the API request to add the app to LIFF. -
Agree to grant the required permissions to the LIFF app.
-
When opening the LIFF app, the following four buttons and the content of received information are displayed.
- Open Window: Opens
https://line.me
in the in-app browser of the LINE app. - Close Window: Closes the LIFF app.
- Get Access Token: Gets the current user's access token.
- Get Profile: Gets the current user's profile.
- Send Messages: Sends a sample message on behalf of the user if the LIFF app is opened in the chat screen.
- Open Window: Opens
For API calls associated with the buttons, see Calling the LIFF API. For the received information, see Initializing the LIFF app.
To get more information, you can check the logs of your app using Heroku CLI.
-
Log in to Heroku from the command line.
$ heroku login
-
Check the logs.
$ heroku logs --app {Heroku app name} --tail
You can download the starter app to your local machine to test and make changes for yourself. You can then deploy the app to a web server of your choice. Here, we'll look at how to make and deploy changes to the Heroku app you created in the previous step.
-
Make sure you have the following installed
-
Clone the line-liff-starter GitHub repository.
git clone https://github.com/line/line-liff-starter.git
-
cd
into your Git directory. -
Add a remote for Heroku to your local repository.
$ heroku git:remote -a {Heroku app name}
-
Make edits and commit changes (optional).
$ git add . $ git commit -m "First commit"
-
Push changes to Heroku master.
$ git push heroku master