diff --git a/Framework/Pushwoosh.framework/Versions/A/Headers/Pushwoosh.h b/Framework/Pushwoosh.framework/Versions/A/Headers/Pushwoosh.h
index dc6574a5..e0e473d8 100644
--- a/Framework/Pushwoosh.framework/Versions/A/Headers/Pushwoosh.h
+++ b/Framework/Pushwoosh.framework/Versions/A/Headers/Pushwoosh.h
@@ -18,7 +18,7 @@
#endif
-#define PUSHWOOSH_VERSION @"6.5.5"
+#define PUSHWOOSH_VERSION @"6.5.6"
@class Pushwoosh, PWMessage, PWNotificationCenterDelegateProxy;
diff --git a/Framework/Pushwoosh.framework/Versions/A/Pushwoosh b/Framework/Pushwoosh.framework/Versions/A/Pushwoosh
index a045960c..81d08a94 100644
Binary files a/Framework/Pushwoosh.framework/Versions/A/Pushwoosh and b/Framework/Pushwoosh.framework/Versions/A/Pushwoosh differ
diff --git a/Framework/PushwooshGeozones.framework/Versions/A/PushwooshGeozones b/Framework/PushwooshGeozones.framework/Versions/A/PushwooshGeozones
index 9edc371b..ec498189 100644
Binary files a/Framework/PushwooshGeozones.framework/Versions/A/PushwooshGeozones and b/Framework/PushwooshGeozones.framework/Versions/A/PushwooshGeozones differ
diff --git a/XCFramework/Pushwoosh.xcframework/Info.plist b/XCFramework/Pushwoosh.xcframework/Info.plist
index 11b16dca..553c1d42 100644
--- a/XCFramework/Pushwoosh.xcframework/Info.plist
+++ b/XCFramework/Pushwoosh.xcframework/Info.plist
@@ -6,18 +6,16 @@
LibraryIdentifier
- ios-arm64_x86_64-maccatalyst
+ ios-arm64_armv7
LibraryPath
Pushwoosh.framework
SupportedArchitectures
arm64
- x86_64
+ armv7
SupportedPlatform
ios
- SupportedPlatformVariant
- maccatalyst
LibraryIdentifier
@@ -37,16 +35,18 @@
LibraryIdentifier
- ios-arm64_armv7
+ ios-arm64_x86_64-maccatalyst
LibraryPath
Pushwoosh.framework
SupportedArchitectures
arm64
- armv7
+ x86_64
SupportedPlatform
ios
+ SupportedPlatformVariant
+ maccatalyst
CFBundlePackageType
diff --git a/XCFramework/Pushwoosh.xcframework/ios-arm64_armv7/Pushwoosh.framework/Headers/Pushwoosh.h b/XCFramework/Pushwoosh.xcframework/ios-arm64_armv7/Pushwoosh.framework/Headers/Pushwoosh.h
index dc6574a5..e0e473d8 100644
--- a/XCFramework/Pushwoosh.xcframework/ios-arm64_armv7/Pushwoosh.framework/Headers/Pushwoosh.h
+++ b/XCFramework/Pushwoosh.xcframework/ios-arm64_armv7/Pushwoosh.framework/Headers/Pushwoosh.h
@@ -18,7 +18,7 @@
#endif
-#define PUSHWOOSH_VERSION @"6.5.5"
+#define PUSHWOOSH_VERSION @"6.5.6"
@class Pushwoosh, PWMessage, PWNotificationCenterDelegateProxy;
diff --git a/XCFramework/Pushwoosh.xcframework/ios-arm64_armv7/Pushwoosh.framework/Pushwoosh b/XCFramework/Pushwoosh.xcframework/ios-arm64_armv7/Pushwoosh.framework/Pushwoosh
index 6586af93..c3477575 100755
Binary files a/XCFramework/Pushwoosh.xcframework/ios-arm64_armv7/Pushwoosh.framework/Pushwoosh and b/XCFramework/Pushwoosh.xcframework/ios-arm64_armv7/Pushwoosh.framework/Pushwoosh differ
diff --git a/XCFramework/Pushwoosh.xcframework/ios-arm64_i386_x86_64-simulator/Pushwoosh.framework/Headers/Pushwoosh.h b/XCFramework/Pushwoosh.xcframework/ios-arm64_i386_x86_64-simulator/Pushwoosh.framework/Headers/Pushwoosh.h
index dc6574a5..e0e473d8 100644
--- a/XCFramework/Pushwoosh.xcframework/ios-arm64_i386_x86_64-simulator/Pushwoosh.framework/Headers/Pushwoosh.h
+++ b/XCFramework/Pushwoosh.xcframework/ios-arm64_i386_x86_64-simulator/Pushwoosh.framework/Headers/Pushwoosh.h
@@ -18,7 +18,7 @@
#endif
-#define PUSHWOOSH_VERSION @"6.5.5"
+#define PUSHWOOSH_VERSION @"6.5.6"
@class Pushwoosh, PWMessage, PWNotificationCenterDelegateProxy;
diff --git a/XCFramework/Pushwoosh.xcframework/ios-arm64_i386_x86_64-simulator/Pushwoosh.framework/Pushwoosh b/XCFramework/Pushwoosh.xcframework/ios-arm64_i386_x86_64-simulator/Pushwoosh.framework/Pushwoosh
index 0d4cfd01..e984d646 100755
Binary files a/XCFramework/Pushwoosh.xcframework/ios-arm64_i386_x86_64-simulator/Pushwoosh.framework/Pushwoosh and b/XCFramework/Pushwoosh.xcframework/ios-arm64_i386_x86_64-simulator/Pushwoosh.framework/Pushwoosh differ
diff --git a/XCFramework/Pushwoosh.xcframework/ios-arm64_i386_x86_64-simulator/Pushwoosh.framework/_CodeSignature/CodeResources b/XCFramework/Pushwoosh.xcframework/ios-arm64_i386_x86_64-simulator/Pushwoosh.framework/_CodeSignature/CodeResources
index 33e183b6..137791d8 100644
--- a/XCFramework/Pushwoosh.xcframework/ios-arm64_i386_x86_64-simulator/Pushwoosh.framework/_CodeSignature/CodeResources
+++ b/XCFramework/Pushwoosh.xcframework/ios-arm64_i386_x86_64-simulator/Pushwoosh.framework/_CodeSignature/CodeResources
@@ -50,7 +50,7 @@
Headers/Pushwoosh.h
- Rqo/ztLLr9zoJF4SI8EBQlvsi64=
+ A+GgT1IuLu5/OHhKsBhlKGrqGB0=
Info.plist
@@ -188,11 +188,11 @@
hash
- Rqo/ztLLr9zoJF4SI8EBQlvsi64=
+ A+GgT1IuLu5/OHhKsBhlKGrqGB0=
hash2
- u1MZ4EWQnx80JLX914bhORZA2nFUJqlra89gFVxhSso=
+ +NQIDzZyBTbxCNHCKuCBEZZNdIy1fOzjBdOioVTjsVc=
Modules/module.modulemap
diff --git a/XCFramework/Pushwoosh.xcframework/ios-arm64_x86_64-maccatalyst/Pushwoosh.framework/Versions/A/Headers/Pushwoosh.h b/XCFramework/Pushwoosh.xcframework/ios-arm64_x86_64-maccatalyst/Pushwoosh.framework/Versions/A/Headers/Pushwoosh.h
index dc6574a5..e0e473d8 100644
--- a/XCFramework/Pushwoosh.xcframework/ios-arm64_x86_64-maccatalyst/Pushwoosh.framework/Versions/A/Headers/Pushwoosh.h
+++ b/XCFramework/Pushwoosh.xcframework/ios-arm64_x86_64-maccatalyst/Pushwoosh.framework/Versions/A/Headers/Pushwoosh.h
@@ -18,7 +18,7 @@
#endif
-#define PUSHWOOSH_VERSION @"6.5.5"
+#define PUSHWOOSH_VERSION @"6.5.6"
@class Pushwoosh, PWMessage, PWNotificationCenterDelegateProxy;
diff --git a/XCFramework/Pushwoosh.xcframework/ios-arm64_x86_64-maccatalyst/Pushwoosh.framework/Versions/A/Pushwoosh b/XCFramework/Pushwoosh.xcframework/ios-arm64_x86_64-maccatalyst/Pushwoosh.framework/Versions/A/Pushwoosh
index f30c80dd..d8316e75 100755
Binary files a/XCFramework/Pushwoosh.xcframework/ios-arm64_x86_64-maccatalyst/Pushwoosh.framework/Versions/A/Pushwoosh and b/XCFramework/Pushwoosh.xcframework/ios-arm64_x86_64-maccatalyst/Pushwoosh.framework/Versions/A/Pushwoosh differ
diff --git a/XCFramework/PushwooshGeozones.xcframework/Info.plist b/XCFramework/PushwooshGeozones.xcframework/Info.plist
index 4efdcb76..8fbe8877 100644
--- a/XCFramework/PushwooshGeozones.xcframework/Info.plist
+++ b/XCFramework/PushwooshGeozones.xcframework/Info.plist
@@ -21,32 +21,32 @@
LibraryIdentifier
- ios-arm64_armv7
+ ios-arm64_i386_x86_64-simulator
LibraryPath
PushwooshGeozones.framework
SupportedArchitectures
arm64
- armv7
+ i386
+ x86_64
SupportedPlatform
ios
+ SupportedPlatformVariant
+ simulator
LibraryIdentifier
- ios-arm64_i386_x86_64-simulator
+ ios-arm64_armv7
LibraryPath
PushwooshGeozones.framework
SupportedArchitectures
arm64
- i386
- x86_64
+ armv7
SupportedPlatform
ios
- SupportedPlatformVariant
- simulator
CFBundlePackageType
diff --git a/iOS_SDK/Pushwoosh/Pushwoosh.podspec b/iOS_SDK/Pushwoosh/Pushwoosh.podspec
index 56b95d74..f92962e6 100644
--- a/iOS_SDK/Pushwoosh/Pushwoosh.podspec
+++ b/iOS_SDK/Pushwoosh/Pushwoosh.podspec
@@ -5,7 +5,7 @@
Pod::Spec.new do |s|
s.name = "Pushwoosh"
- s.version = "6.5.5"
+ s.version = "6.5.6"
s.summary = "Push notifications library by Pushwoosh."
s.platform = :ios
diff --git a/iOS_SDK/Pushwoosh/Pushwoosh/In-App Messages/PWInAppMessagesManager.m b/iOS_SDK/Pushwoosh/Pushwoosh/In-App Messages/PWInAppMessagesManager.m
index 68c6dc6a..43ce1e4c 100644
--- a/iOS_SDK/Pushwoosh/Pushwoosh/In-App Messages/PWInAppMessagesManager.m
+++ b/iOS_SDK/Pushwoosh/Pushwoosh/In-App Messages/PWInAppMessagesManager.m
@@ -187,40 +187,44 @@ - (void)postEventInternal:(NSString *)event withAttributes:(NSDictionary *)attri
request.attributes = attributesDictionary;
__weak typeof(self) wself = self;
- [_requestManager sendRequest:request completion:^(NSError *error) {
- if (error) {
- completion(nil, error);
- return;
- }
- if (!request.resultCode) {
- PWLogInfo(@"No inapp is associated with this event: %@", event);
- completion(nil, nil);
- return;
- }
-
- #if TARGET_OS_IOS || TARGET_OS_OSX
- [self setPostEventInAppCode:request.resultCode];
-
- PWResource *resource = [[PWInAppStorage storage] resourceForCode:request.resultCode];
- if (request.required && resource == nil) {
- if (!isInlineInApp) {
- [PWShowLoading showLoadingWithCancelBlock:^{
- [[PWInAppStorage storage] resetBlocks];
+ [_requestManager sendRequest:request completion:^(NSError *error) {
+ if (error) {
+ completion(nil, error);
+ return;
+ }
+ if ([request.resultCode length] != 0) {
+
+#if TARGET_OS_IOS || TARGET_OS_OSX
+ [self setPostEventInAppCode:request.resultCode];
+
+ PWResource *resource = [[PWInAppStorage storage] resourceForCode:request.resultCode];
+ if (request.required && resource == nil) {
+ if (!isInlineInApp) {
+ [PWShowLoading showLoadingWithCancelBlock:^{
+ [[PWInAppStorage storage] resetBlocks];
+ }];
+ }
+
+ [[PWInAppStorage storage] resourcesForCode:request.resultCode
+ completionBlock:^(PWResource *resource) {
+ [PWShowLoading hideLoading];
+ [wself processingResource:resource withRequest:request completion:completion];
}];
+ } else {
+ [wself processingResource:resource withRequest:request completion:completion];
}
-
- [[PWInAppStorage storage] resourcesForCode:request.resultCode
- completionBlock:^(PWResource *resource) {
- [PWShowLoading hideLoading];
- [wself processingResource:resource withRequest:request completion:completion];
- }];
+ } else if (request.richMedia) {
+ PWResource *resource = [[PWInAppStorage storage] resourceForDictionary:request.richMedia];
+ [resource getHTMLDataWithCompletion:^(NSString *htmlData, NSError *error){
+ [wself processingResource:resource withRequest:request completion:completion];
+ }];
} else {
- [wself processingResource:resource withRequest:request completion:completion];
+ completion(nil, nil);
}
- #else
- completion(nil, nil);
- #endif
- }];
+#else
+ completion(nil, nil);
+#endif
+ }];
}
#if TARGET_OS_IOS || TARGET_OS_OSX
diff --git a/iOS_SDK/Pushwoosh/Pushwoosh/Network/Requests/Events/PWPostEventRequest.h b/iOS_SDK/Pushwoosh/Pushwoosh/Network/Requests/Events/PWPostEventRequest.h
index f198cc43..5a860654 100644
--- a/iOS_SDK/Pushwoosh/Pushwoosh/Network/Requests/Events/PWPostEventRequest.h
+++ b/iOS_SDK/Pushwoosh/Pushwoosh/Network/Requests/Events/PWPostEventRequest.h
@@ -14,6 +14,7 @@
//response
@property (nonatomic, readonly, strong) NSString *resultCode;
+@property (nonatomic, readonly, strong) NSDictionary *richMedia;
@property (nonatomic, readonly) BOOL required;
@end
diff --git a/iOS_SDK/Pushwoosh/Pushwoosh/Network/Requests/Events/PWPostEventRequest.m b/iOS_SDK/Pushwoosh/Pushwoosh/Network/Requests/Events/PWPostEventRequest.m
index a2ba16f9..58dab8ea 100644
--- a/iOS_SDK/Pushwoosh/Pushwoosh/Network/Requests/Events/PWPostEventRequest.m
+++ b/iOS_SDK/Pushwoosh/Pushwoosh/Network/Requests/Events/PWPostEventRequest.m
@@ -11,6 +11,8 @@
@interface PWPostEventRequest ()
@property (nonatomic, strong) NSString *resultCode;
+@property (nonatomic, strong) NSDictionary *richMedia;
+
@end
@@ -80,8 +82,75 @@ - (NSObject *)convertAttribute:(NSObject *)attribute {
- (void)parseResponse:(NSDictionary *)response {
_resultCode = [response pw_stringForKey:@"code"];
+
+ if ([_resultCode length] == 0) {
+ if ([response objectForKey:@"richmedia"]){
+ NSDictionary *richMediaDictionary = response[@"richmedia"];
+
+ if (![richMediaDictionary isKindOfClass:[NSDictionary class]]) {
+ PWLogError(@"Invalid json type: %@, %@", [richMediaDictionary class], richMediaDictionary);
+ return;
+ }
+
+ NSString *url = richMediaDictionary[@"url"];
+ if (!url) {
+ PWLogError(@"Url is missing");
+ return;
+ }
+
+ NSDictionary *tags = richMediaDictionary[@"tags"];
+ if (!tags)
+ tags = @{};
+
+ tags = [self convertTags:tags];
+
+ NSString *ts = richMediaDictionary[@"ts"];
+ if (!ts) {
+ PWLogError(@"Timestamp is missing");
+ return;
+ }
+
+ NSString *code = [[url lastPathComponent] stringByDeletingPathExtension];
+ code = [@"r-" stringByAppendingString:code]; // avoid inapp and richmedia code conflicts
+
+ _richMedia = @{ @"code" : code,
+ @"url" : url,
+ @"closeButtonType" : @"YES",
+ @"layout" : @"topbanner",
+ @"updated" : ts,
+ @"tags" : tags };
+ }
+ }
NSNumber *required = [response pw_numberForKey:@"required"];
_required = required.boolValue;
}
+// tags must be NSString -> NSString dictionary
+- (NSDictionary *)convertTags:(NSDictionary *)tags {
+ if (![tags isKindOfClass:[NSDictionary class]]) {
+ return @{};
+ }
+
+ NSMutableDictionary *result = [tags mutableCopy];
+ for (NSString *key in [tags keyEnumerator]) {
+ id value = tags[key];
+
+ if (![key isKindOfClass:[NSString class]]) {
+ [result removeObjectForKey:key];
+ continue;
+ }
+
+ if ([value isKindOfClass:[NSNumber class]]) {
+ result[key] = [(NSNumber *)value stringValue];
+ continue;
+ }
+
+ if (![value isKindOfClass:[NSString class]]) {
+ [result removeObjectForKey:key];
+ }
+ }
+
+ return result;
+}
+
@end
diff --git a/iOS_SDK/Pushwoosh/Pushwoosh/Public/Pushwoosh.h b/iOS_SDK/Pushwoosh/Pushwoosh/Public/Pushwoosh.h
index dc6574a5..e0e473d8 100644
--- a/iOS_SDK/Pushwoosh/Pushwoosh/Public/Pushwoosh.h
+++ b/iOS_SDK/Pushwoosh/Pushwoosh/Public/Pushwoosh.h
@@ -18,7 +18,7 @@
#endif
-#define PUSHWOOSH_VERSION @"6.5.5"
+#define PUSHWOOSH_VERSION @"6.5.6"
@class Pushwoosh, PWMessage, PWNotificationCenterDelegateProxy;
diff --git a/iOS_SDK/Pushwoosh/PushwooshXCFramework.podspec b/iOS_SDK/Pushwoosh/PushwooshXCFramework.podspec
index cc586aa0..be2acfb9 100644
--- a/iOS_SDK/Pushwoosh/PushwooshXCFramework.podspec
+++ b/iOS_SDK/Pushwoosh/PushwooshXCFramework.podspec
@@ -5,7 +5,7 @@
Pod::Spec.new do |s|
s.name = "PushwooshXCFramework"
- s.version = "6.5.5"
+ s.version = "6.5.6"
s.summary = "Push notifications library by Pushwoosh."
s.platform = :ios
diff --git a/iOS_SDK/Pushwoosh/build/XCBuildData/build.db b/iOS_SDK/Pushwoosh/build/XCBuildData/build.db
index d2d93355..9affbe9d 100644
Binary files a/iOS_SDK/Pushwoosh/build/XCBuildData/build.db and b/iOS_SDK/Pushwoosh/build/XCBuildData/build.db differ
diff --git a/iOS_SDK/Pushwoosh/buildI/XCBuildData/7d204fb94c98a5faec65106c28ce8c76-desc.xcbuild b/iOS_SDK/Pushwoosh/buildI/XCBuildData/7d204fb94c98a5faec65106c28ce8c76-desc.xcbuild
index b784d504..ca5d7050 100644
Binary files a/iOS_SDK/Pushwoosh/buildI/XCBuildData/7d204fb94c98a5faec65106c28ce8c76-desc.xcbuild and b/iOS_SDK/Pushwoosh/buildI/XCBuildData/7d204fb94c98a5faec65106c28ce8c76-desc.xcbuild differ
diff --git a/iOS_SDK/Pushwoosh/buildI/XCBuildData/build.db b/iOS_SDK/Pushwoosh/buildI/XCBuildData/build.db
index 12adc269..5d272bf5 100644
Binary files a/iOS_SDK/Pushwoosh/buildI/XCBuildData/build.db and b/iOS_SDK/Pushwoosh/buildI/XCBuildData/build.db differ
diff --git a/iOS_SDK/Pushwoosh/buildI/XCBuildData/ce0d156d282619b34a976188828ed341-desc.xcbuild b/iOS_SDK/Pushwoosh/buildI/XCBuildData/ce0d156d282619b34a976188828ed341-desc.xcbuild
index 28e60522..47309e9e 100644
Binary files a/iOS_SDK/Pushwoosh/buildI/XCBuildData/ce0d156d282619b34a976188828ed341-desc.xcbuild and b/iOS_SDK/Pushwoosh/buildI/XCBuildData/ce0d156d282619b34a976188828ed341-desc.xcbuild differ