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.