diff --git a/Example/PNObject/PNObjectAppDelegate.m b/Example/PNObject/PNObjectAppDelegate.m index 15cbf2c..b9b3fc7 100644 --- a/Example/PNObject/PNObjectAppDelegate.m +++ b/Example/PNObject/PNObjectAppDelegate.m @@ -55,24 +55,25 @@ NSLog(@"%@",[accessToken JSONObject]); - /*[[[PNObjectConfig sharedInstance] manager] GET:[[[PNObjectConfig sharedInstance] PNObjEndpoint] stringByAppendingString:[PNAccessToken PNObjClassName]] parameters:nil progress:^(NSProgress * _Nonnull downloadProgress) { + + [[[PNObjectConfig sharedInstance] manager] GET:[[[PNObjectConfig sharedInstance] PNObjEndpoint] stringByAppendingString:[PNAccessToken PNObjClassName]] parameters:nil progress:^(NSProgress * _Nonnull downloadProgress) { - } success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { + } success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { PNAccessToken *accessToken = [[PNAccessToken alloc] initWithJSON:responseObject]; NSLog(@"%@",[accessToken JSONObject]); dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [accessToken saveLocally]; + [accessToken saveLocally]; }); //[accessToken saveLocally]; - } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { + } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { NSLog(@"%@",error); - }];*/ + }]; //NSLog(@"%@",userDictionary); /* diff --git a/Pod/Classes/PNClasses/PNAccessToken.m b/Pod/Classes/PNClasses/PNAccessToken.m index 8426244..989c8b4 100644 --- a/Pod/Classes/PNClasses/PNAccessToken.m +++ b/Pod/Classes/PNClasses/PNAccessToken.m @@ -82,7 +82,11 @@ static bool isFirstAccess = YES; } if (_expiresIn) { - _expirationDate = [[NSDate date] dateByAddingHours:[_expiresIn integerValue]]; + NSLog(@"%ld",[_expiresIn integerValue]); + NSLog(@"%@",[NSDate date]); + NSLog(@"%@",[[NSDate date] dateByAddingMinutes:[_expiresIn integerValue]]); + NSLog(@"%@",[[NSDate date] dateByAddingMinutes:10000]); + _expirationDate = [[NSDate date] dateByAddingMinutes:[_expiresIn integerValue]]; } }