uniapp smart installation (automatic upgrade, imitation silent installation) plug-in Ba-SmartUpgrade

Introduction ( download address )

Ba-SmartUpgrade is a plug-in for smart installation (automatic upgrade), which can automatically install programs without any user operation, refer to the solution of 360 application market.

illustrate

When the app is updated or overwritten, the system will pop up an authorization prompt pop-up window, which requires user confirmation (as shown in the figure). But in some scenarios, it is necessary to implement automatic app updates.
insert image description here

This plug-in can be used for most mobile phones or devices without ROOT, and the manufacturer has not found a corresponding interface for silent installation.

This plugin provides a compromise smart installation solution. The so-called smart installation is actually not a silent installation in the true sense, because it still needs to pop up the system installation interface, but it can release the user's operation in the installation interface. The smart installation function simulates the user's click, and it will automatically close after the installation is complete. interface.

Instructions

quote

scriptIntroduce components in

	const smartUpgrade = uni.requireNativePlugin('Ba-SmartUpgrade')

example

It can be called scripton (example reference, you can modify it according to your own business and calling method)

<script>
	const smartUpgrade = uni.requireNativePlugin('Ba-SmartUpgrade')
	export default {
    
    
		data() {
    
    
			return {
    
    
			}
		},
		methods: {
    
    
			start() {
    
     //启动
				smartUpgrade.start(res => {
    
    
					console.log(res);
					uni.showToast({
    
    
						title: res.msg,
						icon: "none",
						duration: 3000
					})
				});
			},
			testInstall() {
    
     //测试安装
				smartUpgrade.testInstall(res => {
    
    
					console.log(res);
					uni.showToast({
    
    
						title: res.msg,
						icon: "none",
						duration: 3000
					})
				});
			},
		}
	}
</script>

application settings

When you call it for the first time, the system setting interface will pop up, find your application, and press the picture to turn on the switch.
insert image description here

method list

name illustrate
start start up
testInstall test installation

Series plug-in

Image selection plugin Ba-MediaPicker ( documentation )

Image editing plugin Ba-ImageEditor ( documentation )

File picker plugin Ba-FilePicker ( documentation )

Application message notification plugin Ba-Notify ( documentation )

Apply the unread badge plugin Ba-Shortcut-Badge ( documentation )

Applying the Ba-Autoboot plugin ( documentation )

Scan code native plug-in (millisecond level, support multi-code) Ba-Scanner-G ( documentation )

Native plug-in for scanning code - new (can customize the interface version arbitrarily; support continuous scanning code; support setting scanning code format) Ba-Scanner ( documentation )

Dynamically modify the status bar, navigation bar background color, font color plug-in Ba-AppBar ( documentation )

Native sqlite local database management Ba-Sqlite ( documentation )

Android keep-alive plug-in (using a variety of mainstream technologies) Ba-KeepAlive ( documentation )

Android shortcut (desktop long press app icon) Ba-Shortcut ( documentation )

Custom image watermark (anywhere) Ba-Watermark ( documentation )

The closest image compression plug-in to WeChat is Ba-ImageCompressor ( documentation )

Video compression, video editing plug-in Ba-VideoCompressor ( documentation )

Dynamically switch application icons and names (such as New Year, National Day, etc.) Ba-ChangeIcon ( documentation )

Native Toast pop-up prompt (through all interfaces, through native; custom colors, icons) Ba-Toast ( documentation )

Image graffiti, brush Ba-ImagePaint ( documentation )

pdf reading (gesture zoom, display page number) Ba-Pdf ( documentation )

Sound reminder, vibration reminder, voice broadcast Ba-Beep ( documentation )

Websocket native service (automatic reconnection, heartbeat detection) Ba-Websocket ( documentation )

SMS monitoring (verification code) Ba-Sms ( documentation )

Smart Install (Automatic Upgrade) Ba-SmartUpgrade ( documentation )

Guess you like

Origin blog.csdn.net/u013164293/article/details/128084509