- Aggiornato readme

This commit is contained in:
giuseppenuc committed 2017-01-11 01:14:46 +01:00
1 parent d6bc683799
commit 866880eaa9
3 files changed
+170 -86

No files matched your search

+9 -22
View File
@@ -31,29 +31,16 @@
_window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
/*
[PNObjectConfig initSharedInstanceForEnvironments:@{EnvironmentDevelopment : @"http://packman.local/app_dev.php/api/v1/",
EnvironmentStage : @"https://packman.ppreview.it/app_stage.php/api/v1/",
EnvironmentProduction : @"http://packman.ppreview.it/app_stage.php/api/v1/"
} userSubclass:[PNUser class] withOauth:YES];
[[PNObjectConfig sharedInstance] setHTTPHeaderValue:@"application/x-www-form-urlencoded" forKey:@"Content-Type"];
[[PNObjectConfig sharedInstance] setClientID:@"1_pqjo2w5k7j4g8skco408oc048w8so0ws840gcg8k8gwsgk0g4" clientSecret:@"10w0vg2v6eggooc4wks4w4s0wkwok0wkck0w888so0o80g88w8" forEnv:EnvironmentProduction];
#ifdef DEBUG
[PNObjectConfig initSharedInstanceForEnvironments:@{EnvironmentDevelopment : @"http://pnobject.local/api/v1/",
EnvironmentStage : @"http://pnobject.stage.it/api/v1/",
EnvironmentProduction : @"http://pnobject.prod.it/api/v1/"
} userSubclass:[PNUser class] withOauthMode:OAuthModeClientCredential];
[[PNObjectConfig sharedInstance] setClientID:@"xxxxxxxxx" clientSecret:@"xxxxxxxxxxxx" forEnv:EnvironmentStage];
[[PNObjectConfig sharedInstance] setClientID:@"xxxxxxxxx" clientSecret:@"xxxxxxxxxxxx" forEnv:EnvironmentProduction];
[[PNObjectConfig sharedInstance] setEnvironment:EnvironmentStage];
#endif*/
[PNObjectConfig initSharedInstanceForEnvironments:@{EnvironmentDevelopment : @"http://bmwcallingweb.local/app_dev.php/api/v1/",
EnvironmentStage : @"http://bmwcallingweb.ppreview.it/app_dev.php/api/v1/",
EnvironmentProduction : @"http://bmwcallingweb.ppreview.it/app_dev.php/api/v1/"
} userSubclass:[PNUser class] withOauthMode:OAuthModePassword];
[[PNObjectConfig sharedInstance] setClientID:@"1_pqjo2w5k7j4g8skco408oc048w8so0ws840gcg8k8gwsgk0g4" clientSecret:@"10w0vg2v6eggooc4wks4w4s0wkwok0wkck0w888so0o80g88w8" forEnv:EnvironmentStage];
[[PNObjectConfig sharedInstance] setOauthUserName:@"admin" oauthPassword:@"admin" forEnv:EnvironmentStage];
[[PNObjectConfig sharedInstance] setEnvironment:EnvironmentStage];
//[[PNObjectConfig sharedInstance] setHTTPHeaderValue:@"XMLHttpRequest" forKey:@"X-Request-With"];
+14 -64
View File
@@ -30,7 +30,7 @@
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
// Do any additional setup after loading the view, typically from a nib.
_refreshToken = [UIButton newAutoLayoutView];
[_refreshToken addTarget:self action:@selector(refreshTokenAction) forControlEvents:UIControlEventTouchUpInside];
@@ -102,72 +102,22 @@
- (void) apiCallAction {
/*PNObjcPassword *password = [PNObjcPassword new];
[password setPassword:@"asdasdasd"];
[password setConfirmPassword:@"asdasdasd"];
User *user = [User new];
[user setFirstName:@"Giuseppe"];
[user setLastName:@"Nuficora"];
[user setEmail:@"packman5@giuseppenucifora.com"];
[user setPassword:password];
[user setHasAcceptedNewsletter:YES];
[user setHasAcceptedPrivacy:YES];
*/
//[user saveLocally];
PNObjcPassword *password = [PNObjcPassword new];
[password setPassword:@"asdasdasd"];
[password setConfirmPassword:@"asdasdasd"];
PNUser *user = [PNUser new];
[user setFirstName:@"Test"];
[user setLastName:@"Test"];
[user setEmail:@"pnobject@pnobject.com"];
[user setPassword:password];
[user setHasAcceptedNewsletter:YES];
[user setHasAcceptedPrivacy:YES];
[user saveLocally];
NSLog(@"%@",[[PNUser currentUser] JSONFormObject]);
//NSLog(@"%@",[user JSONObjectMap]);
/*[user registerWithBlockSuccess:^(PNUser * _Nullable responseObject) {
} failure:^(NSError * _Nonnull error) {
}];*/
/*[[User currentUser] socialLoginWithBlockSuccessFromViewController:self
blockSuccess:^(PNUser * _Nullable responseObject) {
} failure:^(NSError * _Nonnull error) {
}];*/
//User * user = [User currentUser];
//if ([user isAuthenticated]) {
/*[User loginCurrentUserWithEmail:@"demo@packman.example" password:@"demo@packman.example" withBlockSuccess:^(PNUser * _Nullable responseObject) {
NSLog(@"response : %@",responseObject);
NSLog(@"%@",[User currentUser]);
} failure:^(NSError * _Nonnull error) {
NSLog(@"response : %@",error);
}];*/
/*[PNUser socialLoginWithBlockSuccess:^(PNUser * _Nullable responseObject) {
} failure:^(NSError * _Nonnull error) {
}];*/
/*[PNUser socialUserFromViewController:self blockSuccess:^(PNUser * _Nullable responseObject) {
NSLog(@"%@",[[PNUser currentUser] JSONFormObject]);
} failure:^(NSError * _Nonnull error) {
}];*/
/*[User resetPasswordForEmail:@"packman@giuseppenucifora.com" Progress:^(NSProgress * _Nonnull uploadProgress) {
} Success:^(NSDictionary * _Nullable responseObject) {
} failure:^(NSError * _Nonnull error) {
}];*/
}