Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bh-mobile-sdk

Package Overview
Dependencies
Maintainers
1
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bh-mobile-sdk - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

2

lib/index.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BH_MOBILE=t():e.BH_MOBILE=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.init=void 0;var r=n(3),i=o(r),u=n(1),a=o(u),s={};window.mamp=s,t["default"]=a["default"],t.init=i["default"]},function(e,t,n){"use strict";function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),u=r(i),a=n(2),s=r(a),c=n(5),d=o(c),l=null;t["default"]=function(){if(l)return l;var e=window.mamp,t={};return Object.keys(u["default"]).forEach(function(n){var o=u["default"][n],r=e[n]||{};t[n]={},Object.keys(o).forEach(function(e){var i=o[e],u=d[e];i&&(r[e]?u?t[n][e]=u(r[e]):r[e]&&(t[n][e]=r[e]):t[n][e]=function(){s["default"].wisedu?console.error("调用的"+n+"."+e+"接口不存在"):console.log("你当前不在 Hybrid 环境, "+e+" 处于 mock 实现")})})}),l=t}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={wisedu:/wisedu/.test(navigator.userAgent)}},function(e,t,n){(function(e){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=o(r),u=!1;t["default"]=function(t){if(u)return void console.error("请不要重复初始化");var n=function(){e.BH_MOBILE_SDK=(0,i["default"])(),t()};if(localStorage.getItem("wisedu-browser-debug")||/wisedu/.test(navigator.userAgent)===!1)n();else{var o="mamp://injectionmamp/cordova.js",r=document.createElement("script");r.src=o,document.head.appendChild(r),window.close=function(){window.location.href="mamp://close"},document.addEventListener("deviceready",n,!1)}u=!0}}).call(t,function(){return this}())},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={UI:{setNavHeader:!0,setTitleText:!0,preViewImages:!0,openWebView:!0,closeWebView:!0,actionSheet:!0,singleSelect:!0,multiSelect:!0,multiPicker:!0,alertView:!0,toggleNavBar:!0,webviewOnResume:!0,showToast:!0},systemAbility:{takeCamera:!0,takePhoto:!0},file:{uploadToOSS:!0},cpdaily:{showLoginView:!0,showOrHideTabbar:!0,showSettingView:!0,mainAppListChange:!0,openMarketList:!0,showMain:!0,getTenantID:!0,setStatusBarColor:!0,startIMChat:!0,onMineAppChanged:!0}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.webviewOnResume=function(e){var t=!1,n=[];return function(o){n.push(o),t||(e(function(){n.forEach(function(e){e()})}),t=!0)}}}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.BH_MOBILE=t():e.BH_MOBILE=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.init=void 0;var r=n(3),i=o(r),u=n(1),a=o(u),c={};window.mamp=c,t["default"]=a["default"],t.init=i["default"]},function(e,t,n){"use strict";function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),u=r(i),a=n(2),c=r(a),s=n(5),d=o(s),l=null;t["default"]=function(){if(l)return l;var e=window.mamp,t={};return Object.keys(u["default"]).forEach(function(n){var o=u["default"][n],r=e[n]||{};t[n]={},Object.keys(o).forEach(function(e){var i=o[e],u=d[e];i&&(r[e]?u?t[n][e]=u(r[e]):r[e]&&(t[n][e]=r[e]):t[n][e]=function(){c["default"].wisedu?console.error("调用的"+n+"."+e+"接口不存在"):console.log("你当前不在 Hybrid 环境, 或Hybrid 环境没有初始化, "+e+" 处于 mock 实现")})})}),l=t}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={wisedu:/wisedu/.test(navigator.userAgent)}},function(e,t,n){(function(e){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=o(r),u=!1;t["default"]=function(t){var n=function(){e.BH_MOBILE_SDK=(0,i["default"])(),t()};if(u)return n(),void console.error("请不要重复初始化");if(localStorage.getItem("wisedu-browser-debug")||/wisedu/.test(navigator.userAgent)===!1)n();else{var o="mamp://injectionmamp/cordova.js",r=document.createElement("script");r.src=o,document.head.appendChild(r),window.close=function(){window.location.href="mamp://close"},document.addEventListener("deviceready",n,!1)}u=!0}}).call(t,function(){return this}())},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={UI:{setNavHeader:!0,setTitleText:!0,preViewImages:!0,openWebView:!0,closeWebView:!0,actionSheet:!0,singleSelect:!0,multiSelect:!0,multiPicker:!0,alertView:!0,toggleNavBar:!0,webviewOnResume:!0,showToast:!0},systemAbility:{takeCamera:!0,takePhoto:!0},file:{uploadToOSS:!0},cpdaily:{showLoginView:!0,showOrHideTabbar:!0,showSettingView:!0,mainAppListChange:!0,openMarketList:!0,showMain:!0,getTenantID:!0,setStatusBarColor:!0,startIMChat:!0,onMineAppChanged:!0,zhugeioTrack:!0}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.webviewOnResume=function(e){var t=!1,n=[];return function(o){n.push(o),t||(e(function(){n.forEach(function(e){e()})}),t=!0)}}}])});
{
"name": "bh-mobile-sdk",
"version": "0.1.0",
"version": "0.1.1",
"description": "wisedu mobile web sdk",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -23,1 +23,26 @@ # Wisedu Mobile JavaScript SDK

## API
SDK 提供的 Api 是分模块的,先阶段一共有三大模块,`UI, systemAbility, file`
如果想调用某个 UI 模块下的的 api,`WISEDU_SDK.UI.closeWebView`
### UI
**setNavHeader(flag: Boolean)**
设置客户端原生头是否隐藏, 默认是显示的,传入 false 隐藏原生头
```javascript
WISEDU_SDK.UI.setNavHeader(false)
```
**setTitleText(title: String)**
设置原生头的 title
```javascript
WISEDU_SDK.UI.setTitleText('我是 title')
```

@@ -6,10 +6,11 @@ import SDK from './sdk'

export default (callback) => {
const _callback = () => {
global.BH_MOBILE_SDK = SDK()
callback()
}
if (INIT) {
_callback()
console.error('请不要重复初始化')
return
}
const _callback = () => {
global.BH_MOBILE_SDK = SDK()
callback()
}
if (localStorage.getItem('wisedu-browser-debug') || /wisedu/.test(navigator.userAgent) === false) {

@@ -16,0 +17,0 @@ _callback()

@@ -25,3 +25,3 @@ import whiteList from './whiteList'

} else {
console.log(`你当前不在 Hybrid 环境, ${apiKey} 处于 mock 实现`)
console.log(`你当前不在 Hybrid 环境, 或Hybrid 环境没有初始化, ${apiKey} 处于 mock 实现`)
}

@@ -28,0 +28,0 @@

@@ -40,4 +40,5 @@ /**

startIMChat: true,
onMineAppChanged: true
onMineAppChanged: true,
zhugeioTrack: true
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc