IOS has encountered some pitfalls in Sina Weibo sso authorized login, such as iossso.

Source: Internet
Author: User

IOS has encountered some pitfalls in Sina Weibo sso authorized login, such as iossso.

 

Sina Weibo sso authorizes third-party login. There is no third-party framework, such as shareSKD and umeng. For more information, see the official Sina SDK and documentation.

 

I encountered several pitfalls in the process and found them for a long time. I finally solved the problem. The record is as follows:

Question 1:

_ NSInlineData base64EncodedString-unrecognized selector sent to instance error

This pitfall compilation cannot be seen. It can be passed. During the runtime, it will crash ~

Answer:

Here, I have tried a third-party framework to perform Sina authorized logon. This problem also occurs, so it is still a pitfall of Sina's own SDK and has nothing to do with the third-party framework.

Solution: Choose build settings> other linker flags> Add-all_load.

In the official documents, let's get home-objc, And it's useless...

Note that, if not, it is best to add the corresponding framework in strict accordance with the official documentation. For details, refer to the Weibo iOS platform SDK documentation V3.1.4, https://github.com/sinaweibosdk/weibo_ios_sdk.

 

Question 2:

Okay, this is a long struggle, and finally it can run. It can be opened normally. Click Sina login. In theory, a prompt is displayed: if the application wants to open Weibo, you can choose to cancel or confirm it.

But it is actually a webpage login, and there is no sso to open the Weibo APP, and print a lot of logs, the error is as follows:

-CanOpenURL: failed for URL: "sinaweibo"-error: "This app is not allowed to query for scheme xx-canOpenURL: failed for URL:" weibosdk "-error: "This app is not allowed to query for scheme xx

There are several rows in total. The solution is to add an attribute: LSApplicationQueriesSchemes in info. plist and set the content.

After the authorization is completed, the authorization can be performed normally.

 

After authorization, the uid and accessToken are returned. Then, you can go to Sina to retrieve the user interface and get the user information, such as nickname, city, and profile picture...

 

 

End.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.