Manos Chorianopoulos

added didReceiveNotification function

......@@ -99,6 +99,8 @@
- (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)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;
@end
#endif /* MyApi_h */
......
......@@ -1604,4 +1604,10 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify";
}];
}
// - (void)didReceiveNotification:(NSDictionary *)userInfo whileAppWasInState:(WLApplicationState)state {
- (void)didReceiveNotification:(NSDictionary *)payload {
[[Warply sharedService].pushManager didReceiveRemoteNotification:payload whileAppWasInState:WLApplicationStateClosed];
}
@end
......
......@@ -233,6 +233,7 @@ static const char* jailbreak_apps[] =
///////////////////////////////////////////////////////////////////////////////
- (void)didReceiveRemoteNotification:(NSDictionary *)userInfo whileAppWasInState:(WLApplicationState)state
{
// TODO: Check if this guard should be commented
if ([userInfo valueForKey:@"_a"] == nil) {
// The push was sent from another push service
return;
......
......@@ -5542,4 +5542,11 @@ public class swiftApi {
}
public func didReceiveNotification(_ payload: [String : Any]) -> Void {
let instanceOfMyApi = MyApi()
instanceOfMyApi.didReceiveNotification(payload)
}
}
......