This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)save { | |
[[[CatalyzeUser currentUser] name] setFirstName:_txtFirstName.text]; | |
[[[CatalyzeUser currentUser] name] setLastName:_txtLastName.text]; | |
[[[CatalyzeUser currentUser] phoneNumber] setHome:_txtHomePhoneNumber.text]; | |
[[[CatalyzeUser currentUser] phoneNumber] setMobile:_txtMobilePhoneNumber.text]; | |
if (_segmentedPreferredPhoneNumber.selectedSegmentIndex == 0) { | |
[[[CatalyzeUser currentUser] phoneNumber] setPreferred:@"home"]; | |
} else { | |
[[[CatalyzeUser currentUser] phoneNumber] setPreferred:@"mobile"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CatalyzeQuery *query = [CatalyzeQuery queryWithClassName:@"surveys"]; | |
[query setPageSize:20]; | |
[query setPageNumber:1]; | |
[query retrieveInBackgroundWithBlock:^(NSArray *objects, NSError *error) { | |
if (objects) { | |
_surveys = [NSMutableArray array]; | |
_otherSurveys = [NSMutableArray array]; | |
for (NSDictionary *dict in objects) { | |
if ([[dict valueForKey:@"parentId"] isEqualToString:[[CatalyzeUser currentUser] usersId]]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)logout { | |
[[CatalyzeUser currentUser] logoutWithBlock:^(int status, NSString *response, NSError *error) { | |
[self.navigationController popViewControllerAnimated:YES]; | |
}]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (IBAction)signUp:(id)sender { | |
Email *email = [[Email alloc] init]; | |
[email setPrimary:_txtEmail.text]; | |
Name *name = [[Name alloc] init]; | |
[name setFirstName:_txtFirstName.text]; | |
[name setLastName:_txtLastName.text]; | |
[CatalyzeUser signUpWithUsernameInBackground:_txtUsername.text email:email name:name password:_txtPassword.text block:^(int status, NSString *response, NSError *error) { | |
if (error) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (IBAction)login:(id)sender { | |
[CatalyzeUser logInWithUsernameInBackground:_txtUsername.text password:_txtPassword.text block:^(int status, NSString *response, NSError *error) { | |
if (error) { | |
[[[UIAlertView alloc] initWithTitle:@"Error" message:@"Invalid username / password" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil] show]; | |
} else { | |
[self.navigationController pushViewController:[[HealthTrackerViewController alloc] initWithNibName:nil bundle:nil] animated:YES]; | |
} | |
}]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CatalyzeUser currentUser]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name":"conversations", | |
"schema":{ | |
"sender":"string", | |
"recipient":"string", | |
"sender_id":"string", | |
"recipient_id":"string" | |
}, | |
"phi":true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name":"contacts", | |
"schema":{ | |
"user_username":"string", | |
"user_usersId":"string" | |
}, | |
"phi":false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name":"messages", | |
"schema":{ | |
"msgContent":"string", | |
"toPhone":"string", | |
"fromPhone":"string", | |
"timestamp":"string", | |
"isPhi":"boolean", | |
"fileId":"string", | |
"conversationsId":"string" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
class Environment { | |
var environmentId: String | |
var data: Dictionary<String, AnyObject> | |
var deployed: Bool | |
var dirty: Bool | |
init(dict: Dictionary<String, AnyObject>) { | |
self.environmentId = (dict["environmentId"] as AnyObject?) as String |