• Unity打包出来的app跳转网页,并从网页调转回app(ios,Android)


    1.https://www.jianshu.com/p/eed01a661186 ios Scheme讲解

    2.https://www.jianshu.com/p/da801097c79d Android Scheme讲解

    3.https://blog.csdn.net/qq_16628781/article/details/51539715 Android调用

    ios中:

    Info -> URL Types设置URL Schemes,然后这个时候打包到手机中

    在Safari浏览器中输入 :  yigedemohahaha://  就可以跳回应用...

    Android中:

    需要在你工程的AndroidMainifest.xml中注册一下:

    我是这样写的:

        <intent-filter>
            <data
                android:host="yigedemo"
                android:scheme="hahaha"
                />
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.BROWSABLE" />
            <category android:name="android.intent.category.DEFAULT"/>
          </intent-filter>
          <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
            <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
          </intent-filter>
    

      详情参照置顶的第二个链接..

    网页中:

    <a href="hahaha://yigedemo">详情</a>

     然后UnityPlayerActivity中的 onNewIntent 方法中调用,参考第三个链接的博文...

        @Override protected void onNewIntent(Intent intent)
        {
            // To support deep linking, we need to make sure that the client can get access to
            // the last sent intent. The clients access this through a JNI api that allows them
            // to get the intent set on launch. To update that after launch we have to manually
            // replace the intent with the one caught here.
            setIntent(intent);
    
            Uri uri = intent.getData();
            String url = uri.toString();
            String query = uri.getQuery();
            Log.e("TurnURL", "query: "+query );
            if (query!=null&&query!="")
            {
                Log.e("TurnURL", "url: "+url );
                String scheme = uri.getScheme();
                Log.e("TurnURL", "scheme: "+scheme );
                String host = uri.getHost();
                Log.e("TurnURL", "host: "+host );
                int port = uri.getPort();
                Log.e("TurnURL", "port: "+port );
                String path = uri.getPath();
                Log.e("TurnURL", "path: "+path );
                String goosID = uri.getQueryParameter("goosId");
                Log.e("TurnURL", "goosID: "+goosID );
            }
        }
    

      

      

  • 相关阅读:
    hbase Compaction
    hadoop集群 动态添加或删除节点
    Hadoop节点迁移
    Spark程序运行常见错误解决方法以及优化
    用python执行sql来验证数据是否准时导入了目标库
    kylin2.3版本启用jdbc数据源(可以直接通过sql生成hive表,省去手动导数据到hive,并建hive表的麻烦)
    phoenix 二级索引使用实践
    jenkins任务失败,发送邮件通知
    Coolite学习
    MySql连接和授权命令
  • 原文地址:https://www.cnblogs.com/jbw752746541/p/9646185.html
Copyright © 2020-2023  润新知