TrueApp integration

Everything a TrueApp app needs to open the TrueVisions NOW mini-app signed in: which token to send, how to open any page with it, and what the viewer sees. Every page requires a signed-in viewer; there is no guest mode.

At a glance

TrueApp
Partner slugtrueapp
Base URLhttps://mini-app.truevisions.co.th/[th|en]/trueapp
Credentialtrueapp-authorization (HTTP header)
Also acceptedpartner_token (body), Authorization: Bearer, trueapp-access-token, x-partner-token, auth_token (query, openweb deep link)
Sign-in pathTrueID AAA: request code → binding page only if AAA asks → token exchange.
How to open a pageGET the page URL with the token headers (a POST works too).

Step by step

  1. Set up the WebView. JavaScript, DOM storage, inline media playback, autoplay without a gesture and protected media. See Install in your app and DRM in WebViews.
  2. Pick the page the viewer should land on from Pages you can open, in th or en, and add ?embed=1.
  3. Open it with the token. Load that URL with the trueapp-authorization header and the device headers. Copy-paste code is in Examples.
  4. Let the redirects run. The server asks AAA for a code and exchanges it; the WebView gets a 303back to the same page, signed in. If the viewer has never linked TrueID, AAA's binding page opens first (TrueID login + OTP), then returns to the same page.
  5. Listen to the bridge. ready, auth-state, open-content, close, orientation, subscribe, sign-in. See postMessage bridge.
  6. Re-sign-in when asked. On sign-in (the stream lookup rejected the token), open the message's returnUrl the same way as step 3 with a fresh token. Sessions last about an hour; after that any page asks again.
  7. Test on pre-production with your own test accounts before going live (see Testing).

Pages you can open

All of these accept the token the same way. mOdBP4KN5vd3 is a real series title on pre-production; use any content id from the feeds.

PageURLWhat it shows
Partner home/th/trueapp?embed=1Landing page with the partner's shelves.
Sport/th/trueapp/sport?embed=1All live and upcoming sport, grouped by day.
Series/th/trueapp/series?embed=1All series and movies in the free catalogue.
The Voice 2026/th/trueapp/thevoice?embed=1The Voice shelf page.
Content detail/th/trueapp/content/mOdBP4KN5vd3?embed=1One title: synopsis, episodes, Watch Now.
Player/th/trueapp/play/mOdBP4KN5vd3?embed=1Full-screen player; a series starts at episode 1.
Player, one episode/th/trueapp/play/mOdBP4KN5vd3?ep=<EPISODE_ID>&embed=1Jump to a specific episode.
Live channel/th/trueapp/watch/<CHANNEL_ID>?embed=1Live TV player for one channel.

Examples

Raw requests for the four most common pages. The response is a redirect chain; let the WebView follow it.

All seriesHTTP
GET https://mini-app.truevisions.co.th/th/trueapp/series?embed=1
trueapp-authorization: <TRUEAPP_CUSTOMER_TOKEN>
trueapp-device-id: <DEVICE_ID>
trueapp-session-id: <SESSION_ID>
trueapp-platform: ANDROID
trueapp-version: <APP_VERSION>
Sport scheduleHTTP
GET https://mini-app.truevisions.co.th/th/trueapp/sport?embed=1
trueapp-authorization: <TRUEAPP_CUSTOMER_TOKEN>
trueapp-device-id: <DEVICE_ID>
trueapp-session-id: <SESSION_ID>
trueapp-platform: ANDROID
trueapp-version: <APP_VERSION>
Content detail pageHTTP
GET https://mini-app.truevisions.co.th/th/trueapp/content/mOdBP4KN5vd3?embed=1
trueapp-authorization: <TRUEAPP_CUSTOMER_TOKEN>
trueapp-device-id: <DEVICE_ID>
trueapp-session-id: <SESSION_ID>
trueapp-platform: ANDROID
trueapp-version: <APP_VERSION>
Straight into the playerHTTP
GET https://mini-app.truevisions.co.th/th/trueapp/play/mOdBP4KN5vd3?embed=1
trueapp-authorization: <TRUEAPP_CUSTOMER_TOKEN>
trueapp-device-id: <DEVICE_ID>
trueapp-session-id: <SESSION_ID>
trueapp-platform: ANDROID
trueapp-version: <APP_VERSION>
Android (Kotlin)Kotlin
// Opens any mini-app page signed in: GET the page with your token headers.
// loadUrl sends the extra headers on the first request only, which is all
// sign-in needs; the page keeps the session after that.
fun openMiniApp(webView: WebView, path: String, token: String) {
    webView.loadUrl(
        "https://mini-app.truevisions.co.th/th/trueapp" + path,
        mapOf(
            "trueapp-authorization" to token,
            "trueapp-device-id" to deviceId,
            "trueapp-session-id" to sessionId,
            "trueapp-platform" to "ANDROID",
            "trueapp-version" to appVersion
        )
    )
}

