Starter Kit for ReactJs developer to run and learn LINE Frontend Framework (LIFF)
This project build from create-react-app and bootstrap. Then add Line Frontend Framework (LIFF) SDK and also provide LiffHelper
and messagingApiHelper
to help in communicate with LINE LIFF Platform.
Clone and run
npm install
Create config file in JSON and named it as config.json
{
"line" : {
"channelAccessToken": "YOUR_CHANNEL_ACCESS_TOKEN"
}
}
Run
npm start
then you can access http://localhost:3000
Profile : http://localhost:3000
SendMessage : http://localhost:3000/message
LIFF Window : http://localhost:3000/window
Utility class liffHelper
automatic initial LIFF when application launched. You can get user profile with command
liffHelper.getProfile()
.then(profile => {
// do something
});
Get User Context information
liffHelper.getLIFFInfo();
return result
const message = messagingApiHelper.createTextMessage('text');
liffHelper.sendMessages(message);
liffHelper.openWindow('https://url.com', false); // open url in LINE browser
liffHelper.openWindow('https://url.com', true); // open url in external browser
liffHelper.closeWindow(); // close LIFF window
Sitthi Thiammekha