Commit 95d5e07e authored by Vincent's avatar Vincent

Version 2.1.6

parent eae47470
......@@ -8,7 +8,7 @@
Pod::Spec.new do |s|
s.name = 'APMServices'
s.version = '2.1.5'
s.version = '2.1.6'
s.summary = 'app\'s miles® boosts your app\'s usage'
# This description is used to generate tags and improve search results.
......
......@@ -9,6 +9,7 @@
#import "APMModel.h"
@class APMRule;
@class APMIdsFromTagId;
#define APM_GENEROSITY_ELIGIBILITY_OFF 0
#define APM_GENEROSITY_ELIGIBILITY_ON 1
......@@ -34,13 +35,12 @@
-(id)initWithJSONObject:(NSDictionary*)jsonObject;
-(BOOL)isActived;
-(BOOL)isPlayable;
-(BOOL)isEligible;
-(BOOL)isMatchesTagId:(NSString*)tagId generositySuggested:(APMGenerosity*)generositySuggested;
-(APMRule*)findRuleWithProperties:(NSDictionary*)properties;
-(APMIdsFromTagId*)isGenerosityMatchesTagId:(NSString*)tagId properties:(NSDictionary*)properties;
-(BOOL)isPlayableForChallengeWithTagId:(NSString*)tagId;
-(BOOL)isPlayableForTrophyWithTagId:(NSString*)tagId;
-(BOOL)isEligible;
-(BOOL)updateTriggedAtIfMatchesWithTagId:(NSString*)tagId ruleId:(NSInteger)ruleId;
@end
......@@ -2,6 +2,8 @@
// APMLOTAnimation.h
// APMServices
//
// APMLOTAnimation --> External resource for lottie and image. Keep the name for retrocompatibility
//
// Created by Vincent Ducastel on 09/01/2017.
// Copyright © 2017 Moonmiles. All rights reserved.
//
......@@ -9,22 +11,41 @@
#import <Foundation/Foundation.h>
#import "APMModel.h"
#define APM_K_LOT_ANIMATION_URL @"url"
#define APM_K_LOT_ANIMATION_JSON @"json"
#define APM_K_LOT_ANIMATION_KEY @"key"
#define APM_K_LOT_ANIMATION_VERSION @"version"
#define APM_EXTERNAL_RES_TYPE_IMAGE 1
#define APM_EXTERNAL_RES_TYPE_LOTTIE 2
//Common
#define APM_K_EXTERNAL_RES_URL @"url"
#define APM_K_EXTERNAL_RES_KEY @"key"
#define APM_K_EXTERNAL_RES_VERSION @"version"
#define APM_K_EXTERNAL_RES_TYPE @"type"
//Type : Lottie
#define APM_K_EXTERNAL_RES_JSON @"json"
//Type : Image
#define APM_K_EXTERNAL_RES_IMAGE @"image"
#define APM_K_EXTERNAL_RES_DATA_IMAGE @"dataImage"
@interface APMLOTAnimation : APMModel<NSCoding, NSCopying>
//Common
@property(nonatomic, strong) NSString *url;
@property(nonatomic, strong) NSDictionary *json;
@property(nonatomic, strong) NSString *key;
@property(nonatomic, assign) NSInteger version;
@property(nonatomic, assign) NSInteger type; //Type : 0 == Lottie, 1 == image
//Type : Lottie
@property(nonatomic, strong) NSDictionary *json;
//Type : Image
@property(nonatomic, strong) UIImage *image;
@property(nonatomic, strong) NSData *dataImage;
-(instancetype)initWithJSONObject:(NSDictionary*)jsonObject;
-(void)loadWithSuccess:(void (^)(NSDictionary *json))success failure:(void (^)(NSError* error))failure;
-(void)loadWithSuccess:(void (^)(APMLOTAnimation *lotAnimation))success failure:(void (^)(NSError* error))failure;
-(void)resetAnimationIfNeeded:(APMLOTAnimation*)animation;
-(void)loadJsonData;
-(void)loadData;
@end
......@@ -10,6 +10,8 @@
#define APM_K_RULE_ID @"id"
#define APM_K_RULE_ELIGIBILITY @"generosityEligibility"
#define APM_K_RULE_GENEROSITY_OFFSET @"generosityOffset"
#define APM_K_RULE_TRIGGERED_AT @"triggeredAt"
#define APM_K_RULE_FILTERS @"filters"
#define APM_RULE_ELIGIBILITY_OFF 0
......@@ -19,9 +21,11 @@
@property (nonatomic, assign) NSInteger identifiant;
@property (nonatomic, assign) NSInteger eligibility;
@property (nonatomic, assign) double frequencyOffset;
@property (nonatomic, strong) NSDate* triggeredAt;
@property (nonatomic, strong) NSArray* filters;
-(id)initWithJSONObject:(NSDictionary*)jsonObject;
-(BOOL)isEligible;
-(BOOL)isPlayable;
@end
//
// APMRulesUtils.h
// APMServices
//
// Created by Vincent Ducastel on 03/02/2017.
// Copyright © 2017 Moonmiles. All rights reserved.
//
#import <Foundation/Foundation.h>
@class APMRule;
@interface APMRulesUtils : NSObject
+(APMRule*)ruleFromId:(NSInteger)identifiant withRules:(NSArray*)array;
+(APMRule*)ruleWithProperties:(NSDictionary*)properties withRules:(NSArray*)rules;
@end
......@@ -8,8 +8,8 @@
// Version of API
#define APM_API_VERSION @"3.0"
#define APM_SERVICES_VERSION_NAME @"2.1.5"
#define APM_SERVICES_VERSION_CODE @"2150"
#define APM_SERVICES_VERSION_NAME @"2.1.6"
#define APM_SERVICES_VERSION_CODE @"2160"
//URL
#define APM_URL_API_PROD @"https://api.appsmiles.eu/" //Url API prod
......
......@@ -407,8 +407,9 @@
#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"
#define APM_FILE_LOT_ANIMATIONS_SDK @"fr.moonmiles.appsmiles:lotAnimations"
#define APM_FILE_LOT_ANIMATIONS_DATA_SDK @"fr.moonmiles.appsmiles:lotAnimationsData"
#define APM_FILE_EXTERNAL_RESOURCES_SDK @"fr.moonmiles.appsmiles:lotAnimations"
#define APM_FILE_EXTERNAL_RESOURCES_LOTTIE_DATA_SDK @"fr.moonmiles.appsmiles:lotAnimationsData"
#define APM_FILE_EXTERNAL_RESOURCES_IMAGE_DATA_SDK @"fr.moonmiles.appsmiles:externalResourcesImageData"
#define APM_FILE_GENEROSITY_BUFFER_SDK @"fr.moonmiles.appsmiles:generosityBuffer"
//Other
......@@ -423,3 +424,7 @@
//Nb tentative to try to retrieve image from server
#define APM_COUNT_LOADING_IMAGE 3
//Frequency offset "1 fopis"
#define APM_FREQUENCY_OFFSET_1_FOIS 9999999999999
//
// APMServicesExternalResUtils.h
// APMServices
//
// Created by Vincent Ducastel on 31/05/2017.
// Copyright © 2017 Moonmiles. All rights reserved.
//
@class APMLOTAnimation;
@interface APMServicesExternalResUtils : NSObject
@property(nonatomic, strong) NSMutableArray *externalResources;
+(APMServicesExternalResUtils *)sharedInstance;
-(void)initInstance;
-(void)loadExternalResForKey:(NSString*)key success:(void (^)(APMLOTAnimation *externalRes))success failure:(void (^)(NSError* error))failure;
-(void)successExternalRes:(NSDictionary*)result;
-(void)resetAll;
@end
......@@ -57,7 +57,7 @@
#import "APMReactUtils.h"
#import "APMServicesConstraintUtils.h"
#import "APMLOTAnimation.h"
#import "APMServicesLOTAnimationsUtils.h"
#import "APMServicesExternalResUtils.h"
#import "APMServicesJson.h"
#import "APMServicesErrorUtils.h"
#import "APMChallenge.h"
......
//
// APMServicesLOTAnimationsUtils.h
// APMServices
//
// Created by Vincent Ducastel on 31/05/2017.
// Copyright © 2017 Moonmiles. All rights reserved.
//
@interface APMServicesLOTAnimationsUtils : NSObject
@property(nonatomic, strong) NSMutableArray *animations;
+(APMServicesLOTAnimationsUtils *)sharedInstance;
-(void)initInstance;
-(void)loadAnimationForKey:(NSString*)key success:(void (^)(NSDictionary *json))success failure:(void (^)(NSError* error))failure;
-(void)successAnimations:(NSDictionary*)result;
-(void)resetAll;
@end
......@@ -63,5 +63,6 @@
+(NSString*)nameOfApplication;
+(BOOL)isEqual:(id)object1 object2:(id)object2;
+(APMUser*)copyUser:(APMUser*)user;
+(BOOL)isDatePast:(NSDate*)date withOffset:(double)offset;
@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