Manos Chorianopoulos

add checks if sdk is initialized

......@@ -101,7 +101,7 @@
- (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
......
......@@ -1692,13 +1692,19 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify";
// - (void)didReceiveNotification:(NSDictionary *)userInfo whileAppWasInState:(WLApplicationState)state {
- (void)didReceiveNotification:(NSDictionary *)payload {
if ([Warply sharedServiceExists] == YES) {
[[Warply sharedService].pushManager didReceiveRemoteNotification:payload whileAppWasInState:WLApplicationStateClosed];
}
}
// - (BOOL)checkForLoyaltySDKNotification:(NSDictionary *)userInfo whileAppWasInState:(WLApplicationState)state {
- (BOOL)checkforLoyaltySDKNotification:(NSDictionary *)payload {
- (NSNumber*)checkforLoyaltySDKNotification:(NSDictionary *)payload {
return [[Warply sharedService].pushManager checkforLoyaltySDKNotificationPM:payload];
if ([Warply sharedServiceExists] == YES) {
return [[Warply sharedService].pushManager checkforLoyaltySDKNotificationPM:payload] ? @1 : @0;
} else {
return nil;
}
}
// TEST CODE FOR PUSH
......
......@@ -6183,10 +6183,10 @@ public class swiftApi {
}
public func checkForLoyaltySDKNotification(_ payload: [String : Any]) -> Bool {
public func checkForLoyaltySDKNotification(_ payload: [String : Any]) -> Bool? {
let instanceOfMyApi = MyApi()
return instanceOfMyApi.checkforLoyaltySDKNotification(payload)
return instanceOfMyApi.checkforLoyaltySDKNotification(payload) as? Bool
}
......