Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem that you can't log in to your Google account

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article shows you how to solve the problem of not being able to log in to your Google account. The content is concise and easy to understand, and it will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

[case description]

Recently, after packaging my own WEB H5 application into an express application, I encountered the error of 403 in the following figure when registering and logging in with my Google account.

[problem Analysis]

As you can see from the error page above, Google gives the reason: Error:disallowed_useragent. In other words, Google restricts the browser UA that can load H5 applications, and it recommends chrome browsers. Obviously, the answer to the question has something to do with UA.

[solution]

1. Define the variable model, and model represents the phone model of the user. Add the model variable to the data object, as shown in the following figure:

two。 Assign a value to model: get the phone model in the onInit () method of the life cycle of the page, as follows:

one

two

three

four

OnInit: function () {

Const device = require ("@ system.device")

Const res = device.getInfoSync ()

This.model=res.model

3. Set the web component property useragent value to Mozilla/5.0 (Linux; Android 9; {{model}}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.116 Mobile Safari/537.36), as shown below:

Note: the variable model is used in the value of useragent. The function of using variable model is to obtain the real phone model, so as to prevent some H5 web pages from getting the wrong phone model when verifying Useragent, thus causing trouble to users.

4. Set the minPlatformVersion value in the manifest.json file to 1068.

5. Please make sure that the version of Huawei Express Application Loader is 2.2.0.304 or above. The way to view the loader version is shown in the figure on the right:

Note: 1 after the completion of the 4 steps, if you have any questions about login, please click on web

Add the following code:

Multiwindow= "true"

Packaging H5 applications into Express applications is a very important overseas solution. On phones without GMS services, you can still use Google services, such as the Google account in this case.

This solution is also applicable to some problems of other account login in H5 fast application.

The above content is how to solve the problem of not being able to log in to the Google account. Have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report