Social sharing is a common feature in iOS development. When we need to quickly integrate multiple platforms to share, the general will choose a number of third party sharing platform, such as friends to share.
After years of development, the alliance has launched a new version of SDK6.1. Compared to the previous version, the new version of the Union in the use of more convenient and simple. However, due to the larger changes (documents, methods, etc. have been changed), the previous version of a lot of methods can not be used, the method is different.
Here to share with you some of the integration and call may encounter or pay attention to the problem.
1, after we choose the integration of the friends of the way (manual integration or integration through Cocoapods). There may be such a problem:
Cocoapods is used to remind the search can not find the file. I’m sorry to tell you that your Cocoapods image gem source is likely to expire. You need to change the gem source:
Gem sources – removehttps://ruby.taobao.org/
Gem source -ahttps://gems.ruby-china.org
2, after the compiler does not compile.
In this case, it is likely that there will be fewer dependencies that are required to join some of the shared platforms when you manually integrate.
What happens when you don’t have any dependencies on the library after the check, or if you’re Cocoapods integration, but it’s compiled?
There is also a possibility that: bitcode set the problem, since the project after the default Xcode7.0 on the open bitcode settings. However, if the project is linked to the third party library framework (or binary here refers to the alliance), this framework does not contain exactly bitcode. (this thing is what can Baidu), will cause the project compiled successfully. The solution is to your project Build Settings search bitcode, put the goods into NO and then compile, as follows:
3 remember to set up the integration of the Appkey and the third party platform URL Scheme:
set up a friendly alliance and third party platform key
As shown above in the AppDelegate didFinishLaunchingWithOptions method to do a good job in the initialization of the union. One of the friends of the union Appkey for the application of the union account application key. The other third party appKey and appSecret for you to apply to the corresponding open platform application information in key and secret (part of the third party platform only key).
set third party URL Schemes
As shown in the figure below Info add URL Types set corresponding to the third party URL Schemes. You must pay attention to the format of the official document. If the setting error will lead back to their application cannot share. The format is as follows:
Pro League provides URL Schemes format
4 official document referred to as adaptation iOS9, iOS10. To set up the third party white list in order to jump, and if you are using HTTP or not HTTPS then set the HTTP white list. There is a detailed description of the official document set details, here is not enough.
Do the above work can begin to use the friends of the SDK call sharing panel, and according to their own needs to set up the sharing of content. In the case of the most common link sharing. (refer to the official document third party platform sharing)
shows a friendly platform selection panel
create shared content
5 Finally remind friends iOS friends, if your application is to do on-line appStore must remember to set a predefined platform. Predefined platform is to determine whether the user to install the appropriate third party applications, if not hidden. Will not be displayed on the shared panel.
first import the corresponding header file
set the predefined platform
Of particular note is the official document explicitly mentioned this must be set before the share panel in the call, and the incoming platform must be legitimate and is already existing platform core module has been detected, it will be filtered out (this clause is on-line appStore audit conditions, developers must pay attention to).
The above is my new version of the League to do some small details to share, I hope to help you in the use of SDK. Please refer to the details of the official SDK document.