iT邦幫忙

第 12 屆 iThome 鐵人賽

DAY 20
2
Modern Web

認識LIFF容易嗎?系列 第 20

[Day 20] LIFF PermanentLink.setExtraQueryParam

  • 分享至 

  • xImage
  •  

前言

在昨天認識Permanent Link,今天的主角還是它。不過,它到底是用來做什麼?

liff.permanentLink.setExtraQueryParam()

在當前的Permanent Link中,加上查詢參數。

實作

liff.init({
 liffId: '後台取得的LIFF ID'
}) .then(() => {
   liff.permanentLink.setExtraQueryParam('user_tracking_id=8888') // 新增ExtraQueryParam
   // liff.permanentLink.setExtraQueryParam('user_tracking_id=9999') // 新增ExtraQueryParam
   // liff.permanentLink.setExtraQueryParam("") // 刪除ExtraQueryParam
   const myLink = liff.permanentLink.createUrl();
   console.log('liff.permanentLink.createUrl', myLink);
}
}).catch((err) => {
 console.log('初始化失敗')
});

重複執行,Permanent Link會被複寫

假如連續執行新增ExtraQueryParam,如下。最後新增的結果,會是最後執行的ExtraQueryParam。

liff.permanentLink.setExtraQueryParam('user_tracking_id=8888') // 新增ExtraQueryParam
liff.permanentLink.setExtraQueryParam('user_tracking_id=9999') // 新增ExtraQueryParam

image

刪除

執行liff.permanentLink.setExtraQueryParam(""),則會刪除先前新增的結果。
image

Mini APP

這篇,有介紹到Permanent Link可以用來分享LINE MINI App的頁面,反而LIFF URL無法做到這件事。

問題是什麼是LINE MINI App?
看到APP的第一個想法是,一般手機桌布上的應用程式。
image

之後查到幾篇文章的介紹,提到LINE App主頁中,有個服務的區塊:
image

兩者之間有什麼關係呢!?

不知道你是否也曾想買某個牌子或某樣東西的時候,特地下載相關優惠的APP,只為了得到那APP裡的折價卷!
最後手機桌面存在成山成海的應用程式,有時候因此找不到要用的APP。

LINE MINI App就是為了有效改善這樣的問題!

它主要是用LIFF進行開發,未來有機會能讓各企業上架自己的LINE MINI App在LINE裡,
如此一來,用戶只要打開LINE,就能享有各種企業的服務,擺脫手機桌面APP如海一樣大的噩夢(灑花)!

參考


上一篇
[Day 19] LIFF PermanentLink.createUrl
下一篇
[Day 21]LIFF SendMessages
系列文
認識LIFF容易嗎?30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 則留言

0
arguskao
iT邦新手 4 級 ‧ 2022-12-13 22:46:16

還是不知道什麼是Line MINI?

我要留言

立即登入留言