Just like openshare and MonkeyKing, Cupid helps you post messages or do OAuth to Social Networks. And more service providers is on the schedule. In fact, the network interface is the same as MonkeyKing
. So why a new share SDK?
- This library is coming with much more extensibility.
- Most apps have their own network interface, so it is not necessary to maintain another network service instance.
- You don't need to register at the app launch methods; I think that is a waste of memory, many people never share anything.
- This library used many structs to construct the information channel, and use enums to construct information payload! No more singletons to reside in memory!
- Protocols to extend custom functionality.
You can check this article in Chinese to learn more about share architecture in our coming new version client.
Not like demo of many library, this library's demo's logic is very similar to our architecture in our in programming new version client. The MainViewController
is just like share sheet, though our client is coming with a much more beautiful interface. The ShareManager
is our central hub for communication between the library and our app logic. The NotificationManager is used for notification. So this demo does not show all the functionality of this library
If you want to share to Alipay, you must configure the app id and the bundle id to match your register to Alipay. If you have any questions, feel free to contact me or open an issue.
- Share content to QQ, WeChat, Weibo, Pocket, Paste board, Alipay.
- OAuth to QQ(support web OAuth), WeChat, Weibo(Support web OAuth), Pocket(Support web OAuth).
- Subclass
ShareActivity
to create custom share UIActivity. - Create your own service provider to offer more functionality.
- Optionally use your own network framework to do OAuth and share.
- Code refactoring to make the web OAuth interface more customizable.
- Code refactoring to make this library more elegant.
A quick peek of the demo, but just with the interface screenshot. Download it to try!
Swift 2.0+, iOS 8.0+
It's recommended to use CocoaPods or Carthage.
To integrate Cupid into your Xcode project using CocoaPods, specify it in your Podfile
:
platform :ios, '8.0'
use_frameworks!
pod 'Cupid', '~> 1.0'
Then, run the following command:
$ pod install
You should open the {Project}.xcworkspace
instead of the {Project}.xcodeproj
after you installed anything from CocoaPods.
To integrate MonkeyKing into your Xcode project using Carthage, specify it in your Cartfile
:
github "36Kr-Mobile/Cupid.git"
Then, run the following command to build the Cupid framework:
$ carthage update
You can check the Cupid Demo to learn its usage, and also I recommend you to read this article to learn how we integrate this library into our own production code base.
Shannon Wu
Twitter: @inatu_
Weibo: inatu
E-mail: [email protected]
Great thanks to the creators and contributors of MonkeyKing
, many methods are directly from it.
Cupid is available under the [MIT License][mitLink] license. See the LICENSE file for more info. [mitLink]:http://opensource.org/licenses/MIT