openMiniApp(webView, "/sport?embed=1", token)
openMiniApp(webView, "/series?embed=1", token)
openMiniApp(webView, "/content/mOdBP4KN5vd3?embed=1", token)
openMiniApp(webView, "/play/mOdBP4KN5vd3?embed=1", token)
iOS (Swift)Swift
// Opens any mini-app page signed in: GET the page with your token headers.
func openMiniApp(_ webView: WKWebView, path: String, token: String) {
    var request = URLRequest(url: URL(string: "https://mini-app.truevisions.co.th/th/trueapp" + path)!)
    request.setValue(token, forHTTPHeaderField: "trueapp-authorization")
    request.setValue(deviceId, forHTTPHeaderField: "trueapp-device-id")
    request.setValue(sessionId, forHTTPHeaderField: "trueapp-session-id")
    request.setValue("iOS", forHTTPHeaderField: "trueapp-platform")
    request.setValue(appVersion, forHTTPHeaderField: "trueapp-version")
    webView.load(request)
}

openMiniApp(webView, path: "/sport?embed=1", token: token)
openMiniApp(webView, path: "/series?embed=1", token: token)
openMiniApp(webView, path: "/content/mOdBP4KN5vd3?embed=1", token: token)
openMiniApp(webView, path: "/play/mOdBP4KN5vd3?embed=1", token: token)
Web (iframe): an iframe can't send headers, so POST a form into itHTML
<iframe name="tvs" allow="autoplay; fullscreen; encrypted-media" style="width:100%;height:100%;border:0"></iframe>

<form id="tvs-open" method="post" target="tvs" action="https://mini-app.truevisions.co.th/th/trueapp/series?embed=1">
  <input type="hidden" name="partner_token" value="<TRUEAPP_CUSTOMER_TOKEN>">
  <input type="hidden" name="platform" value="WEB">
</form>
<script>document.getElementById("tvs-open").submit()</script>

<!-- Other pages: change the form action, e.g.
     https://mini-app.truevisions.co.th/th/trueapp/sport?embed=1
     https://mini-app.truevisions.co.th/th/trueapp/content/mOdBP4KN5vd3?embed=1 -->
HeaderExampleMeaning
trueapp-device-id<DEVICE_ID>Stable device id you already report to TrueID.
trueapp-session-id<SESSION_ID>Your app session id.
trueapp-platformANDROIDANDROID or iOS. Picks the AAA client id (3946 / 3945).
trueapp-version<APP_VERSION>Your app version, e.g. 9.12.0.

If a page is opened without a token

The page sends the viewer to the TrueID login page (identity.trueid.net) and brings them back to the same page once they log in. That works, but it makes the viewer log in again inside your app, so always open pages with the token.

When sign-in fails

The WebView lands on /th/trueapp/auth/error?code=…, a localised page with a Back to home button.

CodeMeaningWhat to do
missing_credentialsNo token found in the request.Check the header name: trueapp-authorization.
aaa_10032AAA says the partner token is expired or invalid.Refresh your token and open the page again.
aaa_14229The account has no mobile number and cannot be linked.Show your own guidance; retrying won't help.
request_codeAAA could not be reached or refused the request.Retry; contact us if it persists.
exchangeThe code could not be exchanged for a token.Open the page again.
invalid_stateThe sign-in link expired (10 minutes) or was tampered with.Open the page again.

Testing

  • Pre-production base URL: https://mini-app.truevisions.co.th. It talks to TrueID pre-production (identity.trueid-preprod.net).
  • Pre-production TrueID accounts can be real accounts: purchases may charge real money. Use the test accounts from onboarding.
  • In the WebView's network log the first request is your page URL with the token, then a 303 back to the same URL with #at=…, which the page removes from the address bar at once.