[{"data":1,"prerenderedAt":380},["ShallowReactive",2],{"h3634096186":3,"h566411151":241,"h3377920634":377},{"id":4,"title":5,"body":6,"description":28,"extension":232,"meta":233,"navigation":236,"path":237,"seo":238,"stem":239,"__hash__":240},"docs\u002Fen\u002Ftips\u002F2026\u002F09\u002F03\u002Fliff-request-friendship.md","Show the benefits of adding your LINE Official Account as a friend with the liff.requestFriendship() template property",{"type":7,"value":8,"toc":227},"minimark",[9],[10,11,12,20,25,29,41,50,64,75,161,167,170,177,190,195,204,207,217,221],"Tips",{},[13,14,17],"h1",{"id":15,"class":16},"","!mb-4",[18,19],"page-title",{},[21,22],"display-date",{"date":23,"class":24},"2026\u002F09\u002F03","!mb-20",[26,27,28],"p",{},"Hi! I’m Okajima, a technical writer in charge of documentation for the LINE Developers site.",[26,30,31,32,40],{},"You can use the ",[33,34,36],"a",{"href":35},"\u002Freference\u002Fliff\u002F#request-friendship",[37,38,39],"code",{},"liff.requestFriendship()"," method to prompt users to add a LINE Official Account as a friend in a LIFF app or LINE MINI App.",[26,42,43],{},[44,45],"img",{"alt":15,"className":46,"src":49},[47,48],"border","w-fix-320","\u002Fmedia\u002Fliff\u002Frequest-friendship\u002Frequest-friendship-add-friend-en.webp",[26,51,52,53,55,56,59,60,63],{},"The ",[37,54,39],{}," method was enhanced in LIFF v2.30.0 with support for the ",[37,57,58],{},"template"," property. With this property, you can select a suitable ",[33,61,58],{"href":62},"\u002Freference\u002Fliff\u002F#request-friendship-template"," from a predefined list and display it as the message prompting users to add the account as a friend.",[26,65,66,67,70,71,74],{},"For example, if you specify ",[37,68,69],{},"coupon"," in the ",[37,72,73],{},"template.id"," property, the message \"Get coupons and special offers from this official account.\" is displayed instead of the default message \"Add this official account as a friend?\".",[76,77,81],"pre",{"className":78,"code":79,"language":80,"meta":15,"style":15},"language-javascript shiki shiki-themes github-dark-default","try {\n  await liff.requestFriendship({\n    template: { id: \"coupon\" },\n  });\n} catch (error) {\n  console.log(error);\n}\n","javascript",[37,82,83,96,112,125,131,143,155],{"__ignoreMap":15},[84,85,88,92],"span",{"class":86,"line":87},"line",1,[84,89,91],{"class":90},"suJrU","try",[84,93,95],{"class":94},"sZEs4"," {\n",[84,97,99,102,105,109],{"class":86,"line":98},2,[84,100,101],{"class":90},"  await",[84,103,104],{"class":94}," liff.",[84,106,108],{"class":107},"sc3cj","requestFriendship",[84,110,111],{"class":94},"({\n",[84,113,115,118,122],{"class":86,"line":114},3,[84,116,117],{"class":94},"    template: { id: ",[84,119,121],{"class":120},"s9uIt","\"coupon\"",[84,123,124],{"class":94}," },\n",[84,126,128],{"class":86,"line":127},4,[84,129,130],{"class":94},"  });\n",[84,132,134,137,140],{"class":86,"line":133},5,[84,135,136],{"class":94},"} ",[84,138,139],{"class":90},"catch",[84,141,142],{"class":94}," (error) {\n",[84,144,146,149,152],{"class":86,"line":145},6,[84,147,148],{"class":94},"  console.",[84,150,151],{"class":107},"log",[84,153,154],{"class":94},"(error);\n",[84,156,158],{"class":86,"line":157},7,[84,159,160],{"class":94},"}\n",[26,162,163],{},[44,164],{"alt":15,"className":165,"src":166},[47,48],"\u002Fmedia\u002Ftips\u002F2026\u002Fliff-request-friendship-coupon-en.png",[26,168,169],{},"This allows you to do more than simply prompt users to add the account as a friend—you can also explain the benefits they'll receive afterward. This information can help users who are unsure decide whether to add the account, making them more likely to do so.",[26,171,172,173,176],{},"There are 15 templates, including \"Coupons\", \"Events and rewards\", and \"Important announcements\". You can choose the one that most closely matches the experience users will gain by adding the account as a friend. For more information, see ",[33,174,175],{"href":62},"Template"," in the LIFF API reference.",[26,178,179,185,186],{},[44,180],{"alt":15,"className":181,"src":184},[47,48,182,183],"inline-block","mb-0-important","\u002Fmedia\u002Ftips\u002F2026\u002Fliff-request-friendship-event-reward-en.png"," ",[44,187],{"alt":15,"className":188,"src":189},[47,48,182],"\u002Fmedia\u002Ftips\u002F2026\u002Fliff-request-friendship-important-announcement-en.png",[191,192,194],"h2",{"id":193},"wrap-up","Wrap-up",[26,196,197,198,200,201,203],{},"With the ",[37,199,58],{}," property of the ",[37,202,39],{}," method, you can not only prompt users to add an account as a friend but also explain the benefits they'll receive afterward.",[26,205,206],{},"Find a template that suits your service and use it to design a user flow that encourages users to add your LINE Official Account as a friend.",[26,208,209,210,212,213,176],{},"For more information about the ",[37,211,39],{}," method, see ",[33,214,215],{"href":35},[37,216,39],{},[218,219,220],"style",{},"html pre.shiki code .suJrU, html code.shiki .suJrU{--shiki-default:#FF7B72}html pre.shiki code .sZEs4, html code.shiki .sZEs4{--shiki-default:#E6EDF3}html pre.shiki code .sc3cj, html code.shiki .sc3cj{--shiki-default:#D2A8FF}html pre.shiki code .s9uIt, html code.shiki .s9uIt{--shiki-default:#A5D6FF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",[222,223],"tags",{"tags":224,"lang":225,"section":226},"liff, line-mini-app","en","tips",{"title":15,"searchDepth":127,"depth":133,"links":228},[229],{"id":230,"depth":98,"text":231},"wrap-up-wrap-up","Wrap-up {#wrap-up}","md",{"date":234,"tags":224,"locale":225,"sidebar":235},"2026-09-03 00:00 UTC",false,true,"\u002Fen\u002Ftips\u002F2026\u002F09\u002F03\u002Fliff-request-friendship",{"title":5,"description":28},"en\u002Ftips\u002F2026\u002F09\u002F03\u002Fliff-request-friendship","8xU_v32LkHXe_IIoLAh4OMf7AWkxS-sHWq-11ICeAPg",{"id":4,"title":5,"body":242,"description":28,"extension":232,"meta":375,"navigation":236,"path":237,"seo":376,"stem":239,"__hash__":240},{"type":7,"value":243,"toc":372},[244],[10,245,246,250,252,254,260,265,273,279,331,336,338,342,350,352,358,360,368,370],{},[13,247,248],{"id":15,"class":16},[18,249],{},[21,251],{"date":23,"class":24},[26,253,28],{},[26,255,31,256,40],{},[33,257,258],{"href":35},[37,259,39],{},[26,261,262],{},[44,263],{"alt":15,"className":264,"src":49},[47,48],[26,266,52,267,55,269,59,271,63],{},[37,268,39],{},[37,270,58],{},[33,272,58],{"href":62},[26,274,66,275,70,277,74],{},[37,276,69],{},[37,278,73],{},[76,280,281],{"className":78,"code":79,"language":80,"meta":15,"style":15},[37,282,283,289,299,307,311,319,327],{"__ignoreMap":15},[84,284,285,287],{"class":86,"line":87},[84,286,91],{"class":90},[84,288,95],{"class":94},[84,290,291,293,295,297],{"class":86,"line":98},[84,292,101],{"class":90},[84,294,104],{"class":94},[84,296,108],{"class":107},[84,298,111],{"class":94},[84,300,301,303,305],{"class":86,"line":114},[84,302,117],{"class":94},[84,304,121],{"class":120},[84,306,124],{"class":94},[84,308,309],{"class":86,"line":127},[84,310,130],{"class":94},[84,312,313,315,317],{"class":86,"line":133},[84,314,136],{"class":94},[84,316,139],{"class":90},[84,318,142],{"class":94},[84,320,321,323,325],{"class":86,"line":145},[84,322,148],{"class":94},[84,324,151],{"class":107},[84,326,154],{"class":94},[84,328,329],{"class":86,"line":157},[84,330,160],{"class":94},[26,332,333],{},[44,334],{"alt":15,"className":335,"src":166},[47,48],[26,337,169],{},[26,339,172,340,176],{},[33,341,175],{"href":62},[26,343,344,185,347],{},[44,345],{"alt":15,"className":346,"src":184},[47,48,182,183],[44,348],{"alt":15,"className":349,"src":189},[47,48,182],[191,351,194],{"id":193},[26,353,197,354,200,356,203],{},[37,355,58],{},[37,357,39],{},[26,359,206],{},[26,361,209,362,212,364,176],{},[37,363,39],{},[33,365,366],{"href":35},[37,367,39],{},[218,369,220],{},[222,371],{"tags":224,"lang":225,"section":226},{"title":15,"searchDepth":127,"depth":133,"links":373},[374],{"id":230,"depth":98,"text":231},{"date":234,"tags":224,"locale":225,"sidebar":235},{"title":5,"description":28},{"toc":378,"fullToc":378},[379],{"id":193,"depth":98,"text":194},1789620294563]