🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

necomicredirector

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

necomicredirector

尝试唤起网易漫画APP,唤起不成功跳下载

latest
npmnpm
Version
1.1.8
Version published
Weekly downloads
2
-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

插件用于cms或外包活动尝试打开网易漫画APP场景

(1)尝试唤起APP,如果未安装APP则跳转下载页场景

(2)尝试唤起APP,如果未安装APP则h5打开对应页面场景

使用

直接引用:下载/dist/bundle.js到工程中即可调用NEComicreDirector.pageRedirect()方法完成跳转

<script src="dist/bundle.js"></script>

npm: 通过npm引入然后直接调用pageRedirect()完成跳转

import {pageRedirect} from 'necomicredirector'

参数为Object类型,参数同jsbridge pageRedirect跳转类型参数参考jsbridge wiki 如:

参数属性类型描述
pathStringh5跳转应用内页面
queryObjecth5跳转应用内页面参数
h5FallbackBoolean非必须参数,如果跳转不成功是否使用h5打开对应页面,而非跳下载,默认为false(打不开则跳下载)

尝试APP内嵌打开内嵌页,打不开跳下载

      NEComicRedirector.pageRedirect({
          path: 'webview',//表示用APP内嵌打开
          query: {
              url: location.href,//打开的链接地址
              title: '网易漫画',
              auth: false
          }
      })

尝试APP内嵌打开内嵌页,失败则直接浏览器打开

      NEComicRedirector.pageRedirect({
          path: 'webview',//表示用APP内嵌打开
          query: {
              url: location.href,//打开的链接地址
              title: '网易漫画',
              auth: false
          },
          h5Fallback: true
      })

尝试APP打开漫画详情页,打不开跳下载

    NEComicRedirector.pageRedirect({
            path: 'detail',//path='detail'表示使用APP打开漫画详情页面
            query: {
                id: '4508538831870127506'//漫画bookId
            }
        })

尝试APP打开漫画详情页,失败使用h5打开详情页

 NEComicRedirector.pageRedirect({
            path: 'detail',//path='detail'表示使用APP打开漫画详情页面
            query: {
                id: '4508538831870127506'//漫画bookId
            },
            h5Fallback: true
        })

APP打开话题页

        NEComicRedirector.pageRedirect({
            path: 'topic',
            query: {
                id: '3042276'//话题id
            }
        });

APP打开阅读器

     NEComicRedirector.pageRedirect({
            path: 'reader',
            query: {
                id: '4508538831870127506',//bookid
                sectionId: '5085798221480150048'//sectionId
            }
        });

FAQs

Package last updated on 02 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts