-
Notifications
You must be signed in to change notification settings - Fork 1
Installation
-
Set up Symfony 2 RESTful API Project for iOS Client Set up guide for API configuration
-
iOS Client Once you are set up with web part and had added valid OAuth2.0 client and secret. Please do required changes in AJOauth2ApiClient file.
BASE_URL @"(http|https)/YOUR_WEB_SERVER_URL/api/"
CLIENT_ID @"YOUR_CLIENT_ID"
SECRET_KEY @"YOUR_SECRET_KEY"
API_VERSION @"YOUR_API_VERSION"
HOST_URL @"(http|https)/YOUR_WEB_SERVER_URL"
Once you have configured your client you are ready to request access to one of those services. The AJOauth2ApiClient provides different methods for this:
signInWithUsernameAndPassword - signin with username and password. [POST]
registerMe - signup with required fields. [POST]
requestPassword - forgot password with email/username. [GET]
showProfile - list the profile of user. [POST]
changePassword - password change. [POST]
updateProfile - user profile update. [POST]
updateProfileImage - user avatar image update. [POST]
getAvatarImageUrl - to get user avatar image Url. [POST]
refreshTokenWithSuccess - to get access token when invalid. [POST]
[[AJOauth2ApiClient sharedClient] signInWithUsernameAndPassword:@"YOUR_USERNAME_OR_EMAIL" password:@"YOUR_PASSWORD" success:^(AFOAuthCredential *credential) {
} failure:^(NSError *error) {
}];
On Success After a successful authentication user credential [i.e access_token, refresh_token, token_type, expiration_time] will be saved, if you want to add anything more do it inside block.
On Failure If the authentication did not succeed, NSError will be send and you may catch HTTPResponse codes and message inside this block.