Commit d9a93068 authored by Vincent's avatar Vincent

Version 2.1.9

parent 4a755421
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'APMServices' s.name = 'APMServices'
s.version = '2.1.8' s.version = '2.1.9'
s.summary = 'app\'s miles® boosts your app\'s usage' s.summary = 'app\'s miles® boosts your app\'s usage'
# This description is used to generate tags and improve search results. # This description is used to generate tags and improve search results.
......
//
// APMImage.h
// APMServices
//
// Created by Vincent Ducastel on 11/09/2018.
// Copyright (c) 2018 Moonmiles. All rights reserved.
//
#import "APMModel.h"
#import "APMImagesUtils.h"
#define APM_K_IMAGE_URL @"url"
#define APM_K_IMAGE_IMAGE @"image"
#define APM_K_IMAGE_COUNT_IMAGE_LOAD @"countImageLoad"
#define APM_K_IMAGE_IS_IMAGE_LOADING @"isImageLoading"
@interface APMImage : APMModel<NSCoding, NSCopying, APMMediaProtocol>
@property (nonatomic, strong) NSString* url;
@property (nonatomic, strong) UIImage* image;
@property (nonatomic, assign) NSInteger countImageLoad;
@property (nonatomic, assign) BOOL isImageLoading;
-(instancetype)initWithUrl:(NSString*)url;
-(id)initWithJSONObject:(NSDictionary*)jsonObject;
@end
...@@ -50,6 +50,13 @@ typedef enum APMImagesUtilsOptions : NSUInteger { ...@@ -50,6 +50,13 @@ typedef enum APMImagesUtilsOptions : NSUInteger {
@interface APMImagesUtils : NSObject @interface APMImagesUtils : NSObject
+(void)buildMedia:(id<APMMediaProtocol>)mediaProtocol
imageView:(UIImageView*)imageView tagImageView:(NSInteger)tagImageView;
+(void)buildMedia:(id<APMMediaProtocol>)mediaProtocol
imageView:(UIImageView*)imageView tagImageView:(NSInteger)tagImageView
loader:(UIActivityIndicatorView*)loader tagLoader:(NSInteger)tagLoader;
+(void)buildMedia:(id<APMMediaProtocol>)mediaProtocol +(void)buildMedia:(id<APMMediaProtocol>)mediaProtocol
imageView:(UIImageView*)imageView tagImageView:(NSInteger)tagImageView imageView:(UIImageView*)imageView tagImageView:(NSInteger)tagImageView
loader:(UIActivityIndicatorView*)loader tagLoader:(NSInteger)tagLoader loader:(UIActivityIndicatorView*)loader tagLoader:(NSInteger)tagLoader
......
//
// APMProduct.h
// APMServices
//
// Created by Vincent Ducastel on 11/09/2018.
// Copyright (c) 2018 Moonmiles. All rights reserved.
//
#import "APMModel.h"
#define APM_K_PRODUCT_ID @"id"
#define APM_K_PRODUCT_EAN @"ean"
#define APM_K_PRODUCT_REF @"ref"
#define APM_K_PRODUCT_URL @"url"
#define APM_K_PRODUCT_LANG @"lang"
#define APM_K_PRODUCT_TITLE @"title"
#define APM_K_PRODUCT_PRICE @"price"
#define APM_K_PRODUCT_DISCOUNTED_PRICE @"discountedPrice"
#define APM_K_PRODUCT_DISCOUNT @"discount"
#define APM_K_PRODUCT_CURRENCY @"currency"
#define APM_K_PRODUCT_DESCRIPTION @"description"
#define APM_K_PRODUCT_SHORT_DESCRIPTION @"shortDescription"
#define APM_K_PRODUCT_RATING @"rating"
#define APM_K_PRODUCT_RATING_SCALE @"ratingScale"
#define APM_K_PRODUCT_COLOR_ID @"colorId"
#define APM_K_PRODUCT_SIZE_ID @"sizeId"
#define APM_K_PRODUCT_AVAILABILITY @"availability"
#define APM_K_PRODUCT_VIDEOS @"videos"
#define APM_K_PRODUCT_IMAGES @"images"
#define APM_K_PRODUCT_REVIEWS @"reviews"
#define APM_K_PRODUCT_COLORS @"colors"
#define APM_K_PRODUCT_SIZES @"sizes"
#define APM_K_PRODUCT_VARIANTS @"variants"
#define APM_K_PRODUCT_LINKS @"links"
@interface APMProduct : APMModel<NSCoding, NSCopying>
@property (nonatomic, assign) NSInteger identifiant;
@property (nonatomic, strong) NSString* ean;
@property (nonatomic, strong) NSString* ref;
@property (nonatomic, strong) NSString* url;
@property (nonatomic, strong) NSString* lang;
@property (nonatomic, strong) NSString* title;
@property (nonatomic, strong) NSString* price;
@property (nonatomic, strong) NSString* discountedPrice;
@property (nonatomic, strong) NSString* discount;
@property (nonatomic, strong) NSString* currency;
@property (nonatomic, strong) NSString* desc;
@property (nonatomic, strong) NSString* shortDescription;
@property (nonatomic, assign) double rating;
@property (nonatomic, assign) NSInteger ratingScale;
@property (nonatomic, assign) NSInteger colorId;
@property (nonatomic, assign) NSInteger sizeId;
@property (nonatomic, assign) NSInteger availability;
@property (nonatomic, strong) NSArray* videos;
@property (nonatomic, strong) NSArray* images;
@property (nonatomic, strong) NSArray* reviews;
@property (nonatomic, strong) NSArray* colors;
@property (nonatomic, strong) NSArray* sizes;
@property (nonatomic, strong) NSArray* variants;
@property (nonatomic, strong) NSDictionary* links;
-(id)initWithJSONObject:(NSDictionary*)jsonObject;
-(NSInteger)selectedSizeIndex;
-(NSInteger)selectedColorIndex;
@end
//
// APMProductAttribute.h
// APMServices
//
// Created by Vincent Ducastel on 11/09/2018.
// Copyright (c) 2018 Moonmiles. All rights reserved.
//
#import "APMModel.h"
@class APMImage;
#define APM_K_PRODUCT_ATTRIBUTE_AVAILABILITY_UNAVAILABLE 0
#define APM_K_PRODUCT_ATTRIBUTE_AVAILABILITY_AVAILABLE 1
#define APM_K_PRODUCT_ATTRIBUTE_ID @"id"
#define APM_K_PRODUCT_ATTRIBUTE_NAME @"name"
#define APM_K_PRODUCT_ATTRIBUTE_RESOURCE_URL @"resourceUrl"
#define APM_K_PRODUCT_ATTRIBUTE_IMAGE @"image"
#define APM_K_PRODUCT_ATTRIBUTE_AVAILABILITY @"availability"
@interface APMProductAttribute : APMModel<NSCoding, NSCopying>
@property (nonatomic, assign) NSInteger identifiant;
@property (nonatomic, strong) NSString* name;
@property (nonatomic, strong) APMImage* image;
@property (nonatomic, assign) NSInteger availability;
-(id)initWithJSONObject:(NSDictionary*)jsonObject;
-(BOOL)isAvailable;
@end
//
// APMProductColor.h
// APMServices
//
// Created by Vincent Ducastel on 11/09/2018.
// Copyright (c) 2018 Moonmiles. All rights reserved.
//
#import "APMProductAttribute.h"
@interface APMProductColor : APMProductAttribute<NSCoding, NSCopying>
-(id)initWithJSONObject:(NSDictionary*)jsonObject;
@end
//
// APMProductSize.h
// APMServices
//
// Created by Vincent Ducastel on 11/09/2018.
// Copyright (c) 2018 Moonmiles. All rights reserved.
//
#import "APMProductAttribute.h"
@interface APMProductSize : APMProductAttribute<NSCoding, NSCopying>
-(id)initWithJSONObject:(NSDictionary*)jsonObject;
@end
//
// APMProductVariant.h
// APMServices
//
// Created by Vincent Ducastel on 11/09/2018.
// Copyright (c) 2018 Moonmiles. All rights reserved.
//
#import "APMModel.h"
#define APM_K_PRODUCT_VARIANT_EAN @"ean"
#define APM_K_PRODUCT_VARIANT_COLOR_ID @"colorId"
#define APM_K_PRODUCT_VARIANT_SIZE_ID @"sizeId"
#define APM_K_PRODUCT_VARIANT_AVAILABILITY @"availability"
@interface APMProductVariant : APMModel<NSCoding, NSCopying>
@property (nonatomic, strong) NSString* ean;
@property (nonatomic, assign) NSInteger colorId;
@property (nonatomic, assign) NSInteger sizeId;
@property (nonatomic, assign) NSInteger availability;
-(id)initWithJSONObject:(NSDictionary*)jsonObject;
@end
//
// APMProductVariantsUtils.h
// APMServices
//
// Created by Vincent Ducastel on 03/02/2017.
// Copyright © 2017 Moonmiles. All rights reserved.
//
#import <Foundation/Foundation.h>
@class APMProductVariant;
@interface APMProductVariantsUtils : NSObject
+(APMProductVariant*)findVariantWithSizeId:(NSInteger)sizeId colorId:(NSInteger)colorId withProductVariants:(NSArray*)array;
@end
//
// APMProductsUtils.h
// APMServices
//
// Created by Vincent Ducastel on 03/02/2017.
// Copyright © 2017 Moonmiles. All rights reserved.
//
#import <Foundation/Foundation.h>
@class APMProduct;
@interface APMProductsUtils : NSObject
+(APMProduct*)productFromId:(NSInteger)identifiant withProducts:(NSArray*)array;
+(BOOL)hasValidFirstVideo:(NSMutableArray*)array;
@end
//
// APMReview.h
// APMServices
//
// Created by Vincent Ducastel on 11/09/2018.
// Copyright (c) 2018 Moonmiles. All rights reserved.
//
#import "APMModel.h"
#define APM_K_REVIEW_AUTHOR @"author"
#define APM_K_REVIEW_FORMATTED_DATE @"date"
#define APM_K_REVIEW_RATING @"rating"
#define APM_K_REVIEW_RATING_SCALE @"ratingScale"
#define APM_K_REVIEW_CONTENT @"content"
@interface APMReview : APMModel<NSCoding, NSCopying>
@property (nonatomic, strong) NSString* author;
@property (nonatomic, strong) NSString* formattedDate;
@property (nonatomic, assign) NSInteger rating;
@property (nonatomic, assign) NSInteger ratingScale;
@property (nonatomic, strong) NSString* content;
-(id)initWithJSONObject:(NSDictionary*)jsonObject;
@end
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
// Version of API // Version of API
#define APM_API_VERSION @"3.0" #define APM_API_VERSION @"3.0"
#define APM_SERVICES_VERSION_NAME @"2.1.8" #define APM_SERVICES_VERSION_NAME @"2.1.9"
#define APM_SERVICES_VERSION_CODE @"2180" #define APM_SERVICES_VERSION_CODE @"2190"
//URL //URL
#define APM_URL_API_PROD @"https://api.appsmiles.eu/" //Url API prod #define APM_URL_API_PROD @"https://api.appsmiles.eu/" //Url API prod
...@@ -121,3 +121,7 @@ ...@@ -121,3 +121,7 @@
//TriggerAction Cache Policy //TriggerAction Cache Policy
#define APM_TRIGGER_CACHE_POLICY_DISCARD -1 #define APM_TRIGGER_CACHE_POLICY_DISCARD -1
#define APM_TRIGGER_CACHE_POLICY_STORE_ALWAYS 0 #define APM_TRIGGER_CACHE_POLICY_STORE_ALWAYS 0
//Product availability
#define APM_PRODUCT_AVAILABILITY_UNAVAILABLE 0
#define APM_PRODUCT_AVAILABILITY_AVAILABLE 1
...@@ -233,6 +233,9 @@ ...@@ -233,6 +233,9 @@
#define APM_K_USER_STATUS_MIDDLEGROUND @"middleground" #define APM_K_USER_STATUS_MIDDLEGROUND @"middleground"
#define APM_K_USER_STATUS_LEVELED_UP_AT @"leveledUpAt" #define APM_K_USER_STATUS_LEVELED_UP_AT @"leveledUpAt"
// Product keys
#define APM_K_PRODUCT_EAN @"ean"
// Versions keys // Versions keys
#define APM_K_VERSIONS @"versions" #define APM_K_VERSIONS @"versions"
...@@ -311,6 +314,7 @@ ...@@ -311,6 +314,7 @@
#define APM_FUNC_AD_NEWS_LIST 53 #define APM_FUNC_AD_NEWS_LIST 53
#define APM_FUNC_AD_SPECIALS_LIST 54 #define APM_FUNC_AD_SPECIALS_LIST 54
#define APM_FUNC_USER_REFRESH_DATA 55 #define APM_FUNC_USER_REFRESH_DATA 55
#define APM_FUNC_PRODUCT_GET 56
// Url WS // Url WS
#define APM_INIT_CHECK_STORE @"partner/initialcheckstore" #define APM_INIT_CHECK_STORE @"partner/initialcheckstore"
...@@ -372,6 +376,7 @@ ...@@ -372,6 +376,7 @@
#define APM_STORE_LIST @"store/list" #define APM_STORE_LIST @"store/list"
#define APM_TEST_OK @"test/ok" #define APM_TEST_OK @"test/ok"
#define APM_TEST_CODE @"test/code" #define APM_TEST_CODE @"test/code"
#define APM_PRODUCT_GET @"product/get"
// Error // Error
#define APM_K_ERROR_CODE @"errorCode" #define APM_K_ERROR_CODE @"errorCode"
......
...@@ -71,6 +71,17 @@ ...@@ -71,6 +71,17 @@
#import "APMCategoryTrophy.h" #import "APMCategoryTrophy.h"
#import "APMTrophiesUtils.h" #import "APMTrophiesUtils.h"
#import "APMUserPropertiesUtils.h" #import "APMUserPropertiesUtils.h"
#import "APMProduct.h"
#import "APMReview.h"
#import "APMVideo.h"
#import "APMImage.h"
#import "APMProductAttribute.h"
#import "APMProductSize.h"
#import "APMProductColor.h"
#import "APMProductVariant.h"
#import "APMServicesProduct.h"
#import "APMProductVariantsUtils.h"
#import "APMProductsUtils.h"
#import "APMWebServices.h" #import "APMWebServices.h"
#import "APMServicesConfigPrivate.h" #import "APMServicesConfigPrivate.h"
//
// APMServicesProduct.h
// APMServices
//
// Created by Vincent Ducastel on 27/03/2017.
// Copyright © 2017 Moonmiles. All rights reserved.
//
#import <Foundation/Foundation.h>
@class APMProduct;
@interface APMServicesProduct : NSObject
+(void)productGet:(NSString*)ean productGetSuccess:(void (^)(APMProduct *product))productGetSuccess failure:(void (^)(NSError* error))failure;
@end
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
+(NSInteger)getStatusBarWidth; +(NSInteger)getStatusBarWidth;
+(NSInteger)getStatusBarHeight; +(NSInteger)getStatusBarHeight;
+(BOOL)isIphoneX; +(BOOL)isIphoneX;
+(BOOL)isSmallIphone;
+(NSInteger)getBottomBarHeight; +(NSInteger)getBottomBarHeight;
+(float)radiansToDegrees:(float)radians; +(float)radiansToDegrees:(float)radians;
+(float)degreesToRadians:(float)angle; +(float)degreesToRadians:(float)angle;
......
//
// APMVideo.h
// APMServices
//
// Created by Vincent Ducastel on 11/09/2018.
// Copyright (c) 2018 Moonmiles. All rights reserved.
//
#import "APMModel.h"
#define APM_K_VIDEO_TITLE @"title"
#define APM_K_VIDEO_URL @"url"
@interface APMVideo : APMModel<NSCoding, NSCopying>
@property (nonatomic, strong) NSString* title;
@property (nonatomic, strong) NSString* url;
-(id)initWithJSONObject:(NSDictionary*)jsonObject;
@end
...@@ -134,6 +134,8 @@ ...@@ -134,6 +134,8 @@
+(void)storeList:(NSString*)userToken success:(void (^)(NSURLSessionDataTask* task, id responseObject))success failure:(void (^)(NSURLSessionDataTask* task, NSError* error))failure; +(void)storeList:(NSString*)userToken success:(void (^)(NSURLSessionDataTask* task, id responseObject))success failure:(void (^)(NSURLSessionDataTask* task, NSError* error))failure;
+(void)productGet:(NSString*)userToken ean:(NSString*)ean success:(void (^)(NSURLSessionDataTask* task, id responseObject))success failure:(void (^)(NSURLSessionDataTask* task, NSError* error))failure;
+(void)getJsonFromUrl:(NSString*)url success:(void (^)(NSURLSessionDataTask* task, id responseObject))success failure:(void (^)(NSURLSessionDataTask* task, NSError* error))failure; +(void)getJsonFromUrl:(NSString*)url success:(void (^)(NSURLSessionDataTask* task, id responseObject))success failure:(void (^)(NSURLSessionDataTask* task, NSError* error))failure;
//*************************************************************************************************************************// //*************************************************************************************************************************//
......
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