Manos Chorianopoulos

add checks if sdk is initialized

...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
101 - (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; 101 - (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;
102 // - (void)didReceiveNotification:(NSDictionary *)userInfo whileAppWasInState:(WLApplicationState)state; 102 // - (void)didReceiveNotification:(NSDictionary *)userInfo whileAppWasInState:(WLApplicationState)state;
103 - (void)didReceiveNotification:(NSDictionary *)payload; 103 - (void)didReceiveNotification:(NSDictionary *)payload;
104 -- (BOOL)checkforLoyaltySDKNotification:(NSDictionary *)payload; 104 +- (NSNumber*)checkforLoyaltySDKNotification:(NSDictionary *)payload;
105 // TEST CODE FOR PUSH 105 // TEST CODE FOR PUSH
106 // - (BOOL)checkforLoyaltySDKNotification:(NSDictionary *)payload whileAppWasInState:(UIApplicationState)appState; 106 // - (BOOL)checkforLoyaltySDKNotification:(NSDictionary *)payload whileAppWasInState:(UIApplicationState)appState;
107 // TEST CODE FOR PUSH 107 // TEST CODE FOR PUSH
......
...@@ -1692,13 +1692,19 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify"; ...@@ -1692,13 +1692,19 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify";
1692 // - (void)didReceiveNotification:(NSDictionary *)userInfo whileAppWasInState:(WLApplicationState)state { 1692 // - (void)didReceiveNotification:(NSDictionary *)userInfo whileAppWasInState:(WLApplicationState)state {
1693 - (void)didReceiveNotification:(NSDictionary *)payload { 1693 - (void)didReceiveNotification:(NSDictionary *)payload {
1694 1694
1695 - [[Warply sharedService].pushManager didReceiveRemoteNotification:payload whileAppWasInState:WLApplicationStateClosed]; 1695 + if ([Warply sharedServiceExists] == YES) {
1696 + [[Warply sharedService].pushManager didReceiveRemoteNotification:payload whileAppWasInState:WLApplicationStateClosed];
1697 + }
1696 } 1698 }
1697 1699
1698 // - (BOOL)checkForLoyaltySDKNotification:(NSDictionary *)userInfo whileAppWasInState:(WLApplicationState)state { 1700 // - (BOOL)checkForLoyaltySDKNotification:(NSDictionary *)userInfo whileAppWasInState:(WLApplicationState)state {
1699 -- (BOOL)checkforLoyaltySDKNotification:(NSDictionary *)payload { 1701 +- (NSNumber*)checkforLoyaltySDKNotification:(NSDictionary *)payload {
1700 1702
1701 - return [[Warply sharedService].pushManager checkforLoyaltySDKNotificationPM:payload]; 1703 + if ([Warply sharedServiceExists] == YES) {
1704 + return [[Warply sharedService].pushManager checkforLoyaltySDKNotificationPM:payload] ? @1 : @0;
1705 + } else {
1706 + return nil;
1707 + }
1702 } 1708 }
1703 1709
1704 // TEST CODE FOR PUSH 1710 // TEST CODE FOR PUSH
......
...@@ -6183,10 +6183,10 @@ public class swiftApi { ...@@ -6183,10 +6183,10 @@ public class swiftApi {
6183 } 6183 }
6184 6184
6185 6185
6186 - public func checkForLoyaltySDKNotification(_ payload: [String : Any]) -> Bool { 6186 + public func checkForLoyaltySDKNotification(_ payload: [String : Any]) -> Bool? {
6187 6187
6188 let instanceOfMyApi = MyApi() 6188 let instanceOfMyApi = MyApi()
6189 - return instanceOfMyApi.checkforLoyaltySDKNotification(payload) 6189 + return instanceOfMyApi.checkforLoyaltySDKNotification(payload) as? Bool
6190 } 6190 }
6191 6191
6192 6192
......