Manos Chorianopoulos

add initializeWithCallback

No preview for this file type
......@@ -7,7 +7,7 @@
<key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>0</integer>
</dict>
</dict>
</dict>
......
......@@ -7,7 +7,7 @@
<key>SwiftWarplyFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>1</integer>
</dict>
</dict>
</dict>
......
......@@ -16,6 +16,7 @@
@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;
......
......@@ -51,6 +51,36 @@ CMPedometer *pedometer;
// }
}
- (void)initializeWithCallback:(NSDictionary *)launchOptions uuid:(NSString*)uuid merchantId:(NSString*)merchantId lang:(NSString*)lang successBlock:(void(^)(NSDictionary *successBlock))success failureBlock:(void(^)(NSError *error))failure{
#if (DEBUG == 1)
[Warply launchWithAppUUIDWithCallback:uuid launchOptions:launchOptions andSuccessBlock:success andFailureBlock:failure];
#else
[Warply launchWithAppUUIDWithCallback:uuid launchOptions:launchOptions andSuccessBlock:success andFailureBlock:failure];
#endif
[[Warply sharedService].pushManager registerForRemoteNotifications];
[[Warply sharedService].pushManager resetBadge];
MERCHANT_ID = merchantId;
LANG = lang;
//removal of caching
int cacheSizeMemory = 0; // 0MB
int cacheSizeDisk = 0; // 0MB
NSURLCache *sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:cacheSizeMemory diskCapacity:cacheSizeDisk diskPath:@"nsurlcache"];
[NSURLCache setSharedURLCache:sharedCache];
// date = [NSDate date];
// if ([CMPedometer isStepCountingAvailable]) {
// pedometer = [[CMPedometer alloc] init];
// [NSTimer scheduledTimerWithTimeInterval:0.5f
// target:self
// selector:@selector(recursiveQuery)
// userInfo:nil
// repeats:YES];
// } else {
// NSLog(@"Nothing available");
//
// }
}
- (void)queryDataFrom:(NSDate *)startDate toDate:(NSDate *)endDate {
[pedometer queryPedometerDataFromDate:startDate
toDate:endDate
......
......@@ -145,6 +145,7 @@ typedef enum {
empty if application launched by user.
*/
+ (void)launchWithAppUUID:(NSString *)appUUID launchOptions:(NSDictionary *)launchOptions;
+ (void)launchWithAppUUIDWithCallback:(NSString *)appUUID launchOptions:(NSDictionary *)launchOptions andSuccessBlock:(void (^)(NSDictionary *))success andFailureBlock:(void (^)(NSError *error))failure;
/*!
@abstract Launching the Warply service.
......@@ -157,6 +158,7 @@ typedef enum {
@param customPushDelegate an class conforming to the WLCustomPushDelegate protocol responsible for handling the push notification.
*/
+ (void)launchWithAppUUID:(NSString *)appUUID launchOptions:(NSDictionary *)launchOptions customPushHandler:(id <WLCustomPushHandler>)customPushHandler;
+ (void)launchWithAppUUIDWithCallback:(NSString *)appUUID launchOptions:(NSDictionary *)launchOptions customPushHandler:(id <WLCustomPushHandler>)customPushHandler andSuccessBlock:(void (^)(NSDictionary *))success andFailureBlock:(void (^)(NSError *error))failure;
/*!
@abstract Launching the Warply service.
......@@ -170,6 +172,7 @@ typedef enum {
@param baseUrl: A NSString parameter for defining the base url.
*/
+ (void)launchWithAppUUID:(NSString *)appUUID launchOptions:(NSDictionary *)launchOptions customPushDelegate:(id <WLCustomPushHandler>)customPushDelegate serverBaseUrl:(NSString *)baseUrl;
+ (void)launchWithAppUUIDWithCallback:(NSString *)appUUID launchOptions:(NSDictionary *)launchOptions customPushDelegate:(id <WLCustomPushHandler>)customPushDelegate serverBaseUrl:(NSString *)baseUrl andSuccessBlock:(void (^)(NSDictionary *))success andFailureBlock:(void (^)(NSError *error))failure;
/*!
......