package com.yidian.shenghuoquan.newscontent.ui

import android.os.Bundle
import android.util.Log
import android.view.View
import android.view.Window
import androidx.appcompat.app.AppCompatActivity
import com.yidian.common.XRouterPathConstants.Companion.FLASH
import com.yidian.xpage.XPageManager

class DeepLinkActivity: AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        requestWindowFeature(Window.FEATURE_NO_TITLE)
        super.onCreate(savedInstanceState)
        setContentView(View(this))
        getDataFromBrowser()
    }

    private fun getDataFromBrowser() {
        val uri = intent.data
        Log.e("zhb-yd", "deepUri:$uri")
        val scheme = uri?.scheme
        val host = uri?.host
        val deepData = uri?.getQueryParameter("deep_data")
        Log.e("zhb-yd", "scheme:$scheme====host:$host====deepJson:$deepData")
        val paramsMap = HashMap<String, Any?>()
        paramsMap["jumpFrom"] = "DeepLink"
        paramsMap["deepData"] = deepData
        XPageManager.push(FLASH, paramsMap)
        finish()
    }
}