line / line-liff-v2-starter

This is a small web application that demonstrates the basic functionality of the LINE Front-end Framework (LIFF).
Apache License 2.0
336 stars 374 forks source link

Liff initialize in SPA appear INIT_FAILED #8

Closed ianccy closed 4 years ago

ianccy commented 4 years ago

When i init liff in SPA website ( LiffId get by API ) , sometimes it will appear error INIT_FAILED. I use this starter sample. I found if i use init Liff with settimeout, i will appear INIT_FAILED. How INIT_FAILED work ?

I need to immediately as soon as i can, but it not stable.

And after run after .catch(), it will redirect to error page with error code queryString by liff . But it will lose another queryString. Can i prevent error redirect ?

WWK563388548 commented 4 years ago

It's happening on my project as well.(Only Line in-app browser of android system)

smwilk commented 4 years ago

@Ianpig @WWK563388548 Thanks for raising this topic. line-liff-v2-starter uses the window.onload function to start its initialisation. If your SPA has an onload or onMount function, could you try moving the contents of the onload function to there? Otherwise, if you can share your application code or some code to replicate the issue, I can investigate it further.

asccclass commented 4 years ago

LINE did not support SPA page, use jquery or Ajax.

smwilk commented 4 years ago

@asccclass There are no restrictions with the use of LIFF with single page applications. That being said, the purpose of this starter app is to help developers find and interact with features of LIFF without having to to write too much code. If you're having trouble incorporating this kit into your SPA, I would recommend using the SDK directly and following our LIFF development guide.

smwilk commented 4 years ago

Closing this issue due to lack of activity.