LINE
LINE is a messaging app from LY Corporation. Protocol Launcher allows you to generate official LINE URL scheme links for opening LINE app screens, LIFF apps, and LINE MINI Apps.
Usage
There are two ways to use this library:
- On-Demand import from subpaths enables tree-shaking and keeps bundles small.
- Full Import from the root package is convenient but includes all app modules.
Pick On-Demand for production builds; Full Import is fine for quick scripts or demos.
Select Installation Method
LINE's current official URL scheme documentation supports URLs beginning with https://line.me/R/, https://liff.line.me/, and https://miniapp.line.me/. It is supported in LINE for iOS and LINE for Android, and isn't supported in LINE for PC (macOS, Windows). The deprecated line:// and LIFF v1 URL forms are intentionally not exposed.
Camera and Location
Open the camera, camera roll, or location screen. LINE documents camera and camera roll links as chat-only, and the location link as only for one-on-one chats with a LINE Official Account.
import { openCamera, openCameraRollSingle, openCameraRollMulti, openLocation } from 'protocol-launcher/line'
const cameraUrl = openCamera()
const singleImageUrl = openCameraRollSingle()
const multiImageUrl = openCameraRollMulti()
const locationUrl = openLocation()Official Accounts
Open or share a LINE Official Account profile, LINE VOOM, business profile, LINE VOOM post, or chat screen. Official Account IDs in path segments are percent-encoded; LINE VOOM and business profile URLs use the ID without the at-sign (@) prefix. LINE notes that the percent-encoded recommendOA form doesn't work on LINE versions earlier than 13.8.0 for Android.
import { openOfficialAccountProfile, recommendOfficialAccount, openOfficialAccountVoom, openOfficialAccountBusinessProfile, openOfficialAccountVoomPost, openOfficialAccountChat } from 'protocol-launcher/line'
const profileUrl = openOfficialAccountProfile({
lineId: '@linedevelopers',
})
const recommendUrl = recommendOfficialAccount({
lineId: '@linedevelopers',
})
const voomUrl = openOfficialAccountVoom({
lineId: 'linedevelopers',
})
const businessProfileUrl = openOfficialAccountBusinessProfile({
lineId: 'linedevelopers',
})
const voomPostUrl = openOfficialAccountVoomPost({
lineId: 'linedevelopers',
postId: '1234567890',
})
const chatUrl = openOfficialAccountChat({
lineId: '@linedevelopers',
text: 'Hi there!',
})Share and Profile
Open LINE's Share with screen with text, the user's My profile screen, or the user's LINE ID screen.
import { shareText, openMyProfile, openProfileSetId } from 'protocol-launcher/line'
const shareUrl = shareText({
text: 'Hi there!',
})
const myProfileUrl = openMyProfile()
const lineIdUrl = openProfileSetId()Common Screens
Open LINE's Chats, Shopping, Wallet, Add friends, LINE Official Accounts, and LINE VOOM Following screens.
import { openChats, openShopping, openWallet, openAddFriends, openOfficialAccounts, openVoomFollowing } from 'protocol-launcher/line'
const chatsUrl = openChats()
const shoppingUrl = openShopping()
const walletUrl = openWallet()
const addFriendsUrl = openAddFriends()
const officialAccountsUrl = openOfficialAccounts()
const voomFollowingUrl = openVoomFollowing()Settings
Open LINE settings screens. LINE documents different theme settings URLs for iOS and Android, so the helpers expose separate functions for each platform.
import { openSettings, openAccountSettings, openAuthorizedApps, openConnectedDevices, openPrivacySettings, openStickerSettings, openMyStickers, openThemeSettingsIos, openThemeSettingsAndroid, openMyThemes, openNotificationAuthorizedApps, openChatSettings, openDisplaySuggestions, openCallSettings, openFriendsSettings, openVoomSettings } from 'protocol-launcher/line'
const settingsUrl = openSettings()
const accountUrl = openAccountSettings()
const authorizedAppsUrl = openAuthorizedApps()
const connectedDevicesUrl = openConnectedDevices()
const privacyUrl = openPrivacySettings()
const stickerSettingsUrl = openStickerSettings()
const myStickersUrl = openMyStickers()
const themeSettingsIosUrl = openThemeSettingsIos()
const themeSettingsAndroidUrl = openThemeSettingsAndroid()
const myThemesUrl = openMyThemes()
const notificationsUrl = openNotificationAuthorizedApps()
const chatSettingsUrl = openChatSettings()
const suggestionsUrl = openDisplaySuggestions()
const callSettingsUrl = openCallSettings()
const friendsSettingsUrl = openFriendsSettings()
const voomSettingsUrl = openVoomSettings()Sticker and Theme Shops
Open Sticker Shop pages, sticker ranking tabs, sticker authors, and Theme Shop product pages.
import { openSticker, openStickerCategoryRanking, openStickerAuthor, openStickerShop, openStickerShopRank, openStickerShopNew, openStickerShopFree, openStickerShopCategories, openTheme } from 'protocol-launcher/line'
const stickerUrl = openSticker({
packageId: 11537,
})
const categoryRankingUrl = openStickerCategoryRanking({
categoryId: 21,
})
const authorUrl = openStickerAuthor({
authorId: 12345,
})
const stickerShopUrl = openStickerShop()
const rankUrl = openStickerShopRank()
const newUrl = openStickerShopNew()
const freeUrl = openStickerShopFree()
const categoriesUrl = openStickerShopCategories()
const themeUrl = openTheme({
productId: '0bac8fed-4c75-40c5-9982-e9ecc3b9d191',
})LIFF and MINI Apps
Open a LIFF app or create a LINE MINI App permanent link. Both helpers support additional path, query, and hash information documented by LINE.
import { openLiff, openMiniApp } from 'protocol-launcher/line'
const liffUrl = openLiff({
liffId: '1234567890-AbcdEfgh',
path: '/path_A/path_B/',
query: {
key1: 'value1',
key2: 'value2',
},
hash: 'URL-fragment',
})
const miniAppUrl = openMiniApp({
liffId: '123456-abcedfg',
path: '/shop',
query: {
search: 'shoes',
},
hash: 'item10',
})External Browser
Add LINE's official query parameters for opening a target URL in an external browser or, on Android, a Chrome custom tab. LINE documents that these parameters are not supported on LIFF apps, so the helpers reject LIFF app URLs such as https://liff.line.me/... and LINE MINI App URLs such as https://miniapp.line.me/....
import { openExternalBrowser, openAndroidChromeCustomTab } from 'protocol-launcher/line'
const externalBrowserUrl = openExternalBrowser({
url: 'https://example.com/',
})
const chromeCustomTabUrl = openAndroidChromeCustomTab({
url: 'https://example.com/path?foo=bar#section',
})