Home > Web Front-end > uni-app > body text

How uniapp determines the current environment

coldplay.xixi
Release: 2023-01-13 00:44:16
Original
5433 people have browsed it

Uniapp’s method of determining the current environment: 1. To determine if it is Apple, the code is [uni.getSystemInfoSync().platform=='ios']; 2. To determine if it is Android, the code is [uni.getSystemInfoSync() .platform=andr].

How uniapp determines the current environment

The operating environment of this tutorial: windows7 system, uni-app2.5.1 version, Dell G3 computer.

Recommendation (free): uni-app development tutorial

How uniapp determines the current environment:

Judgment is Apple:

uni.getSystemInfoSync().platform == 'ios'
Copy after login

Android:

uni.getSystemInfoSync().platform === 'android'
Copy after login

Related free learning recommendations: Programming video

The above is the detailed content of How uniapp determines the current environment. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template