Commit f919fd0a authored by Vincent's avatar Vincent

Version 2.0.0

parent c2bea86b
......@@ -8,7 +8,7 @@
Pod::Spec.new do |s|
s.name = 'APMServices'
s.version = '1.6.1'
s.version = '2.0.0'
s.summary = 'app\'s miles® boosts your app\'s usage'
# This description is used to generate tags and improve search results.
......
......@@ -10,11 +10,21 @@
@interface APMDevice : APMModel<NSCoding, NSCopying>
@property(nonatomic, assign) NSInteger deviceStatus;
@property(nonatomic, strong) NSNumber* deviceStatus;
@property(nonatomic, strong) NSNumber* optIn;
-(id)initWithJSONObject:(NSDictionary*)jsonObject;
-(BOOL)isValid;
-(BOOL)isSample; //Temoin
-(BOOL)isOff;
-(void)updateWithJSONObject:(NSDictionary*)jsonObject;
#pragma mark - Device Status
-(BOOL)isDeviceStatusValid;
-(BOOL)isDeviceStatusSample; //Temoin
-(BOOL)isDeviceStatusOff;
#pragma mark - Device Opt In
-(BOOL)isDeviceOptInNotSet;
-(BOOL)isDeviceOptInRefused;
-(BOOL)isDeviceOptInAccepted;
@end
......@@ -52,6 +52,7 @@
@property(nonatomic, strong, readonly) NSMutableArray *status;
@property(nonatomic, strong, readonly) NSMutableDictionary* theme;
@property(nonatomic, strong, readonly) NSMutableDictionary* pendingConnectionInfo; //Information de connection en attentes car RGPD not accepted for the moment.
@property(nonatomic, strong, readonly) NSString *classID;
@property(nonatomic, strong, readonly) NSMutableArray *frequencies;
......@@ -85,6 +86,8 @@
-(void)setDebugMode:(BOOL)debugMode;
-(BOOL)servicesIsOnError;
-(BOOL)servicesIsDisabled;
-(void)setDeviceStatus:(NSNumber*)deviceStatus;
-(void)setDeviceOptIn:(NSNumber*)optIn;
//Other
-(void)resetAll;
......
......@@ -7,9 +7,9 @@
//
// Version of API
#define APM_API_VERSION @"2.0"
#define APM_SERVICES_VERSION_NAME @"1.6.1"
#define APM_SERVICES_VERSION_CODE @"1610"
#define APM_API_VERSION @"3.0"
#define APM_SERVICES_VERSION_NAME @"2.0.0"
#define APM_SERVICES_VERSION_CODE @"2000"
//URL
#define APM_URL_API_PROD @"https://api.appsmiles.eu/" //Url API prod
......@@ -53,15 +53,10 @@
#define APM_HOW_WORKS_TYPE_ACTIONS 2
#define APM_HOW_WORKS_TYPE_GIFTS 3
//HowWorks target
#define APM_HOWWORKS_TARGET_ONLY_NOT_CONNECTED 0
#define APM_HOWWORKS_TARGET_ONLY_CONNECTED 1
#define APM_HOWWORKS_TARGET_BOTH 2
//Walkthrough target
#define APM_WALKTHROUGH_TARGET_ONLY_NOT_CONNECTED 0
#define APM_WALKTHROUGH_TARGET_ONLY_CONNECTED 1
#define APM_WALKTHROUGH_TARGET_BOTH 2
//Page target
#define APM_PAGE_TARGET_ONLY_NOT_CONNECTED 0
#define APM_PAGE_TARGET_ONLY_CONNECTED 1
#define APM_PAGE_TARGET_BOTH 2
//Walkthrough status
#define APM_WALKTHROUGH_STATUS_OFFLINE 0
......@@ -84,15 +79,21 @@
#define APM_EXCEPTION_ACCOUNT_NOT_CONNECTED -106
#define APM_EXCEPTION_HTTP_REQUEST_ERROR -107
#define APM_EXCEPTION_URL_HTTP_INVALID -108
#define APM_EXCEPTION_OPT_IN_NOT_ACCEPTED -109
//Format Date
#define APM_DEFAULT_DATE_FORMAT @"dd/MM/yyyy"
//Device status
#define APM_DEVICE_STATUS_NOT_SET -1
#define APM_DEVICE_STATUS_OK 0
#define APM_DEVICE_STATUS_ANONYMOUS 1
#define APM_DEVICE_STATUS_OPTIN_OFF 2
#define APM_DEVICE_STATUS_NOT_SET @(-1)
#define APM_DEVICE_STATUS_OK @(0)
#define APM_DEVICE_STATUS_ANONYMOUS @(1)
#define APM_DEVICE_STATUS_OPTIN_OFF @(2)
//Opt-In
#define APM_DEVICE_OPT_IN_NOT_SET @(-1)
#define APM_DEVICE_OPT_IN_REFUSE @(1)
#define APM_DEVICE_OPT_IN_ACCEPT @(0)
//Class id
#define APM_CLASS_ID_GLOBAL @"global"
......
......@@ -56,6 +56,7 @@
#define APM_K_USER_STATUS @"status"
#define APM_K_USER_BIRTHDATE @"birthdate"
#define APM_K_USER_EMAIL @"email"
#define APM_K_USER_PASSWORD @"password"
#define APM_K_USER_PWD @"pwd"
#define APM_K_USER_FIRSTNAME @"firstName"
#define APM_K_USER_GENDER @"gender"
......@@ -84,7 +85,7 @@
// Device keys
#define APM_K_DEVICE @"device"
#define APM_K_DEVICE_STATUS @"deviceStatus"
#define APM_K_DEVICE_OPT_IN @"optIn"
// Ad
#define APM_K_AD_ID @"adID"
......@@ -203,6 +204,9 @@
#define APM_K_WALKTHROUGH_VIEWED_AT @"viewedAt"
#define APM_K_WALKTHROUGH_COUNT @"count"
// Onboarding keys
#define APM_K_ONBOARDING_LIST @"onboarding"
// User Status keys
#define APM_K_USER_STATUS_LIST @"statuses"
#define APM_K_USER_STATUS_ID @"id"
......@@ -344,6 +348,7 @@
#define APM_ERROR_MESSAGE_ERROR_IMAGE @"error image..."
#define APM_ERROR_MESSAGE_HTTP_REQUEST_ERROR @"http request error..."
#define APM_ERROR_MESSAGE_URL_HTTP_INVALID @"url http invalid..."
#define APM_ERROR_MESSAGE_OPT_IN_NOT_ACCEPTED @"Opt in RGPD not accepted"
#define APM_BOUNDARY @"#$#"
......@@ -355,11 +360,13 @@
#define APM_FILE_DEVICE_SDK @"fr.moonmiles.appsmiles:device"
#define APM_FILE_WALKTHROUGHS_SDK @"fr.moonmiles.appsmiles:walkthroughs"
#define APM_FILE_HOW_WORKS_SDK @"fr.moonmiles.appsmiles:howWorks"
#define APM_FILE_ONBOARDING_SDK @"fr.moonmiles.appsmiles:onboarding"
#define APM_FILE_STATUS_SDK @"fr.moonmiles.appsmiles:status"
#define APM_FILE_GENEROSITIES_SDK @"fr.moonmiles.appsmiles:generosities"
#define APM_FILE_VERSIONS_SDK @"fr.moonmiles.appsmiles:versions"
#define APM_FILE_THEME_SDK @"fr.moonmiles.appsmiles:theme"
#define APM_FILE_TRADUCTIONS_SDK @"fr.moonmiles.appsmiles:traductions"
#define APM_FILE_PENDING_CONNECTION_INFO_SDK @"fr.moonmiles.appsmiles:pendingConnectionInfo"
//Other
#define APM_CLASS_ID_AUTO @"auto"
......
......@@ -14,6 +14,7 @@
+(NSInteger)jsonObject:(NSDictionary*)jsonObject integerForKey:(NSString*)key defaultValue:(NSInteger)defaultValue;
+(double)jsonObject:(NSDictionary*)jsonObject doubleForKey:(NSString*)key defaultValue:(double)defaultValue;
+(id)jsonObject:(NSDictionary*)jsonObject objectForKey:(NSString*)key defaultValue:(id)defaultValue;
+(id)jsonObject:(NSDictionary*)jsonObject numberForKey:(NSString*)key defaultValue:(NSNumber*)defaultValue;
+(id)jsonObject:(NSDictionary*)jsonObject arrayForKey:(NSString*)key defaultValue:(id)defaultValue class:(Class)class;
#pragma mark - NSUserDefaults
......
......@@ -41,7 +41,7 @@
#import "APMDevice.h"
#import "APMDebug.h"
#import "APMHowWorks.h"
#import "APMHowWorksUtils.h"
#import "APMServicesPageUtils.h"
#import "APMArrayUtils.h"
#import "APMServicesTest.h"
#import "APMServicesPreferences.h"
......
......@@ -6,16 +6,24 @@
// Copyright © 2017 Moonmiles. All rights reserved.
//
@interface APMHowWorksUtils : NSObject
#define APM_PAGE_RUBRIC_HOW_IT_WORKS 1
#define APM_PAGE_RUBRIC_ONBOARDING 2
@interface APMServicesPageUtils : NSObject
@property(nonatomic, strong) NSMutableArray *howWorks;
@property(nonatomic, strong) NSMutableArray *onboarding;
+(APMHowWorksUtils *)sharedInstance;
+(APMServicesPageUtils *)sharedInstance;
-(void)initInstance;
-(NSArray*)getHowWorks:(BOOL)userConnected;
-(BOOL)canShowHowWorksConnected:(BOOL)connected;
-(void)successHowWorks:(NSDictionary*)result;
-(NSMutableArray*)getPagesWithRubric:(NSInteger)rubric;
-(NSMutableArray*)getPagesWithRubric:(NSInteger)rubric userConnected:(BOOL)userConnected;
-(BOOL)canShowPages:(NSInteger)rubric;
-(BOOL)pagesExists:(NSInteger)rubric;
-(void)savePagesShowed:(NSInteger)rubric;
-(void)successPagesWithRubric:(NSInteger)rubric result:(NSDictionary*)result;
-(void)resetAll;
@end
......@@ -11,8 +11,19 @@
+(NSInteger) getPartnerLevel;
+(void) setPartnerLevel:(NSInteger)value;
+(BOOL) isHowWorksShowed;
+(void) setHowWorksShowed:(BOOL)value;
#pragma mark - How It Works
+(BOOL) isHowWorksConnectedShowed;
+(void) setHowWorksConnectedShowed:(BOOL)value;
+(BOOL) isHowWorksNotConnectedShowed;
+(void) setHowWorksNotConnectedShowed:(BOOL)value;
#pragma mark - Onboarding
+(BOOL) isOnboardingConnectedShowed;
+(void) setOnboardingConnectedShowed:(BOOL)value;
+(BOOL) isOnboardingNotConnectedShowed;
+(void) setOnboardingNotConnectedShowed:(BOOL)value;
+(BOOL) isServerDebugMode;
+(void) setServerDebugMode:(BOOL)value;
......
......@@ -11,13 +11,23 @@
@interface APMServicesUser : NSObject
+(void)userConnect:(NSString*)email password:(NSString*)password segments:(NSDictionary*)segments userConnectSuccess:(void (^)(APMUser* user))userConnectSuccess failure:(void (^)(NSError* error))failure;
+(void)userClientConnect:(NSDictionary*)user userConnectSuccess:(void (^)(APMUser* user))userConnectSuccess failure:(void (^)(NSError* error))failure;
+(void)userClientConnect:(NSString*)firstname lastname:(NSString*)lastname email:(NSString*)email password:(NSString*)password facebookId:(NSString*)facebookId partnerClientId:(NSString*)partnerClientId oldClientId:(NSString*)oldClientId segments:(NSDictionary*)segments userConnectSuccess:(void (^)(APMUser* user))userConnectSuccess failure:(void (^)(NSError* error))failure;
#pragma mark - userClientConnect
+(void)userClientConnectPendingConnectionInfoWithUserConnectSuccess:(void (^)(APMUser* user))userConnectSuccess failure:(void (^)(NSError* error))failure;
+(void)userClientConnect:(NSDictionary*)dictionaryUser userConnectSuccess:(void (^)(APMUser* user))userConnectSuccess failure:(void (^)(NSError* error))failure;
+(void)userClientConnect:(NSString*)email partnerClientId:(NSString*)partnerClientId optIn:(NSNumber*)optIn userConnectSuccess:(void (^)(APMUser* user))userConnectSuccess failure:(void (^)(NSError* error))failure;
+(void)userClientConnect:(NSString*)firstname lastname:(NSString*)lastname email:(NSString*)email password:(NSString*)password facebookId:(NSString*)facebookId partnerClientId:(NSString*)partnerClientId oldClientId:(NSString*)oldClientId segments:(NSDictionary*)segments optIn:(NSNumber*)optIn userConnectSuccess:(void (^)(APMUser* user))userConnectSuccess failure:(void (^)(NSError* error))failure;
+(void)userLogout:(void (^)())userLogoutSuccess failure:(void (^)(NSError* error))failure;
+(void)userCreate:(NSString*)firstname lastname:(NSString*)lastname email:(NSString*)email password:(NSString*)password facebookId:(NSString*)facebookId segments:(NSDictionary*)segments userCreateSuccess:(void (^)(APMUser* user))userCreateSuccess failure:(void (^)(NSError* error))failure;
+(void)userSave:(NSString*)firstname lastname:(NSString*)lastname mobile:(NSString*)mobile gender:(NSString*)gender birthday:(NSString*)birthday city:(NSString*)city facebookId:(NSString*)facebookId segments:(NSDictionary*)segments userSaveSuccess:(void (^)(APMUser* user))userSaveSuccess failure:(void (^)(NSError* error))failure;
+(void)userClientSave:(NSDictionary*)user userSaveSuccess:(void (^)(APMUser* user))userSaveSuccess failure:(void (^)(NSError* error))failure;
#pragma mark - userClientSave
+(void)userClientSave:(NSDictionary*)dictionaryUser userSaveSuccess:(void (^)(APMUser* user))userSaveSuccess failure:(void (^)(NSError* error))failure;
+(void)userClientSave:(NSString*)email firstname:(NSString*)firstname lastname:(NSString*)lastname mobile:(NSString*)mobile gender:(NSString*)gender birthday:(NSString*)birthday city:(NSString*)city facebookId:(NSString*)facebookId partnerClientId:(NSString*)partnerClientId segments:(NSDictionary*)segments userSaveSuccess:(void (^)(APMUser* user))userSaveSuccess failure:(void (^)(NSError* error))failure;
+(void)userSavePassword:(NSString*)oldPassword newPassword:(NSString*)newPassword confirmPassword:(NSString*)confirmPassword userSavePasswordSuccess:(void (^)(APMUser* user))userSavePasswordSuccess failure:(void (^)(NSError* error))failure;
+(void)userRefresh:(void (^)(APMUser* user))userRefreshSuccess failure:(void (^)(NSError* error))failure;
+(void)userResetPassword:(NSString*)email userResetPasswordSuccess:(void (^)(NSString* message))userResetPasswordSuccess failure:(void (^)(NSError* error))failure;
......
......@@ -39,4 +39,6 @@
-(void)setGenderString:(NSString*)genderString;
- (BOOL)isSameSegments:(NSDictionary*)segments;
+(APMUser*)userFromDictionary:(NSDictionary*)dictionary;
@end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment