PHP third-party login QQ login video tutorial

黄舟
Release: 2023-03-15 16:08:01
Original
1425 people have browsed it

If you want to use the simplest method to acquire new users for our web application, you definitely shouldn’t miss it. Use the SDK officially provided by QQ Internet to quickly access the QQ Internet open platform and quickly acquire a large number of users.

PHP third-party login QQ login video tutorial

Course playback address: http://www.php.cn/course/401.html

The teacher’s teaching style:

The teacher’s lectures are vivid, witty, witty, and touching. A vivid metaphor is like the finishing touch, opening the door to wisdom for students; a well-placed humor brings a knowing smile to students, like drinking a glass of mellow wine, giving people aftertaste and nostalgia; a philosopher's aphorisms, cultural references Proverbs are interspersed from time to time in the narration, giving people thinking and warning.

The more difficult point in this video is the API call example:

There is no UI except for the logout and getting application friends API In addition to interaction, after calling the API provided by the following SDK, the corresponding interface will pop up to complete subsequent operations.

1.1 Login/verify login state

Initiate login/verify login state by calling the login function of Tencent class.
This API has two functions:
(1) If the developer does not call the setOpenId and setAccessToken API of the mTencent instance, the API performs normal login operations;
(2) If the developer calls mTencent first If the instance's setOpenId and setAccessToken API are used, the API will perform the operation of verifying the login status. If the login status is valid, success will be returned to the application. If the login status is invalid, the login process will be automatically entered and the latest login status data will be returned to the application.

It is recommended that developers call this API once every time the application is started (call setOpenId, setAccessToken first) to ensure that the user is logged in every time the application is opened.

The sample code for calling the login API is as follows:

 private void doLogin() {
 	IUiListener listener = new BaseUiListener() {
 		@Override
 		protected void doComplete(JSONObject values) {
 			updateLoginButton();
 		}
 	};
 	mTencent.login(this, SCOPE, listener);
}
Copy after login

The above is the detailed content of PHP third-party login QQ login video tutorial. 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!