• English
  • Evoke Wallet Parameters

    This page describes the URL shapes used when the Pakistan cashier launches the Easypaisa / Jazzcash wallet apps, and how to handle them in three contexts: system browser H5, in-app native code, and in-app WebView (iOS and Android).

    Nigeria Pay With Wallet uses schemes such as pay:// to open PalmPay. See Android in-app cashier launch and iOS in-app cashier launch. Pakistan Pay with MoMo follows the same WebView rules below.

    Scenarios overview

    ScenarioDescription
    System browser H5User opens the cashier in Safari / Chrome; the page navigates via location.href or <a href> and the OS handles the handoff.
    In-app WebViewMerchant loads cashier H5 in a WebView; custom schemes (e.g. easypaisa://) and Android intent:// often do not hand off automatically—the client must intercept navigation and open the URL with the system.
    In-app nativeIf native code builds the launch URL directly, use the same system “open URL” APIs as after a WebView intercept.

    Pakistan — URL shapes by platform

    H5 / general: URLs the cashier may trigger

    iOS (system browser and any URL ultimately handed to the OS)

    • Easypaisa: easypaisa://
    • Jazzcash: jazzcash://

    Android (Chrome and similar often use intent://; the OS resolves it to the app)

    • Easypaisa: intent://easypaisa.onelink.me/miniapp#Intent;scheme=https;package=pk.com.telenor.phoenix;end
    • Jazzcash: intent://deeplink#Intent;scheme=jazzcash;package=com.techlogix.mobilinkcustomer;end

    In some environments the cashier may fall back to plain schemes (easypaisa:// / jazzcash://); treat them like any other custom scheme on Android as below.

    iOS: in-app (WebView and native)

    1. Let the OS handle non-http(s) links
      In webView(_:decidePolicyFor:navigationAction:) (or equivalent), detect navigationAction.request.url schemes such as easypaisa, jazzcash (and pay where applicable): return .cancel for that navigation so the WebView does not show an error page, then call UIApplication.shared.open(url) with the full URL so the wallet app can open.
    2. Optional: canOpenURL and declared queries
      Add easypaisa, jazzcash (and any others you need) to LSApplicationQueriesSchemes in Info.plist if you call canOpenURL; otherwise iOS may restrict the result.
    3. Native-only launch
      Build easypaisa:// / jazzcash:// as URL and open with UIApplication.shared.open—same as after a WebView intercept.

    Android: in-app (WebView and native)

    1. Intercept WebView navigations
      In shouldOverrideUrlLoading (or the WebResourceRequest callback):
      • intent://: Intent.parseUri(url, Intent.URI_INTENT_SCHEME) then startActivity; add fallback handling if required (e.g. package / browser).
      • easypaisa://, jazzcash://, etc.: Intent(Intent.ACTION_VIEW, Uri.parse(url)) then startActivity.
        Return true (or consume the load) so the WebView does not load the URL internally.
    2. Native-only launch
      • intent://: same Intent.parseUri + startActivity.
      • Custom schemes: ACTION_VIEW + Uri.parse.
    3. Reference
      PalmpayDemoAndroid - WebViewActivity.kt
    4. Platform notes
      From Android 11, package visibility affects resolveActivity and explicit launches; configure queries / intent-filter per official docs if you detect “not installed” incorrectly.

    In-app demo code

    Minimal patterns below: native from any screen; WebView on the WKWebView / WebView that loads cashier H5. Add error UI, analytics, and other schemes (e.g. Nigeria pay://) in production.

    iOS (Swift)

    1) Native: open the deep link URL directly

    import UIKit
    
    /// Call from a button tap or payment callback; pass the full string, e.g. easypaisa:// / jazzcash://
    func openWalletDeepLink(_ urlString: String) {
        guard let url = URL(string: urlString) else { return }
        UIApplication.shared.open(url, options: [:], completionHandler: nil)
    }
    
    // Examples:
    // openWalletDeepLink("easypaisa://")
    // openWalletDeepLink("jazzcash://")

    2) WebView: WKNavigationDelegate — cancel and hand off to the system

    import UIKit
    import WebKit
    
    final class CashierWebViewController: UIViewController, WKNavigationDelegate {
    
        private lazy var webView: WKWebView = {
            let wv = WKWebView(frame: .zero, configuration: WKWebViewConfiguration())
            wv.navigationDelegate = self
            wv.translatesAutoresizingMaskIntoConstraints = false
            return wv
        }()
    
        override func viewDidLoad() {
            super.viewDidLoad()
            view.addSubview(webView)
            NSLayoutConstraint.activate([
                webView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor),
                webView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
                webView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
                webView.bottomAnchor.constraint(equalTo: view.bottomAnchor),
            ])
            // Replace with checkoutUrl from your pre-order API
            if let url = URL(string: "https://example.com/your-checkout") {
                webView.load(URLRequest(url: url))
            }
        }
    
        func webView(
            _ webView: WKWebView,
            decidePolicyFor navigationAction: WKNavigationAction,
            decisionHandler: @escaping (WKNavigationActionPolicy) -> Void
        ) {
            guard let url = navigationAction.request.url,
                  let scheme = url.scheme?.lowercased() else {
                decisionHandler(.allow)
                return
            }
            if scheme == "http" || scheme == "https" {
                decisionHandler(.allow)
                return
            }
            if scheme == "javascript" {
                decisionHandler(.allow)
                return
            }
            decisionHandler(.cancel)
            UIApplication.shared.open(url, options: [:], completionHandler: nil)
        }
    }

    Declare easypaisa, jazzcash, etc. under LSApplicationQueriesSchemes in Info.plist if you use canOpenURL.

    Android (Kotlin)

    1) Native: single entry for intent:// and custom schemes

    import android.content.ActivityNotFoundException
    import android.content.Context
    import android.content.Intent
    import android.net.Uri
    
    fun openWalletDeepLink(context: Context, urlString: String) {
        try {
            val intent = if (urlString.startsWith("intent:", ignoreCase = true)) {
                Intent.parseUri(urlString, Intent.URI_INTENT_SCHEME)
            } else {
                Intent(Intent.ACTION_VIEW, Uri.parse(urlString))
            }
            context.startActivity(intent)
        } catch (_: ActivityNotFoundException) {
            // App not installed or scheme not registered — toast or H5 fallback
        }
    }
    
    // Examples:
    // openWalletDeepLink(context, "intent://easypaisa.onelink.me/miniapp#Intent;scheme=https;package=pk.com.telenor.phoenix;end")
    // openWalletDeepLink(context, "intent://deeplink#Intent;scheme=jazzcash;package=com.techlogix.mobilinkcustomer;end")
    // openWalletDeepLink(context, "easypaisa://")

    2) WebView: WebViewClient — intercept non-http(s) URLs

    import android.content.Context
    import android.content.Intent
    import android.net.Uri
    import android.webkit.WebResourceRequest
    import android.webkit.WebView
    import android.webkit.WebViewClient
    
    class WalletAwareWebViewClient : WebViewClient() {
    
        override fun shouldOverrideUrlLoading(view: WebView, request: WebResourceRequest): Boolean {
            val url = request.url.toString()
            if (url.startsWith("http://", true) || url.startsWith("https://", true)) {
                return false
            }
            return openExternal(view.context, url)
        }
    
        @Deprecated("Deprecated in Java")
        override fun shouldOverrideUrlLoading(view: WebView, url: String?): Boolean {
            if (url.isNullOrBlank()) return false
            if (url.startsWith("http://", true) || url.startsWith("https://", true)) {
                return false
            }
            return openExternal(view.context, url)
        }
    
        private fun openExternal(context: Context, urlString: String): Boolean {
            return try {
                val intent = if (urlString.startsWith("intent:", ignoreCase = true)) {
                    Intent.parseUri(urlString, Intent.URI_INTENT_SCHEME)
                } else {
                    Intent(Intent.ACTION_VIEW, Uri.parse(urlString))
                }
                context.startActivity(intent)
                true
            } catch (_: Exception) {
                true // still consume so WebView does not load intent:// as a page
            }
        }
    }
    
    // Usage: webView.webViewClient = WalletAwareWebViewClient()

    For more branches, see PalmpayDemoAndroid - WebViewActivity.kt.

    System browser H5 (reference)

    In Safari / Chrome, navigations to the URLs above are usually handled by the OS without extra wrapping on the merchant web page, as long as the cashier domain, HTTPS, and product configuration are correct.

    Summary

    • H5 browser: iOS schemes and Android intent:// (or fallback schemes) as listed.
    • App WebView: do not let the WebView load launch URLs alone; intercept and open with the OS (iOS UIApplication.open; Android Intent.parseUri / ACTION_VIEW).
    • App native: same URLs and APIs as after a successful WebView intercept.