LIFF vs LINEϛχΞϓϦ
Excerpted from LINE API Use Case
LIFF App LINEϛχΞϓϦ
Tech Stack LIFF SDK LIFF SDK
Operation Env
LINE App (SP)
General Browsers (PC, SP)
LINE App (SP)
LINE review and
approval
None Required
Service Message
chat room
Not available Available to all apps
Slide 19
Slide 19 text
Samples for LIFF Appᶃ
LINE Family Services
LINE Official
Account
LINE NEWS LINE Sticker Shop
Slide 20
Slide 20 text
Samples for LIFF Appᶄ
Third Party Apps
ϓϨΠϧʔϜ THE BINGO enpay
Slide 21
Slide 21 text
Characteristics of LIFF
The strengths of LIFF as a platform
Ϋϩεϒϥβʔαϙʔτ
༷ʑͳΟϯυλΠϓ
ϢʔςΟϦςΟͷఏڙ ಠࣗͷڧྗͳػೳ
LINE Login / τʔΫը໘࿈ܞ
͋ͳͨͷLIFF APIΛ࡞ΕΔ
LIFFϓϥάΠϯ
liff
.use({
name: 'simpleHooks',
install({ hooks }) {
hooks.init.before(async () => console.log('before hook is called'));
hooks.init.after(async () => console.log('after hook is called'));
},
})
.init({ liffId: 'your_liff_id' });
// before hook is called
// after hook is called
SDKͷAPIͷίʔϧόοΫؔొ
Slide 72
Slide 72 text
LIFFϓϥάΠϯ
import { SyncHook, AsyncHook } from '@liff/hooks';
class GreetPlugin {
name = 'greet';
hooks = {
helloBefore: new SyncHook(),
helloAfter: new AsyncHook(),
};
install() {
return {
hello: (name = 'World') => {
this.hooks.helloBefore.call();
console.log(`Hello, ${name}!`);
this.hooks.helloAfter.call();
},
};
}
}
ϓϥάΠϯಠࣗͷίʔϧόοΫΠϕϯτͷ࡞
Slide 73
Slide 73 text
LIFFϓϥάΠϯ
liff
.use(new GreetPlugin())
.use({
name: 'simpleHook',
install({ hooks }) {
hooks.$greet.helloBefore(
() => console.log('helloBefore is called’)
);
hooks.$greet.helloAfter(
async () => console.log('helloAfter is called')
);
},
})
.$greet.hello('LIFF Plugin');
// helloBefore is called
// Hello, LIFF Plugin!
// helloAfter is called
ϓϥάΠϯಠࣗͷίʔϧόοΫΠϕϯτͷ࡞
LIFFϓϥάΠϯ
liff.use(new DeepDivePlugin());
// liff.login() called after liff.init() automatically
// and you can use the following:
// liff.$deepdive.shareMessages()
// liff.$deepdive.readQrCode()