line / line-platform-feedback

LINE Platform feedback
https://developers.line.me
76 stars 14 forks source link

Make LIFF user-agent different than general web links #102

Closed dlackty closed 6 years ago

dlackty commented 6 years ago

We're playing around LIFF and looking for a way to determine whether user is requesting via LIFF or just a normal web link.

However, the current implementation returns Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16A5308e Safari Line/8.8.0 for both LIFF and common webview. So there's basically no way to tell if user's requesting page under LIFF or not.

tori3 commented 6 years ago

As you say, can not distinguish using user-agent or others. So it is recommended to develop LIFF application separately from other application.

Also, in environments where it does not work as LIFF App, error callback is called in LIFF.init() so you can use it. https://developers.line.me/ja/docs/liff/reference/#initialize-liff-app