YesGraph iOS SDK is a sharing iOS SDK that integrates with YesGraph. It presents user with a share sheet that can be used to share a message to user's friends to multiple sources, such as: Facebook, Twitter or user's contact book. Read more about that on our blog.
Find detailed documentation about YesGraph on yesgraph.com
The SDK is compatible with iOS apps with iOS 8 and above. It requires Xcode 7.x and iOS 9.x SDK to build the source.
The easiest way to integrate is with CocoaPods. Add the following Pod to your Podfile:
pod 'YesGraph-iOS-SDK'
An alternate way to integrate is using Carthage. Add the following link to your Cartfile:
github "YesGraph/ios-sdk"
Or integrate it manually by drag & dropping all .h and .m files from YesGraphSDK folder into your project. You must also import the library by either:
Objective-C
#import <YesGraphSDK/YesGraphSDK.h>
@import YesGraphSDK; // Only if using modules
Swift
import YesGraphSDK
There are 3 example applications included in the repository, that display the share sheet when triggered. All examples are the same, but they contain different ways of SDK integration.
- Example - Is a Objective-C app that includes YesGraphSDK as a framework and uses it as a module.
- Example-Static - Is a Objective-C app that includes YesGraph SDK as a static library.
- Example-Swift - Is a Swift app that includes YesGraphSDK as a framework.
Like YesGraph SDK, all example apps require Xcode 7.x to build and run.
Before you can use any of the example apps, you need to configure the app with your YesGraph client key. Because YesGraph treats mobile devices as untrusted clients, first you need a trusted backend to generate client keys.
Read more about connecting apps Read more about creating client keys
-
If you haven't already, sign up for a YesGraph account (it takes seconds). Then go to YesGraph Dashboard: https://www.yesgraph.com/apps/.
-
Copy the live secret key on the bottom of the page to your trusted backend.
-
Call your trusted backend with user ID, to get the client key back (you can generate a random user ID, if user is not known, by using
YSGUtility
class andrandomUserId
method. -
Configure YesGraph iOS SDK with received client key and user ID:
Objective-C
[[YesGraph shared] configureWithClientKey:clientKey]; [[YesGraph shared] configureWithUserId:userId];
Swift
YesGraph.shared().configureWithClientKey(clientKey) YesGraph.shared().configureWithUserId(userId)
-
Run the desired Example app.
We provide a simple script to build YesGraph SDK locally:
./Scripts/build-all.sh
This script will build both Framework and a Static library.
YesGraph iOS SDK contains unit tests that can be executed in Xcode.
- Open YesGraph/YesGraphSDK.xcworkspace
- Choose the "YesGraphSDK" scheme
- Run Product -> Test
YesGraph iOS SDK is released under MIT license. See LICENSE file for more information.