In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article focuses on "what is the way to solve the problem of excessive Twitter sharing claims", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what is the way to solve the problem of too many Twitter sharing claims?"
ShareSDK sharing process
Sharing API varies on different social platforms, but most of them need to complete the license before sharing. ShareSDK provides both share and authorize API. For convenience, the authorization check is performed behind the shared API, so developers can ignore the authorized API on a daily basis (figure below):
The problem with Twitter is that by default, its authorization action takes too many permissions:
So the first way to solve this problem is not to let ShareSDK complete the authorization by default, but to call another overload of authorize before sharing to control permission fission.
Try 1. Reduce the claim by overloading authorization.
Before performing the sharing, use the isAuth method to determine whether the end user has authorized the sharing. If not, call authorize (String []), another overloaded method of authorize, to directly specify the required permission list for authorization, and call the share method to continue sharing after the authorization is successful.
So now just look up the documentation for the Twitter open platform and find the permissions you need to solve the problem-- unfortunately! Twitter does not have the concept of permission lists, so this solution is not feasible.
Try 2. Modify the Twitter App console configuration
Since it is not feasible to configure through code, according to our past experience, it can only be configured in the App console of Twitter. Sure enough, in an inconspicuous corner, Twitter permission rating options were found, but there were only three: read-only, write-only, and read-write (figure below):
In general, the "read-only" option must apply for the least permission. After switching, the permission list of the authorization page is much less, but after the authorization is completed, it directly affects the sharing function. Twitter prompt that the permission is not enough!
In this way, the sharing action needs at least "write" permission. After trying to set up, although sharing can be performed, the permission list of the authorization page has increased again.
Try 3. Share API based on operating system.
Since API on the open platform cannot solve this problem, we can only seek the help of the operating system API, and the implementation principle here is also very simple (as shown in the following figure):
For Android, this solution is easy to operate. Previously, ShareSDK has provided this feature for some platforms, but in the implementation of iOS platform, developers need to be aware of the differences in API provided by different App, and may even be affected by iOS system and App version.
Final solution
After completing the modification of trial 3, the problem of excessive claims in Twitter is indeed solved. And as before, you can directly switch to the new sharing method by adding a configuration without modifying the sharing calling code, which is especially suitable for scenario applications that only need to share but do not need to log in.
In addition to Twitter, we also extend this solution to all social platforms with the same model, and suggest developers going out to sea to update to the latest version and apply this solution to share, so as to solve the problem that users have too much authorization in sharing.
About ShareSDK
As many mobile developers know, sharing involves many platforms, and it is not an easy task to access them one by one. Not to mention the configuration, update and compatibility of each platform, none of it is easy. The project team's research and development, promotion, operation, brand building and other work, has been enough worry, is there an easier way to access the social platform?
Yes! Use ShareSDK!
ShareSDK only needs one-click integration to easily solve the above development problems, but also saves a series of follow-up steps to maintain the platform, saving time and effort.
In the era of more and more attention to information security, ShareSDK attaches great importance to the security of each platform and is a well-known social sharing component with high safety factor in the industry. At present, ShareSDK has been integrated into native and system sharing, perfect sharing method, so that developers can use it more easily!
At this point, I believe you have a deeper understanding of "what is the way to solve the problem of excessive Twitter sharing claims". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.