Commit 984de732 authored by Vincent's avatar Vincent

Version 2.1.0

parent 6cc353e2
......@@ -8,7 +8,7 @@
Pod::Spec.new do |s|
s.name = 'APMServices'
s.version = '2.0.5'
s.version = '2.1.0'
s.summary = 'app\'s miles® boosts your app\'s usage'
# This description is used to generate tags and improve search results.
......
......@@ -8,13 +8,14 @@
@interface APMAnimationUtils : NSObject
+(void)animateScaleInAndScaleOut:(UIView*)view parentView:(UIView*)parentView duration:(NSTimeInterval)duration scaleIn:(CGFloat)scaleIn onAnimationEnd:(void (^)())onAnimationEnd;
+(void)animateScaleInAndScaleOut:(UIView*)view parentView:(UIView*)parentView duration:(NSTimeInterval)duration scaleIn:(CGFloat)scaleIn onAnimationEnd:(void (^)(void))onAnimationEnd;
+(void)animateFade:(UIView*)view parentView:(UIView*)parentView duration:(NSTimeInterval)duration from:(CGFloat)from to:(CGFloat)to completion:(void (^)(BOOL finished))completion;
+(void)animateScaleInfinite:(UIView*)view duration:(NSTimeInterval)duration toScale:(CGFloat)toScale;
+(void)animationFromScaleAndFadeView:(UIView*)view withParentView:(UIView*)parentView duration:(float)duration scale:(float)scaleValue;
+(void)showLoader:(UIActivityIndicatorView*)loader completion:(void (^)())completion;
+(void)hideLoader:(UIActivityIndicatorView*)loader completion:(void (^)())completion;
+(void)showView:(UIView*)view completion:(void (^)())completion;
+(void)hideView:(UIView*)view completion:(void (^)())completion;
+(void)showLoader:(UIActivityIndicatorView*)loader completion:(void (^)(void))completion;
+(void)hideLoader:(UIActivityIndicatorView*)loader completion:(void (^)(void))completion;
+(void)showView:(UIView*)view completion:(void (^)(void))completion;
+(void)hideView:(UIView*)view completion:(void (^)(void))completion;
+(void)animateSelectCell:(UIView*)cell selectedColor:(UIColor*)selectedColor unselectedColor:(UIColor*)unselectedColor completion:(void (^)(void))completion;
@end
......@@ -13,5 +13,6 @@
+(NSMutableArray*)arrayWithHowWorks:(NSMutableArray*)array;
+(NSMutableArray*)arrayWithPages:(NSMutableArray*)array;
+(NSMutableArray*)arrayWithUsers:(NSMutableArray*)array;
+(NSMutableArray*)arrayWithArray:(NSArray*)array withClass:(Class)klass;
@end
......@@ -37,5 +37,7 @@
-(void)use;
-(void)resetImageMediaLoading;
-(NSString*)burnDateString;
-(NSString*)issuedDateString;
-(NSString*)expirationDateString;
@end
//
// APMCategoryTrophy.h
// APMServices
//
// Created by Vincent Ducastel on 09/01/2017.
// Copyright © 2017 Moonmiles. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "APMModel.h"
#define APM_K_CATEGORY_TROPHY_ID @"id"
#define APM_K_CATEGORY_TROPHY_LABEL @"label"
#define APM_K_CATEGORY_TROPHY_DESC @"desc"
#define APM_K_CATEGORY_TROPHY_TROPHIES @"trophies"
@interface APMCategoryTrophy : APMModel<NSCoding, NSCopying>
@property(nonatomic, assign) NSInteger identifiant;
@property(nonatomic, strong) NSString *label;
@property(nonatomic, strong) NSString *desc;
@property(nonatomic, strong) NSMutableArray *trophies;
-(instancetype)initWithJSONObject:(NSDictionary*)jsonObject;
-(BOOL)hasAtLeastOneVisibleTrophy;
@end
//
// APMCategoryTrophyUtils.h
// APMServices
//
// Created by Vincent Ducastel on 09/01/2017.
// Copyright © 2017 Moonmiles. All rights reserved.
//
#import <Foundation/Foundation.h>
@class APMCategoryTrophy;
@interface APMCategoryTrophyUtils : NSObject
+(APMCategoryTrophy*)categoryTrophyFromId:(NSInteger)identifiant withCategoriesTrophy:(NSMutableArray*)array;
@end
//
// APMChallenge.h
// APMServices
//
// Created by Vincent Ducastel on 09/01/2017.
// Copyright © 2017 Moonmiles. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "APMModel.h"
#define APM_K_CHALLENGE_ID @"id"
#define APM_K_CHALLENGE_LABEL @"label"
#define APM_K_CHALLENGE_DESC @"desc"
#define APM_K_CHALLENGE_CURRENT_STEP @"currentStep"
#define APM_K_CHALLENGE_TOTAL_STEP @"totalStep"
#define APM_K_CHALLENGE_VALUE @"value"
#define APM_K_CHALLENGE_IS_SUPER @"isSuper"
#define APM_K_CHALLENGE_GENEROSITIES @"generosities"
#define APM_K_CHALLENGE_TRIGGERED_AT @"triggeredAt"
#define APM_K_CHALLENGE_IS_RECENTLY_COMPLETED @"isRecentlyCompleted"
@interface APMChallenge : APMModel<NSCoding, NSCopying>
@property(nonatomic, assign) NSInteger identifiant;
@property(nonatomic, strong) NSString *label;
@property(nonatomic, strong) NSString *desc;
@property(nonatomic, assign) NSInteger currentStep;
@property(nonatomic, assign) NSInteger totalStep;
@property(nonatomic, assign) NSInteger value;
@property(nonatomic, assign) BOOL isSuper;
@property(nonatomic, strong) NSMutableArray *generosities;
@property(nonatomic, strong) NSDate *triggeredAt;
//Local
@property(nonatomic, assign) BOOL isRecentlyCompleted;
-(instancetype)initWithJSONObject:(NSDictionary*)jsonObject;
-(BOOL)isPlayable;
-(BOOL)isDone;
-(void)updateWithChallenge:(APMChallenge*)challenge;
@end
//
// APMChallengesUtils.h
// APMServices
//
// Created by Vincent Ducastel on 03/02/2017.
// Copyright © 2017 Moonmiles. All rights reserved.
//
#import <Foundation/Foundation.h>
@class APMChallenge;
@interface APMChallengesUtils : NSObject
+(NSMutableArray*)getChallengesFromChallenges:(NSMutableArray*)challenges isSuper:(BOOL)isSuper;
+(APMChallenge*)challengeFromId:(NSInteger)identifiant withChallenges:(NSMutableArray*)array;
@end
......@@ -18,14 +18,13 @@
@property(nonatomic, strong) NSString *tagLabel;
@property(nonatomic, strong) NSString *actionName;
@property(nonatomic, strong) NSString *classID;
@property(nonatomic, assign) NSInteger generosityCeiling;
@property(nonatomic, strong) NSDate* triggedAt;
@property(nonatomic, assign) double offset;
@property(nonatomic, assign) NSInteger generosityType;
@property(nonatomic, strong) NSString *deeplinkUrl;
@property(nonatomic, strong) NSString *frequency;
-(id)initWithJSONObject:(NSDictionary*)jsonObject;
-(NSString*)getCeilingStr;
-(BOOL)isActived;
-(BOOL)isPlayable;
......
//
// APMLOTAnimation.h
// APMServices
//
// Created by Vincent Ducastel on 09/01/2017.
// Copyright © 2017 Moonmiles. All rights reserved.
//
#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"
@interface APMLOTAnimation : APMModel<NSCoding, NSCopying>
@property(nonatomic, strong) NSString *url;
@property(nonatomic, strong) NSDictionary *json;
@property(nonatomic, strong) NSString *key;
@property(nonatomic, assign) NSInteger version;
-(instancetype)initWithJSONObject:(NSDictionary*)jsonObject;
-(void)loadWithSuccess:(void (^)(NSDictionary *json))success failure:(void (^)(NSError* error))failure;
-(void)resetAnimationIfNeeded:(APMLOTAnimation*)animation;
-(void)loadJsonData;
@end
......@@ -17,6 +17,10 @@
@class APMAction;
@class APMBurn;
@class APMVersions;
@class APMUserJourney;
@class APMTrophy;
@class APMChallenge;
@class APMUserStatus;
@protocol APMServicesListener <NSObject>
......@@ -24,6 +28,9 @@
-(void)apmServicesReady:(BOOL)newInfos;
-(void)apmServicesDisable;
-(void)apmServicesUserWinPoints:(APMEarn*)earn user:(APMUser*)user;
-(void)apmServicesUserWinChallenge:(APMChallenge*)challenge user:(APMUser*)user;
-(void)apmServicesUserWinTrophy:(APMTrophy*)trophy user:(APMUser*)user;
-(void)apmServicesUserWinLevel:(APMUserStatus*)userStatus user:(APMUser*)user;
@end
......@@ -56,6 +63,7 @@
@property(nonatomic, strong, readonly) APMGift* gift;
@property(nonatomic, strong, readonly) APMGenerosity* generosity;
@property(nonatomic, strong, readonly) NSMutableArray *generosities;
@property(nonatomic, strong) APMUser* oldUser;
@property(nonatomic, strong, readonly) NSMutableArray *status;
@property(nonatomic, strong, readonly) NSMutableDictionary* theme;
......
//
// APMServicesApplicationAppsmiles.h
// APMServices
//
// Created by Vincent Ducastel on 19/08/2015.
// Copyright (c) 2015 Moonmiles. All rights reserved.
//
@interface APMServicesApplicationAppsmiles : NSObject
+(BOOL)applicationAppsmilesCompatible;
+(void)downloadAppsmiles;
+(void)launchAppsmilesActionGetToken;
+(void)launchAppsmilesActionGift:(NSInteger)giftID;
+(void)launchAppsmilesActionGifts;
+(void)launchAppsmilesActionBurns;
@end
......@@ -8,8 +8,8 @@
// Version of API
#define APM_API_VERSION @"3.0"
#define APM_SERVICES_VERSION_NAME @"2.0.5"
#define APM_SERVICES_VERSION_CODE @"2050"
#define APM_SERVICES_VERSION_NAME @"2.1.0"
#define APM_SERVICES_VERSION_CODE @"2100"
//URL
#define APM_URL_API_PROD @"https://api.appsmiles.eu/" //Url API prod
......@@ -37,6 +37,7 @@
#define APM_GIFT_NATURE_STATUS 2
//Status burn
#define APM_BURN_STATUS_UNDEFINED -1
#define APM_BURN_STATUS_ISSUED 0
#define APM_BURN_STATUS_USED 1
#define APM_BURN_STATUS_CANCELED 2
......
......@@ -111,7 +111,6 @@
#define APM_K_GENEROSITY_MSG @"generosityMsg"
#define APM_K_GENEROSITY_VALUE @"generosityValue"
#define APM_K_GENEROSITY_FREQUENCE @"generosityFrequence"
#define APM_K_GENEROSITY_PLAFOND @"generosityPlafond"
#define APM_K_GENEROSITY_ID @"generosityID"
#define APM_K_GENEROSITY_TAGID @"tagID"
#define APM_K_GENEROSITY_TAGLABEL @"tagLabel"
......@@ -126,10 +125,12 @@
#define APM_K_GENEROSITY_LNG @"long"
#define APM_K_GENEROSITY_NEXT @"generosityNext"
#define APM_K_GENEROSITY_GET_NEXT_TAG @"getNextTag"
#define APM_K_GENEROSITY_TRIGGED_AT @"triggedAt"
#define APM_K_GENEROSITY_TRIGGED_AT @"triggedAt" //triggedAt and triggeredAt are same
#define APM_K_GENEROSITY_TRIGGERED_AT @"triggeredAt" //triggedAt and triggeredAt are same
#define APM_K_GENEROSITY_OFFSET @"generosityOffset"
#define APM_K_GENEROSITY_TYPE @"generosityType"
#define APM_K_GENEROSITY_DEEPLINK_URL @"generosityUrl"
#define APM_K_GENEROSITY_FREQUENCY @"generosityFrequency"
// Generosities
#define APM_K_GENEROSITIES @"generosities"
......@@ -220,6 +221,10 @@
#define APM_K_USER_STATUS_DESC @"desc"
#define APM_K_USER_STATUS_COLOR @"color"
#define APM_K_USER_STATUS_STEP @"step"
#define APM_K_USER_STATUS_GRADATION @"gradation"
#define APM_K_USER_STATUS_CHALLENGES @"challenges"
#define APM_K_USER_STATUS_MIDDLEGROUND @"middleground"
#define APM_K_USER_STATUS_LEVELED_UP_AT @"leveledUpAt"
// Versions keys
#define APM_K_VERSIONS @"versions"
......@@ -230,6 +235,12 @@
// Traductions keys
#define APM_K_TRADUCTIONS @"traductions"
// User Journey keys
#define APM_K_USER_JOURNEY @"userJourney"
// Animations keys
#define APM_K_ANIMATIONS @"animations"
// Other keys
#define APM_K_DATE @"gmtDate"
#define APM_K_PLACE @"localisation"
......@@ -367,6 +378,7 @@
//Files
#define APM_FILE_USER_SDK @"fr.moonmiles.appsmiles:userObject"
#define APM_FILE_OLD_USER_SDK @"fr.moonmiles.appsmiles:oldUser"
#define APM_FILE_PROG_SDK @"fr.moonmiles.appsmiles:prog"
#define APM_FILE_GENEROSITY_SDK @"fr.moonmiles.appsmiles:generosity"
#define APM_FILE_GIFT_SDK @"fr.moonmiles.appsmiles:gift"
......@@ -380,6 +392,8 @@
#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"
//Other
#define APM_CLASS_ID_AUTO @"auto"
......@@ -387,23 +401,8 @@
#define APM_ACTION_NAME_CREATE @"create" //Creation
#define APM_ACTION_NAME_JOIN @"join" //Connexion
//Scheme url
#define APM_APPSMILES_APP_STORE @"https://itunes.apple.com/us/app/apple-store/id882790868?mt=8" //Url app's miles : App Store
#define APM_SCHM @"appsmiles://"
#define APM_SCHM_SANDBOX @"sandbox-appsmiles://"
//Application App's Miles
#define APM_PACKAGE_NAME_APPLICATION @"fr.moonmiles.appsmiles"
//Scheme actions
#define APM_SCHEME_URL_GET_TOKEN @"gettoken"
#define APM_SCHEME_URL_LIST_GIFT @"listgift"
#define APM_SCHEME_URL_LAST_BURNS @"lastburns"
#define APM_SCHEME_URL_LAST_EARNS @"lastearns"
#define APM_SCHEME_URL_CONVERT_GIFT @"convertgift"
#define APM_SCHEME_URL_LIST_BONUS @"listbonus"
#define APM_SCHEME_URL_LIST_PARTNER @"listpartner"
//Nb tentative to try to retrieve image from server
#define APM_COUNT_LOADING_IMAGE 3
......
//
// APMServicesConstraintUtils.h
// APMServices
//
// Created by Vincent Ducastel on 19/02/2018.
// Copyright © 2018 Moonmiles. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface APMServicesConstraintUtils : NSObject
#pragma mark - FILL
+(void)addView:(UIView*)view inView:(UIView*)inView;
+(void)addView:(UIView*)view inView:(UIView*)inView atIndex:(NSInteger)atIndex;
#pragma mark - CENTER
+(void)addView:(UIView*)view inCenterView:(UIView*)inView;
+(void)addView:(UIView*)view inCenterView:(UIView*)inView atIndex:(NSInteger)atIndex;
@end
......@@ -26,4 +26,9 @@
+(void)setBoolValue:(BOOL)value forkey:(NSString*)key;
+(void)removeKey:(NSString*)key;
#pragma mark - Others
+(BOOL)valueNotNull:(id)value;
+(BOOL)stringNotEmpty:(NSString*)value;
@end
//
// APMServicesErrorUtils.h
// APMServices
//
// Created by Vincent Ducastel on 20/02/2018.
// Copyright © 2018 Moonmiles. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface APMServicesErrorUtils : NSObject
+(NSError*)errorWithCode:(NSInteger)code;
+(NSError*)errorWithCode:(NSInteger)code message:(NSString*)message;
+(NSError*)errorWithDomain:(NSString*)domain code:(NSInteger)code message:(NSString*)message;
@end
......@@ -11,7 +11,7 @@
@interface APMServicesGenerosity : NSObject
+(void)generosityList:(NSString*)classId generosityListSuccess:(void (^)(NSMutableArray* generosities))generosityListSuccess failure:(void (^)(NSError* error))failure;
+(void)generositySave:(APMGenerosity*)generosity value:(NSInteger)value frequence:(NSInteger)frequence ceiling:(NSInteger)ceiling generositySaveSuccess:(void (^)(APMGenerosity* generosity))generositySaveSuccess failure:(void (^)(NSError* error))failure;
+(void)generositySave:(APMGenerosity*)generosity value:(NSInteger)value frequence:(NSInteger)frequence generositySaveSuccess:(void (^)(APMGenerosity* generosity))generositySaveSuccess failure:(void (^)(NSError* error))failure;
+(void)generosityRemove:(APMGenerosity*)generosity generosityRemoveSuccess:(void (^)(APMGenerosity* generosity))generosityRemoveSuccess failure:(void (^)(NSError* error))failure;
@end
......@@ -8,7 +8,6 @@
#import "APMServices.h"
#import "APMServicesConfig.h"
#import "APMServicesApplicationAppsmiles.h"
#import "APMServicesJavaScriptInterface.h"
#import "APMServicesAd.h"
#import "APMServicesPartner.h"
......@@ -43,7 +42,6 @@
#import "APMHowWorks.h"
#import "APMServicesPageUtils.h"
#import "APMArrayUtils.h"
#import "APMServicesTest.h"
#import "APMServicesPreferences.h"
#import "APMWalkthrough.h"
#import "APMWalkthroughsUtils.h"
......@@ -57,7 +55,21 @@
#import "APMAlertControllerUtils.h"
#import "APMModel.h"
#import "APMReactUtils.h"
#import "APMServicesConstraintUtils.h"
#import "APMLOTAnimation.h"
#import "APMServicesLOTAnimationsUtils.h"
#import "APMServicesJson.h"
#import "APMServicesErrorUtils.h"
#import "APMChallenge.h"
#import "APMTrophy.h"
#import "APMCategoryTrophy.h"
#import "APMUserJourney.h"
#import "APMChallengesUtils.h"
#import "APMUserJourneyUtils.h"
#import "APMVersions.h"
#import "APMTrophiesUtils.h"
#import "APMCategoryTrophy.h"
#import "APMTrophyUtils.h"
#import "APMWebServices.h"
#import "APMServicesConfigPrivate.h"
//
// APMServicesJson.h
// APMServices
//
// Created by Vincent Ducastel on 27/03/2017.
// Copyright © 2017 Moonmiles. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface APMServicesJson : NSObject
+(void)getJsonFromUrl:(NSString*)url success:(void (^)(NSDictionary *json))getJsonFromUrlSuccess failure:(void (^)(NSError* error))failure;
@end
//
// 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)lotAnimationForKey:(NSString*)key success:(void (^)(NSDictionary *json))success failure:(void (^)(NSError* error))failure;
-(void)successAnimations:(NSDictionary*)result;
-(void)resetAll;
@end
......@@ -8,6 +8,6 @@
@interface APMServicesLog : NSObject
+(void)logSave:(NSDictionary*)params success:(void (^)())success failure:(void (^)(NSError* error))failure;
+(void)logSave:(NSDictionary*)params success:(void (^)(void))success failure:(void (^)(NSError* error))failure;
@end
//
// APMHowWorksUtils.h
// APMServicesPageUtils.h
// APMServices
//
// Created by Vincent Ducastel on 31/05/2017.
......
......@@ -8,7 +8,7 @@
@interface APMServicesStatistic : NSObject
+(void)statisticGenerosityDisplay:(NSString*)generosityID tagID:(NSString*)tagID success:(void (^)())success failure:(void (^)(NSError* error))failure;
+(void)statisticGiftDisplay:(NSString*)giftID giftLabel:(NSString*)giftLabel success:(void (^)())success failure:(void (^)(NSError* error))failure;
+(void)statisticGenerosityDisplay:(NSString*)generosityID tagID:(NSString*)tagID success:(void (^)(void))success failure:(void (^)(NSError* error))failure;
+(void)statisticGiftDisplay:(NSString*)giftID giftLabel:(NSString*)giftLabel success:(void (^)(void))success failure:(void (^)(NSError* error))failure;
@end
//
// APMServicesTest.h
// APMServices
//
// Created by Vincent Ducastel on 02/11/2016.
// Copyright © 2016 Moonmiles. All rights reserved.
//
@interface APMServicesTest : NSObject
+(NSMutableArray*)getHowWorksTest;
@end
......@@ -19,7 +19,7 @@
+(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 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)userLogout:(void (^)(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;
......@@ -34,14 +34,14 @@
+(void)userHistory:(void (^)(APMUser* user, NSMutableArray* earns, NSMutableArray* burns, NSMutableArray* ads))userHistorySuccess failure:(void (^)(NSError* error))failure;
+(void)userHistoryBurns:(void (^)(NSMutableArray* burns))userHistoryBurnsSuccess failure:(void (^)(NSError* error))failure;
+(void)userHistoryEarns:(void (^)(NSMutableArray* earns))userHistoryEarnsSuccess failure:(void (^)(NSError* error))failure;
+(void)userUnsubscribeWithComment:(NSString*)comment userUnsubscribeSuccess:(void (^)())userUnsubscribeSuccess failure:(void (^)(NSError* error))failure;
+(void)userUnsubscribeWithComment:(NSString*)comment userUnsubscribeSuccess:(void (^)(void))userUnsubscribeSuccess failure:(void (^)(NSError* error))failure;
+(void)userContact:(NSString*)comment userContactSuccess:(void (^)(NSString* message))userContactSuccess failure:(void (^)(NSError* error))failure;
+(void)userEvaluate:(NSString*)note comment:(NSString*)comment userEvaluateSuccess:(void (^)(NSString* message))userEvaluateSuccess failure:(void (^)(NSError* error))failure;
+(void)userGetSettingsWithUserGetSettingsSuccess:(void (^)(BOOL notifPush, BOOL notifMail, BOOL notifSMS))userGetSettingsSuccess failure:(void (^)(NSError* error))failure;
+(void)userSaveSettings:(BOOL)push mail:(BOOL)mail sms:(BOOL)sms phone:(NSString*)phone userSaveSettingsSuccess:(void (^)())userSaveSettingsSuccess failure:(void (^)(NSError* error))failure;
+(void)userSaveSettings:(BOOL)push mail:(BOOL)mail sms:(BOOL)sms phone:(NSString*)phone userSaveSettingsSuccess:(void (^)(void))userSaveSettingsSuccess failure:(void (^)(NSError* error))failure;
+(void)userCheckTokenWithUserCheckTokenSuccess:(void (^)(APMUser* user))userCheckTokenSuccess failure:(void (^)(NSError* error))failure;
+(void)userFBConnect:(NSString*)email fbID:(NSString*)fbID partnerClientId:(NSString*)partnerClientId segments:(NSDictionary*)segments userFBConnectSuccess:(void (^)(APMUser* user))userFBConnectSuccess failure:(void (^)(NSError* error))failure;
+(void)userSavePushToken:(NSString*)pushToken userSavePushTokenSuccess:(void (^)())userSavePushTokenSuccess failure:(void (^)(NSError* error))failure;
+(void)userSavePushToken:(NSString*)pushToken userSavePushTokenSuccess:(void (^)(void))userSavePushTokenSuccess failure:(void (^)(NSError* error))failure;
+(void)userDeleteWithUserDeleteSuccess:(void (^)(void))userDeleteSuccess failure:(void (^)(NSError* error))failure;
+(void)userListWithPartnerClientIDs:(NSArray*)partnerClientIDs userListSuccess:(void (^)(NSArray* users))userListSuccess failure:(void (^)(NSError* error))failure;
......
......@@ -19,9 +19,7 @@
+(void)remove:(NSString*)def;
+(NSDictionary*)paramsFromURL:(NSURL*)url;
+(BOOL)checkCoverage;
+(NSString*)schemeUrl;
+(BOOL)isSandbox;
+(void)showPopupLocationManager;
+(NSMutableArray*) createListActionsFromJsonActions:(NSDictionary*)actions;
+(NSString*)getAPMSchemeWithPartnerID:(NSString*)partnerID;
+(UIImage*)getPartnerIcon;
......@@ -58,7 +56,7 @@
+(BOOL)isAtLeastIos10;
+(NSString*)stringUnicodeFromString:(NSString*)unicodeString;
+(NSString*)stringJsonFromDictionary:(id)jsonObject;
+(NSDictionary*)dictionaryFromStringJson:(NSString*)strValue;
+(id)dictionaryFromStringJson:(NSString*)strValue;
+(NSInteger)heightContentWebView:(UIWebView*)webview;
+(NSString*)stringByStrippingHTML:(NSString*)string;
+(NSString*)nameOfApplication;
......
//
// APMTrophiesUtils.h
// APMServices
//
// Created by Vincent Ducastel on 03/02/2017.
// Copyright © 2017 Moonmiles. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface APMTrophiesUtils : NSObject
+(NSInteger)nbTrophiesOn:(NSMutableArray*)categoriesTrophy;
@end
//
// APMTrophy.h
// APMServices
//
// Created by Vincent Ducastel on 09/01/2017.
// Copyright © 2017 Moonmiles. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "APMModel.h"
#define APM_K_TROPHY_ID @"id"
#define APM_K_TROPHY_LABEL @"label"
#define APM_K_TROPHY_DESC @"description"
#define APM_K_TROPHY_CURRENT_STEP @"currentStep"
#define APM_K_TROPHY_TOTAL_STEP @"totalStep"
#define APM_K_TROPHY_GENEROSITIES @"generosities"
#define APM_K_TROPHY_TRIGGERED_AT @"triggeredAt"
#define APM_K_TROPHY_ILLUS_ON @"illusOn"
#define APM_K_TROPHY_ILLUS_OFF @"illusOff"
#define APM_K_TROPHY_TYPE @"type"
#define APM_K_TROPHY_TYPE_DEFAULT 0
#define APM_K_TROPHY_TYPE_MYSTERY 1
#define APM_K_TROPHY_TYPE_INDIVIDUAL 2
#define APM_K_TROPHY_IS_RECENTLY_COMPLETED @"isRecentlyCompleted"
@interface APMTrophy : APMModel<NSCoding, NSCopying>
@property(nonatomic, assign) NSInteger identifiant;
@property(nonatomic, strong) NSString *label;
@property(nonatomic, strong) NSString *desc;
@property(nonatomic, assign) NSInteger currentStep;
@property(nonatomic, assign) NSInteger totalStep;
@property(nonatomic, strong) NSMutableArray *generosities;
@property(nonatomic, strong) NSDate *triggeredAt;
@property(nonatomic, strong) NSString *illusOn;
@property(nonatomic, strong) NSString *illusOff;
@property(nonatomic, assign) NSInteger type;
//Local
@property(nonatomic, assign) BOOL isRecentlyCompleted;
-(instancetype)initWithJSONObject:(NSDictionary*)jsonObject;
-(void)updateWithTrophy:(APMTrophy*)trophy;
-(BOOL)isDone;
-(BOOL)isMystery;
-(BOOL)isIndividual;
@end
//
// APMTrophyUtils.h
// APMServices
//
// Created by Vincent Ducastel on 09/01/2017.
// Copyright © 2017 Moonmiles. All rights reserved.
//
#import <Foundation/Foundation.h>
@class APMTrophy;
@interface APMTrophyUtils : NSObject
+(APMTrophy*)trophyFromId:(NSInteger)identifiant withTrophies:(NSMutableArray*)array;
@end
......@@ -8,6 +8,8 @@
#import "APMModel.h"
@class APMUserJourney;
@interface APMUser : APMModel<NSCoding, NSCopying>
@property(nonatomic, strong) NSString *userToken;
......@@ -29,8 +31,9 @@
@property(nonatomic, strong) NSMutableDictionary *segments;
@property(nonatomic, strong) NSString *loyaltyId;
@property(nonatomic, strong) id customParams;
@property(nonatomic, strong) APMUserJourney* userJourney;
-(void)initWithJSONObject:(NSDictionary*)jsonObject;
-(void)updateWithJSONObject:(NSDictionary*)jsonObject;
-(BOOL)isConnected;
-(NSString*)birthdateString;
-(void)setBirthdateString:(NSString*)birthdateString;
......
//
// APMUserJourney.h
// APMServices
//
// Created by Vincent Ducastel on 09/01/2017.
// Copyright © 2017 Moonmiles. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "APMModel.h"
@class APMUser;
#define APM_K_USER_JOURNEY_USER_STATUS @"status"
#define APM_K_USER_JOURNEY_USER_STATUS_UPDATED_AT @"statusUpdatedAt"
#define APM_K_USER_JOURNEY_CATEGORIES_TROPHIES @"categories"
#define APM_K_USER_JOURNEY_CATEGORIES_TROPHIES_JOURNEY_UPDATED_AT @"categoriesUpdatedAt"
@interface APMUserJourney : APMModel<NSCoding, NSCopying>
@property(nonatomic, strong) NSMutableArray *userStatuses;
@property(nonatomic, strong) NSDate *userStatusesUpdatedAt;
@property(nonatomic, strong) NSMutableArray *categoriesTrophy;
@property(nonatomic, strong) NSDate *categoriesTrophyJourneyUpdatedAt;
-(instancetype)initWithJSONObject:(NSDictionary*)jsonObject;
-(void)updateWithJSONObject:(NSDictionary*)jsonObject;
-(void)copyStatusWithUserJourney:(APMUserJourney*)userJourney;
-(void)copyTrophiesWithUserJourney:(APMUserJourney*)userJourney;
@end
//
// APMUserJourneyUtils.h
// APMServices
//
// Created by Vincent Ducastel on 04/05/2018.
// Copyright © 2018 Moonmiles. All rights reserved.
//
#import <Foundation/Foundation.h>
@class APMUser;
@class APMChallenge;
@class APMTrophy;
@class APMUserJourney;
@interface APMUserJourneyUtils : NSObject
+(BOOL)haveNewUserJourney;
+(BOOL)haveNewUserJourneyWithUser:(APMUser*)user nextUser:(APMUser*)nextUser;
+(BOOL)haveNewStatusUserJourney;
+(BOOL)haveNewStatusUserJourneyWithUser:(APMUser*)user nextUser:(APMUser*)nextUser;
+(APMChallenge*)getChallengeWithStatusId:(NSInteger)statusId challengeId:(NSInteger)challengeId inUserJourney:(APMUserJourney*)userjourney;
+(BOOL)haveNewTrophiesUserJourney;
+(BOOL)haveNewTrophiesUserJourneyWithUser:(APMUser*)user nextUser:(APMUser*)nextUser;
+(APMTrophy*)getTrophyWithCategoryTrophyId:(NSInteger)categoryTrophyId trophyId:(NSInteger)trophyId inUserJourney:(APMUserJourney*)userjourney;
@end
......@@ -17,6 +17,10 @@
@property(nonatomic, strong) NSString *desc;
@property(nonatomic, strong) NSString *color;
@property(nonatomic, assign) NSInteger step;
@property(nonatomic, assign) NSInteger gradation;
@property(nonatomic, strong) NSMutableArray *challenges;
@property(nonatomic, strong) NSString *middleground;
@property(nonatomic, strong) NSDate *leveledUpAt;
-(instancetype)initWithJSONObject:(NSDictionary*)jsonObject;
......
......@@ -15,5 +15,6 @@
+(NSMutableArray*)arrayWithStatus:(NSMutableArray*)array;
+(APMUserStatus*)statusFromId:(NSInteger)identifiant withStatus:(NSMutableArray*)array;
+(APMUserStatus*)nextStatusFromCurrentStatus:(APMUserStatus*)currentStatus withStatus:(NSMutableArray*)array;
+(APMUserStatus*)nextStatusForUser:(NSInteger)statusId withStatus:(NSMutableArray*)array;
@end
......@@ -15,6 +15,7 @@
@property (nonatomic, assign) NSInteger theme; //Version number of theme data
@property (nonatomic, assign) NSInteger traductions; //Version number of traductions data
@property (nonatomic, assign) NSInteger pages; //Version number of pages data
@property (nonatomic, assign) NSInteger animations; //Version number of animations data
-(void)initWithJSONObject:(NSDictionary*)jsonObject withThemeValid:(BOOL)themeValid;
-(NSString*)getVersionsJsonToStr;
......
......@@ -13,4 +13,6 @@
+(void)setFont:(NSString*)fontName forLabel:(UILabel*)label;
+(void)setFont:(NSString*)fontName withSize:(CGFloat)size forLabel:(UILabel*)label;
+(UIViewController*)firstAvailableUIViewControllerForView:(UIView*)view;
@end
......@@ -9,6 +9,7 @@
@class APMAFHTTPRequestOperation;
@class APMGenerosity;
@class APMVersions;
@class APMIdsFromTagId;
@interface APMWebServices : NSObject
......@@ -86,10 +87,10 @@
+(void)adSpecialsList:(NSString*)userToken success:(void (^)(NSURLSessionDataTask* task, id responseObject))success failure:(void (^)(NSURLSessionDataTask* task, NSError* error))failure;
+(void)adSpecialsList:(NSString*)userToken params:(NSDictionary*)params success:(void (^)(NSURLSessionDataTask* task, id responseObject))success failure:(void (^)(NSURLSessionDataTask* task, NSError* error))failure;
+(void)initCheckStore:(NSString*)partnerId userToken:(NSString*)userToken partnerClientId:(NSString*)partnerClientId email:(NSString*)email classId:(NSString*)classId tagId:(NSString*)tagId date:(NSString*)date latitude:(NSString*)latitude longitude:(NSString*)longitude generosity:(APMGenerosity*)generosity partnerLevel:(NSInteger)partnerLevel versions:(APMVersions*)versions success:(void (^)(NSURLSessionDataTask* task, id responseObject))success failure:(void (^)(NSURLSessionDataTask* task, NSError* error))failure;
+(void)initCheckStore:(NSString*)partnerId userToken:(NSString*)userToken partnerClientId:(NSString*)partnerClientId email:(NSString*)email classId:(NSString*)classId tagId:(NSString*)tagId ids:(APMIdsFromTagId*)ids date:(NSString*)date generosity:(APMGenerosity*)generosity partnerLevel:(NSInteger)partnerLevel versions:(APMVersions*)versions success:(void (^)(NSURLSessionDataTask* task, id responseObject))success failure:(void (^)(NSURLSessionDataTask* task, NSError* error))failure;
+(void)initCheckStore:(NSString*)userToken params:(NSMutableDictionary*)params success:(void (^)(NSURLSessionDataTask* task, id responseObject))success failure:(void (^)(NSURLSessionDataTask* task, NSError* error))failure;
+(void)generosityStore:(NSString*)userToken partnerId:(NSString*)partnerId tagId:(NSString*)tagId date:(NSString*)date latitude:(NSString*)latitude longitude:(NSString*)longitude success:(void (^)(NSURLSessionDataTask* task, id responseObject))success failure:(void (^)(NSURLSessionDataTask* task, NSError* error))failure;
+(void)generosityStore:(NSString*)userToken partnerId:(NSString*)partnerId tagId:(NSString*)tagId date:(NSString*)date ids:(APMIdsFromTagId*)ids success:(void (^)(NSURLSessionDataTask* task, id responseObject))success failure:(void (^)(NSURLSessionDataTask* task, NSError* error))failure;
+(void)generosityStore:(NSString*)userToken params:(NSDictionary*)params success:(void (^)(NSURLSessionDataTask* task, id responseObject))success failure:(void (^)(NSURLSessionDataTask* task, NSError* error))failure;
+(void)generosityList:(NSString*)userToken classId:(NSString*)classId success:(void (^)(NSURLSessionDataTask* task, id responseObject))success failure:(void (^)(NSURLSessionDataTask* task, NSError* error))failure;
......@@ -131,6 +132,8 @@
+(void)storeList:(NSString*)userToken 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)callHttp:(NSString*)url success:(void (^)(NSURLSessionDataTask* task, id responseObject))success failure:(void (^)(NSURLSessionDataTask* task, NSError* error))failure;
+(NSString*)createUserAgent;
......
......@@ -35,6 +35,6 @@
+(void) showWithTitle:(NSString*) title message:(NSString*) message cancelButtonTitle:(NSString *)cancelButtonTitle;
+(void) showWithMessage:(NSString*) message cancelButtonTitle:(NSString *)cancelButtonTitle;
void import_UIAlertViewAPMBlocks ( );
void import_UIAlertViewAPMBlocks ( void);
@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