- Fix class naming in default classes
- Add User in PNInstallation - Varius fix
This commit is contained in:
parent
a5550fb7c2
commit
33672c87eb
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
Pod::Spec.new do |s|
|
Pod::Spec.new do |s|
|
||||||
s.name = "PNObject"
|
s.name = "PNObject"
|
||||||
s.version = "0.7.7"
|
s.version = "0.7.8"
|
||||||
s.summary = "PNObject is a simple replica of the more complex ParseObject"
|
s.summary = "PNObject is a simple replica of the more complex ParseObject"
|
||||||
|
|
||||||
# This description is used to generate tags and improve search results.
|
# This description is used to generate tags and improve search results.
|
||||||
|
|||||||
@ -11,11 +11,11 @@
|
|||||||
@implementation PNAddress
|
@implementation PNAddress
|
||||||
|
|
||||||
+ (NSString *) objectClassName {
|
+ (NSString *) objectClassName {
|
||||||
return @"Address";
|
return @"PNAddress";
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (NSString *)objectEndPoint {
|
+ (NSString *)objectEndPoint {
|
||||||
return @"Address";
|
return @"PNAddress";
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (NSDictionary *) objcetMapping {
|
+ (NSDictionary *) objcetMapping {
|
||||||
|
|||||||
@ -7,6 +7,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "PNObject.h"
|
#import "PNObject.h"
|
||||||
|
#import "PNUser.h"
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger, PNInstallationType) {
|
typedef NS_ENUM(NSInteger, PNInstallationType) {
|
||||||
PNInstallationTypeNew = 0,
|
PNInstallationTypeNew = 0,
|
||||||
@ -48,7 +49,7 @@ typedef NS_ENUM(NSInteger, PNInstallationType) {
|
|||||||
///--------------------------------------
|
///--------------------------------------
|
||||||
#pragma mark - PNInstallation Properties
|
#pragma mark - PNInstallation Properties
|
||||||
///--------------------------------------
|
///--------------------------------------
|
||||||
|
@property (nonatomic, strong, nullable) PNUser *user;
|
||||||
/**
|
/**
|
||||||
* <#Description#>
|
* <#Description#>
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -8,6 +8,10 @@
|
|||||||
|
|
||||||
#import "PNInstallation.h"
|
#import "PNInstallation.h"
|
||||||
#import "DJLocalization.h"
|
#import "DJLocalization.h"
|
||||||
|
#import "PNObjectConfig.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@interface PNInstallation() <PNObjectSubclassing>
|
@interface PNInstallation() <PNObjectSubclassing>
|
||||||
|
|
||||||
@ -28,7 +32,7 @@ static bool isFirstAccess = YES;
|
|||||||
|
|
||||||
+ (NSDictionary *)objcetMapping {
|
+ (NSDictionary *)objcetMapping {
|
||||||
|
|
||||||
NSDictionary *mapping = @{
|
NSDictionary *mapping = @{@"user":@{@"key":@"user",@"type":[[[PNObjectConfig sharedInstance] userSubClass] PNObjClassName]},
|
||||||
@"deviceType":@"deviceType",
|
@"deviceType":@"deviceType",
|
||||||
@"deviceModel":@"deviceModel",
|
@"deviceModel":@"deviceModel",
|
||||||
@"deviceName":@"deviceName",
|
@"deviceName":@"deviceName",
|
||||||
|
|||||||
@ -11,11 +11,11 @@
|
|||||||
@implementation PNLocation
|
@implementation PNLocation
|
||||||
|
|
||||||
+ (NSString *) objectClassName {
|
+ (NSString *) objectClassName {
|
||||||
return @"Location";
|
return @"PNLocation";
|
||||||
}
|
}
|
||||||
|
|
||||||
+(NSString *)objectEndPoint {
|
+(NSString *)objectEndPoint {
|
||||||
return @"Location";
|
return @"PNLocation";
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (NSDictionary *) objcetMapping {
|
+ (NSDictionary *) objcetMapping {
|
||||||
|
|||||||
@ -13,11 +13,11 @@
|
|||||||
@implementation PNObjcPassword
|
@implementation PNObjcPassword
|
||||||
|
|
||||||
+ (NSString *) objectClassName {
|
+ (NSString *) objectClassName {
|
||||||
return @"Password";
|
return @"PNObjcPassword";
|
||||||
}
|
}
|
||||||
|
|
||||||
+(NSString *)objectEndPoint {
|
+(NSString *)objectEndPoint {
|
||||||
return @"Password";
|
return @"PNObjcPassword";
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (NSDictionary *) objcetMapping {
|
+ (NSDictionary *) objcetMapping {
|
||||||
|
|||||||
@ -55,12 +55,16 @@ static bool isFirstAccess = YES;
|
|||||||
|
|
||||||
- (instancetype)copy
|
- (instancetype)copy
|
||||||
{
|
{
|
||||||
return [[PNUser alloc] init];
|
Class objectClass = NSClassFromString([[self class] PNObjClassName]);
|
||||||
|
|
||||||
|
return [[objectClass alloc] init];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)mutableCopy
|
- (instancetype)mutableCopy
|
||||||
{
|
{
|
||||||
return [[PNUser alloc] init];
|
Class objectClass = NSClassFromString([[self class] PNObjClassName]);
|
||||||
|
|
||||||
|
return [[objectClass alloc] init];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype) initForCurrentUser
|
- (instancetype) initForCurrentUser
|
||||||
@ -405,7 +409,7 @@ static bool isFirstAccess = YES;
|
|||||||
@"sex":@"sex",
|
@"sex":@"sex",
|
||||||
@"birthDate":@"birthDate",
|
@"birthDate":@"birthDate",
|
||||||
@"phone":@"phone",
|
@"phone":@"phone",
|
||||||
@"password":@{@"key":@"password",@"type":@"PNObjcPassword"},
|
@"password":@{@"key":@"password",@"type":[PNObjcPassword PNObjClassName]},
|
||||||
@"hasAcceptedPrivacy":@"hasAcceptedPrivacy",
|
@"hasAcceptedPrivacy":@"hasAcceptedPrivacy",
|
||||||
@"hasAcceptedNewsletter":@"hasAcceptedNewsletter",
|
@"hasAcceptedNewsletter":@"hasAcceptedNewsletter",
|
||||||
@"hasVerifiedEmail":@"hasVerifiedEmail",
|
@"hasVerifiedEmail":@"hasVerifiedEmail",
|
||||||
|
|||||||
@ -216,6 +216,7 @@ extern NSString* _Nonnull const Client_Secret;
|
|||||||
#pragma mark - PNObjectConfig Properties
|
#pragma mark - PNObjectConfig Properties
|
||||||
///--------------------------------------
|
///--------------------------------------
|
||||||
|
|
||||||
|
@property (nonatomic, readonly, nonnull) Class userSubClass;
|
||||||
/**
|
/**
|
||||||
* <#Description#>
|
* <#Description#>
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -58,7 +58,7 @@ NSString* const Client_Secret = @"client_secret";
|
|||||||
@property (nonatomic, strong) NSString *currentOAuthClientSecret;
|
@property (nonatomic, strong) NSString *currentOAuthClientSecret;
|
||||||
@property (nonatomic, strong) AFOAuth2Manager *authManager;
|
@property (nonatomic, strong) AFOAuth2Manager *authManager;
|
||||||
|
|
||||||
@property (nonatomic) Class userSubClass;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user