初始化fy
This commit is contained in:
44
uni_modules/UniDevTools/node_modules/@dcloudio/uni-push/dist/uni-push-v1.plus.es.js
generated
vendored
Normal file
44
uni_modules/UniDevTools/node_modules/@dcloudio/uni-push/dist/uni-push-v1.plus.es.js
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
function initPushNotification() {
|
||||
// 仅 App 端
|
||||
if (typeof plus !== 'undefined' && plus.push) {
|
||||
plus.globalEvent.addEventListener('newPath', ({ path }) => {
|
||||
if (!path) {
|
||||
return;
|
||||
}
|
||||
// 指定的页面为当前页面
|
||||
const pages = getCurrentPages();
|
||||
const currentPage = pages[pages.length - 1];
|
||||
if (currentPage &&
|
||||
currentPage.$page &&
|
||||
currentPage.$page.fullPath === path) {
|
||||
return;
|
||||
}
|
||||
// 简单起见,先尝试 navigateTo 跳转,失败后,再尝试 tabBar 跳转
|
||||
uni.navigateTo({
|
||||
url: path,
|
||||
fail(res) {
|
||||
if (res.errMsg.indexOf('tabbar') > -1) {
|
||||
uni.switchTab({
|
||||
url: path,
|
||||
fail(res) {
|
||||
console.error(res.errMsg);
|
||||
},
|
||||
});
|
||||
}
|
||||
else {
|
||||
console.error(res.errMsg);
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// @ts-expect-error
|
||||
uni.invokePushCallback({
|
||||
type: 'enabled',
|
||||
offline: true,
|
||||
});
|
||||
Promise.resolve().then(() => {
|
||||
initPushNotification();
|
||||
});
|
||||
259
uni_modules/UniDevTools/node_modules/@dcloudio/uni-push/dist/uni-push.es.js
generated
vendored
Normal file
259
uni_modules/UniDevTools/node_modules/@dcloudio/uni-push/dist/uni-push.es.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
45
uni_modules/UniDevTools/node_modules/@dcloudio/uni-push/dist/uni-push.plus.es.js
generated
vendored
Normal file
45
uni_modules/UniDevTools/node_modules/@dcloudio/uni-push/dist/uni-push.plus.es.js
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
function initPushNotification() {
|
||||
// 仅 App 端
|
||||
if (typeof plus !== 'undefined' && plus.push) {
|
||||
plus.globalEvent.addEventListener('newPath', ({ path }) => {
|
||||
if (!path) {
|
||||
return;
|
||||
}
|
||||
// 指定的页面为当前页面
|
||||
const pages = getCurrentPages();
|
||||
const currentPage = pages[pages.length - 1];
|
||||
if (currentPage &&
|
||||
currentPage.$page &&
|
||||
currentPage.$page.fullPath === path) {
|
||||
return;
|
||||
}
|
||||
// 简单起见,先尝试 navigateTo 跳转,失败后,再尝试 tabBar 跳转
|
||||
uni.navigateTo({
|
||||
url: path,
|
||||
fail(res) {
|
||||
if (res.errMsg.indexOf('tabbar') > -1) {
|
||||
uni.switchTab({
|
||||
url: path,
|
||||
fail(res) {
|
||||
console.error(res.errMsg);
|
||||
},
|
||||
});
|
||||
}
|
||||
else {
|
||||
console.error(res.errMsg);
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// @ts-expect-error
|
||||
uni.invokePushCallback({
|
||||
type: 'enabled',
|
||||
offline: true,
|
||||
});
|
||||
Promise.resolve().then(() => {
|
||||
initPushNotification();
|
||||
plus.push.setAutoNotification && plus.push.setAutoNotification(false);
|
||||
});
|
||||
39
uni_modules/UniDevTools/node_modules/@dcloudio/uni-push/lib/gtpush-min.d.ts
generated
vendored
Normal file
39
uni_modules/UniDevTools/node_modules/@dcloudio/uni-push/lib/gtpush-min.d.ts
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
declare namespace GtPush {
|
||||
/**
|
||||
* 设置调试模式
|
||||
* @param debugMode 打开或关闭调试模式
|
||||
*/
|
||||
function setDebugMode(debugMode: boolean): void
|
||||
/**
|
||||
* 重新连接或断开socket
|
||||
* @param enable
|
||||
*/
|
||||
function enableSocket(enable: boolean): void
|
||||
/**
|
||||
* 初始化GtPush
|
||||
*/
|
||||
function init(obj: {
|
||||
/**
|
||||
* 个推官网生成的appid
|
||||
*/
|
||||
appid: string
|
||||
/**
|
||||
* 错误回调
|
||||
*/
|
||||
onError?: (res: { error: any }) => void
|
||||
/**
|
||||
* 个推终端ID回调,标识当前终端和应用
|
||||
*/
|
||||
onClientId?: (res: { cid: string }) => void
|
||||
/**
|
||||
* 个推终端ID在线状态回调
|
||||
*/
|
||||
onlineState?: (res: { online: boolean }) => void
|
||||
/**
|
||||
* 推送消息回调
|
||||
*/
|
||||
onPushMsg?: (res: { message: string }) => void
|
||||
}): void
|
||||
|
||||
}
|
||||
export default GtPush
|
||||
88
uni_modules/UniDevTools/node_modules/@dcloudio/uni-push/lib/gtpush-min.js
generated
vendored
Normal file
88
uni_modules/UniDevTools/node_modules/@dcloudio/uni-push/lib/gtpush-min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
32
uni_modules/UniDevTools/node_modules/@dcloudio/uni-push/lib/gtpush-min.js.LICENSE.txt
generated
vendored
Normal file
32
uni_modules/UniDevTools/node_modules/@dcloudio/uni-push/lib/gtpush-min.js.LICENSE.txt
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
/*!
|
||||
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.com/yui/license.html
|
||||
version: 2.9.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fileOverview
|
||||
* @name asn1-1.0.js
|
||||
* @author Kenji Urushima kenji.urushima@gmail.com
|
||||
* @version asn1 1.0.13 (2017-Jun-02)
|
||||
* @since jsrsasign 2.1
|
||||
* @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
|
||||
*/
|
||||
|
||||
/** @preserve
|
||||
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
||||
* derived from CryptoJS.mode.CTR
|
||||
* Jan Hruby jhruby.web@gmail.com
|
||||
*/
|
||||
|
||||
/** @preserve
|
||||
(c) 2012 by Cédric Mesnil. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
81
uni_modules/UniDevTools/node_modules/@dcloudio/uni-push/lib/uni.plugin.js
generated
vendored
Normal file
81
uni_modules/UniDevTools/node_modules/@dcloudio/uni-push/lib/uni.plugin.js
generated
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
'use strict';
|
||||
|
||||
var path = require('path');
|
||||
var uniCliShared = require('@dcloudio/uni-cli-shared');
|
||||
|
||||
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
||||
|
||||
var path__default = /*#__PURE__*/_interopDefault(path);
|
||||
|
||||
var index = () => [
|
||||
uniCliShared.defineUniMainJsPlugin((opts) => {
|
||||
let isEnableV1 = false;
|
||||
let isEnableV2 = false;
|
||||
let isOffline = false;
|
||||
let configModulePush = false;
|
||||
return {
|
||||
name: 'uni:push',
|
||||
enforce: 'pre',
|
||||
config(config, env) {
|
||||
if (uniCliShared.isSsr(env.command, config)) {
|
||||
return;
|
||||
}
|
||||
const inputDir = process.env.UNI_INPUT_DIR;
|
||||
const platform = process.env.UNI_PLATFORM;
|
||||
isEnableV1 = uniCliShared.isEnableUniPushV1(inputDir, platform);
|
||||
isEnableV2 = uniCliShared.isEnableUniPushV2(inputDir, platform);
|
||||
configModulePush = uniCliShared.hasPushModule(inputDir);
|
||||
// v1
|
||||
if (isEnableV1) {
|
||||
return;
|
||||
}
|
||||
if (!isEnableV2) {
|
||||
return;
|
||||
}
|
||||
// v2
|
||||
isOffline = platform === 'app' && uniCliShared.isUniPushOffline(inputDir);
|
||||
if (isOffline) {
|
||||
return;
|
||||
}
|
||||
return {
|
||||
define: {
|
||||
'process.env.UNI_PUSH_DEBUG': false,
|
||||
},
|
||||
};
|
||||
},
|
||||
resolveId(id) {
|
||||
if (id === '@dcloudio/uni-push') {
|
||||
let file = 'dist/uni-push.es.js';
|
||||
if (isEnableV1) {
|
||||
file = 'dist/uni-push-v1.plus.es.js';
|
||||
}
|
||||
else if (isOffline) {
|
||||
file = 'dist/uni-push.plus.es.js';
|
||||
}
|
||||
return uniCliShared.resolveBuiltIn(path__default.default.join('@dcloudio/uni-push', file));
|
||||
}
|
||||
},
|
||||
transform(code, id) {
|
||||
if (!opts.filter(id)) {
|
||||
return;
|
||||
}
|
||||
// 如果启用了v1,但是没有配置module.push,不需要注入
|
||||
if (isEnableV1 && !configModulePush) {
|
||||
return;
|
||||
}
|
||||
// 如果启用了v2+offline,但是没有配置module.push,不需要注入
|
||||
if (isEnableV2 && isOffline && !configModulePush) {
|
||||
return;
|
||||
}
|
||||
if (isEnableV1 || isEnableV2) {
|
||||
return {
|
||||
code: `import '@dcloudio/uni-push';` + code,
|
||||
map: null,
|
||||
};
|
||||
}
|
||||
},
|
||||
};
|
||||
}),
|
||||
];
|
||||
|
||||
module.exports = index;
|
||||
1
uni_modules/UniDevTools/node_modules/@dcloudio/uni-push/lib/version
generated
vendored
Normal file
1
uni_modules/UniDevTools/node_modules/@dcloudio/uni-push/lib/version
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
1.0.0.20220127134911
|
||||
25
uni_modules/UniDevTools/node_modules/@dcloudio/uni-push/package.json
generated
vendored
Normal file
25
uni_modules/UniDevTools/node_modules/@dcloudio/uni-push/package.json
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "@dcloudio/uni-push",
|
||||
"version": "3.0.0-3090520231028001",
|
||||
"description": "@dcloudio/uni-push",
|
||||
"main": "lib/uni-push.js",
|
||||
"module": "lib/uni-push.js",
|
||||
"files": [
|
||||
"dist",
|
||||
"lib"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/dcloudio/uni-app.git",
|
||||
"directory": "packages/uni-push"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"bugs": {
|
||||
"url": "https://github.com/dcloudio/uni-app/issues"
|
||||
},
|
||||
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
|
||||
"dependencies": {
|
||||
"@dcloudio/uni-cli-shared": "3.0.0-3090520231028001"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user