GithubHelp home page GithubHelp logo

react-liff-boilerplate's Introduction

react-liff-boilerplate

Starter Kit for ReactJs developer to run and learn LINE Frontend Framework (LIFF)

How it work

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.

Install

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

Demo

Profile : http://localhost:3000

SendMessage : http://localhost:3000/message

LIFF Window : http://localhost:3000/window

API

Get Profile

Utility class liffHelper automatic initial LIFF when application launched. You can get user profile with command

liffHelper.getProfile()
   .then(profile => {
      // do something
   });

Get LIFF Info

Get User Context information

liffHelper.getLIFFInfo();

return result

Send Message

const message = messagingApiHelper.createTextMessage('text');
liffHelper.sendMessages(message);

LIFF Window

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

Author

Sitthi Thiammekha

react-liff-boilerplate's People

Contributors

kamnan43 avatar yusef-ho avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.