MyApi.h 12.5 KB
//
//  MyApi.h
//  warplyFramework
//
//  Created by Βασιλης Σκουρας on 8/12/21.
//

#ifndef MyApi_h
#define MyApi_h
#import <UIKit/UIKit.h>
#import <CoreMotion/CoreMotion.h>
@class Warply;

@interface MyApi : NSObject

@property (nonatomic, weak) Warply *warply;

- (void) initialize:(NSDictionary *)launchOptions uuid:(NSString*)uuid merchantId:(NSString*)merchantId lang:(NSString*)lang;
- (void) initializeWithCallback:(NSDictionary *)launchOptions uuid:(NSString*)uuid merchantId:(NSString*)merchantId lang:(NSString*)lang successBlock:(void(^)(NSDictionary *successBlock))success failureBlock:(void(^)(NSError *error))failure;
- (void) setToStage;
- (void) setLang:(NSString*) lang;
- (void) getSteps:(void(^)(CMPedometerData* stepsData)) completion;
- (void) startTrackingSteps:(void(^)(NSNumber * _Nullable numberOfSteps))callback;
- (void) stopTrackingSteps;
// - (UIViewController *) openCoupons:(UIView*) parentView;
//- (UIViewController *) openCoupon:(UIView*) parentView coupon:(NSDictionary*) coupon;
//- (UIViewController *) openCouponBarcode:(UIView*) parentView coupon:(NSDictionary*) coupon;
//- (UIViewController *) openGifts:(UIView*) parentView;
//- (UIViewController *) openAllGifts:(UIView*) parentView;
//- (UIViewController *) openOldCoupons:(UIView*) parentView;
//- (UIViewController *) openWallet:(UIView*) parentView;
//- (UIViewController *) openMoreForYou:(UIView*) parentView;
//- (UIViewController *) openCampaign:(UIView*) parentView campaign:(NSString*) campaign;
//- (UIViewController *) openSteps:(UIView*) parentView;
//- (UIViewController *) openDetails:(UIView*) parentView;
- (NSDictionary *) provideInfoForCampaign;
- (void) applicationDidEnterBackground:(UIApplication *)application;
- (void) applicationWillEnterForeground:(UIApplication *)application;
- (void) applicationDidBecomeActive:(UIApplication *)application;
- (void) applicationWillTerminate:(UIApplication *)application;
- (void) application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;
- (void) application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error;
- (void) application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo;
- (NSMutableArray *)getInbox;
- (NSMutableArray *)getProducts:(NSString *) filter;
- (NSMutableArray*)sendContact:(NSString*)name email:(NSString*)email msisdn:(NSString*)msisdn message:(NSString*)message;
- (NSMutableArray *)getContentWithCategory:(NSString *)category tags:(NSArray *)tags;
- (NSMutableArray *)getMerchantCategories;
- (NSMutableArray *)getMerchants;
- (NSMutableArray *)getTagsCategories;
- (NSMutableArray *)getTags;
- (NSDictionary *)login:(NSString *)id password:(NSString *)password loginType:(NSString*) loginType;
- (NSDictionary *)logout;
- (NSDictionary *)register:(NSString *)id password:(NSString *)password name:(NSString*)name email:(NSString*)email segmentation:(NSNumber*)segmentation newsletter:(NSNumber*)newsletter;
- (NSDictionary *)registerAutoLogin:(NSString *)id password:(NSString *)password name:(NSString*)name email:(NSString*)email segmentation:(NSNumber*)segmentation newsletter:(NSNumber*)newsletter loginType:(NSString*)loginType;
- (NSDictionary *)refreshToken;
- (NSDictionary *)changePassword:(NSString *)oldPassword newPassword:(NSString *)newPassword;
- (NSDictionary *)getProfile;
- (NSDictionary *)editProfile:(NSString*)firstname andLastname:(NSString*)lastname andEmail:(NSString *)email andSalutation:(NSString *)salutation andMsisdn:(NSString *)msisdn andNickname:(NSString *)nickname andGender:(NSString *)gender andBirthday:(NSString *)birthday andNameDay:(NSString *)nameday andTaxID:(NSString *)taxid andProfileMetadata:(NSDictionary *)profileMetadata optin:(NSNumber *)optin newsLetter:(NSNumber *)newsletter andSMS:(NSNumber *)sms andSegmentation:(NSNumber *)segmentation andSMSSegmentation:(NSNumber *)smsSegmentation;
- (NSDictionary *)changeProfileImage:(NSString*)image andUserId:(NSString*)userId;
- (NSDictionary*) addCard:(NSString*)number andCardIssuer:(NSString*)cardIssuer andCardHolder:(NSString*)cardHolder andExpirationMonth:(NSString*)expirationMonth andExpirationYear:(NSString*)expirationYear;
- (NSDictionary*) getCards;
- (NSDictionary*) deleteCard:(NSString*)token;
- (NSDictionary*) verifyTicket:(NSString*)guid ticket:(NSString*)ticket;
- (NSDictionary*) getCoupons;
- (NSDictionary*) getTransactionHistory;
- (NSDictionary*) getPointsHistory;
- (NSDictionary*) getSharingHistory;
- (NSDictionary*)addAddress:(NSString*)friendlyName andAddressName:(NSString*)addressName andAddressNumber:(NSString*)addressNumber andPostalCode:(NSString*)postalCode andFloorNumber:(NSNumber*)floorNumber andDoorbell:(NSString*)doorbel andRegion:(NSString*)region andLatitude:(NSString*)latitude andLongitude:(NSString*)longitude andNotes:(NSString*)notes;
- (NSDictionary*)getAddress;
- (NSDictionary*)editAddress:(NSString*)friendlyName andAddressName:(NSString*)addressName andAddressNumber:(NSString*)addressNumber andPostalCode:(NSString*)postalCode andFloorNumber:(NSNumber*)floorNumber andDoorbell:(NSString*)doorbel andRegion:(NSString*)region andLatitude:(NSString*)latitude andLongitude:(NSString*)longitude andNotes:(NSString*)notes andUuid:(NSString*)uuid;
- (NSDictionary*)deleteAddress:(NSString*)uuid;
- (NSDictionary*)redeemCoupon:(NSString*)id andUuid:(NSString*)uuid;
- (NSDictionary*)forgotPasswordWithId:(NSString*)id andConfCode:(NSString*)confCode andOtpUuid:(NSString*)otpUuid;
- (NSDictionary*)resetPasswordWithPassword:(NSString*)password andConfCode:(NSString*)confCode andOtpUuid:(NSString*)otpUuid andConfToken:(NSString*)confToken;
- (NSDictionary*)requestOtpWithMsisdn:(NSString*)msisdn andScope:(NSString*)scope;
- (NSDictionary*)retrieveMultilingualMerchantsWithCategories:(NSArray*)categories andDefaultShown:(NSNumber*)defaultShown andCenter:(NSNumber*)center andTags:(NSArray*)tags andUuid:(NSString*)uuid andDistance:(NSNumber*)distance;
- (NSDictionary*)getCouponSetsWithActive:(NSNumber*)active andVisible:(NSNumber*)visible andUuids:(NSArray*)uuids;
- (NSDictionary*)redeemCouponWithCoupon:(NSString*)coupon :(NSString*)communication_uuid;
- (NSDictionary*)validateCouponWithCoupon:(NSString*)coupon;
- (NSDictionary*)loginCosmoteWithGuid:(NSString*)guid andAppUuid:(NSString*)appUuid andTicket:(NSString*)ticket;
- (void)getCouponsWithSuccessBlock:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
- (void)getUnifiedCouponsAsync:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
- (void)getCouponsetsAsync:(NSNumber*) active andVisible:(NSNumber*) visible andUuids:(NSArray*) uuids :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
- (void)getInboxAsync:(void (^)(NSArray *list))success failureBlock:(void (^)(NSError *error))failure;
- (void)verifyTicketAsync:(NSString*)guid :(NSString*)ticket :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
- (void)getProfileAsync:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
- (void)consumerIntegrationAsync:(NSNumber*)nonTelco :(NSNumber*)acceptedConsent :(NSArray*)msisdnList :(NSString*)guid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
- (void)redeemCouponSetAsync:(NSString*)uuid :(NSString*)communication_uuid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
- (void)redeemCouponSetAsync:(NSString*)uuid :(NSString*)communication_uuid :(NSString*)user_msisdn :(NSString*)businessService :(NSString*)offerName :(NSString*)productType :(NSString*)provDuration :(NSString*)noOfRecurrance :(NSString*)price :(NSString*)discount :(NSString*)voiceCategory :(NSString*)dataCategory :(NSString*)minsValue :(NSString*)dataValue :(NSString*)provStepValueMins :(NSString*)OfferAudienceLevel :(NSString*)UACIOfferTrackingCode :(NSString*)OFFERCODE1 :(NSString*)SCORE :(NSString*)ZONE :(NSString*)WAVE :(NSString*)VALIDITY :(NSString*)TREATMENT_CODE :(NSString*)ccms_session_id :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
- (void)getPacingDetailsAsync:(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
- (void)setPacingDetailsAsync:(NSNumber*)steps :(NSString*)date :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
- (void)cosmoteSharingAsync:(NSString*)sharingId :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
- (void)cosmoteRetrieveSharingAsync:(NSString*)sharingId :(NSNumber*)accept :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
- (void)getCosmoteUserAsync:(NSString*)guid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
- (void)cosmoteCouponSharingAsync:(NSString*) coupon :(NSString*)sender :(NSString*)receiver :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
- (void)submitOrderAsync:(NSString*) campaign_session_uuid :(NSString*)user_msisdn :(NSString*)businessService :(NSString*)offerName :(NSString*)productType :(NSString*)provDuration :(NSString*)noOfRecurrance :(NSString*)price :(NSString*)discount :(NSString*)voiceCategory :(NSString*)dataCategory :(NSString*)minsValue :(NSString*)dataValue :(NSString*)provStepValueMins :(NSString*)OfferAudienceLevel :(NSString*)UACIOfferTrackingCode :(NSString*)OFFERCODE1 :(NSString*)SCORE :(NSString*)ZONE :(NSString*)WAVE :(NSString*)VALIDITY :(NSString*)TREATMENT_CODE :(NSString*)ccms_session_id :(NSString*)notificationMessage :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
- (void)postEventAsync:(NSString*)Session_ID :(NSString*)OfferAudienceLevel :(NSString*)msisdn :(NSString*)UACIOfferTrackingCode :(NSString*)OFFERCODE1 :(NSString*)SCORE :(NSString*)ZONE :(NSString*)WAVE :(NSString*)VALIDITY :(NSString*)TREATMENT_CODE :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
- (void)getCampaignsAsyncNew:(NSString*)language :(NSDictionary*)filters :(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure;
- (void)getCampaignsPersonalizedAsync:(NSString*)language :(NSDictionary*)filters :(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure;
- (void)getSharingHistoryAsync:(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure;
- (void)getMarketSharingHistoryAsync:(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure;
- (void)getMultilingualMerchantsAsync:(NSArray*)categories andDefaultShown:(NSNumber*)defaultShown andCenter:(NSNumber*)center andTags:(NSArray*)tags andUuid:(NSString*)uuid andDistance:(NSNumber*)distance parent_uuids:(NSArray*)parent_uuids :(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure;
// - (void)didReceiveNotification:(NSDictionary *)userInfo whileAppWasInState:(WLApplicationState)state;
- (void)didReceiveNotification:(NSDictionary *)payload;
- (BOOL)checkforLoyaltySDKNotification:(NSDictionary *)payload;
//- (NSNumber*)checkforLoyaltySDKNotification:(NSDictionary *)payload;
//  TEST CODE FOR PUSH
// - (BOOL)checkforLoyaltySDKNotification:(NSDictionary *)payload whileAppWasInState:(UIApplicationState)appState;
//  TEST CODE FOR PUSH
// - (BOOL)checkforLoyaltySDKNotification:(NSDictionary *)payload :(void(^)(NSNumber *successResponse))success failureBlock:(void(^)(NSNumber *failureResponse))failure;
- (void)sendDeviceInfoIfNecessary:(NSString *)newDeviceToken;
- (BOOL)sdkInitialised;
- (void)editProfileAsync:(NSString*)firstname andLastname:(NSString*)lastname andEmail:(NSString *)email andSalutation:(NSString *)salutation andMsisdn:(NSString *)msisdn andNickname:(NSString *)nickname andGender:(NSString *)gender andBirthday:(NSString *)birthday andNameDay:(NSString *)nameday andTaxID:(NSString *)taxid andProfileMetadata:(NSDictionary *)profileMetadata optin:(NSNumber *)optin newsLetter:(NSNumber *)newsletter andSMS:(NSNumber *)sms andSegmentation:(NSNumber *)segmentation andSMSSegmentation:(NSNumber *)smsSegmentation :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
- (void)getSingleCampaignAsync:(NSString*)sessionUuid :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
- (void) sendEvent: (NSString *) eventName priority: (BOOL) priority;
- (void)updateRefreshTokenMA:(NSString*)access_token :(NSString*)refresh_token;
- (NSString*)getAccessTokenM;

@end
#endif /* MyApi_h */