CocoaPods trunk is moving to be read-only. Read more on the blog, there are 14 months to go.
| TestsTested | ✓ |
| LangLanguage | Obj-CObjective C |
| License | Custom |
| ReleasedLast Release | Dec 2014 |
Maintained by Vito Zhang.
Moves App SDK For iOS.
Use CocoaPods
pod 'moves-ios-sdk', '~> 0.2.3' pod to your Podfile. pod install, and the Moves SDK will be available in your project.Manully way, add the moves-ios-sdk to your project
When you register your app with Moves, it will provide you with a Client ID and Client secret. They identify your app to Moves's API.
copy and paste the following into the XML Source for the Info.plist:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>com.yourcompany</string>
<key>CFBundleURLSchemes</key>
<array>
<string>[YOUR URL SCHEME]</string>
</array>
</dict>
</array>[YOUR URL SCHEME] is setted when you Register your app with Moves
At the top of your app delegate source file (and anywhere you call the MovesAPI object), you'll need to include the MovesAPI.h. Simply add this line:
#import "MovesAPI.h"
In AppDelegate. Set Your [Client ID], [Client Secret] and [Redirect URI].
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[MovesAPI sharedInstance] setShareMovesOauthClientId:@"[YOUR CLIENT ID]"
oauthClientSecret:@"[YOUR CLIENT SECRET]"
callbackUrlScheme:@"[YOUR URL SCHEME]"];
return YES;
}Give the SDK an opportunity to handle incoming URLs.
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation
{
if ([[MovesAPI sharedInstance] canHandleOpenUrl:url]) {
return YES;
}
// Other 3rdParty Apps Handle Url Method...
return NO;
}[[MovesAPI sharedInstance] authorizationWithViewController:self
success:^{
// Auth successed! Now you can get Moves's data
} failure:^(NSError *error) {
// Auth failed!
}];Get user profile
[[MovesAPI sharedInstance] getUserSuccess:^(MVUser *user) {
// Get user
} failure:^(NSError *error) {
// Something wrong
}];More other API see the MovesAPI.h file
You can clone this repo, and test the API.
pod installcommand + U
See the MIT license.