Skip to content

Commit 59777c0

Browse files
committed
1 parent fa998d6 commit 59777c0

File tree

22 files changed

+127
-53
lines changed

22 files changed

+127
-53
lines changed

Framework/Pushwoosh.framework/Versions/A/Headers/Pushwoosh.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#endif
2020

21-
#define PUSHWOOSH_VERSION @"6.5.5"
21+
#define PUSHWOOSH_VERSION @"6.5.6"
2222

2323

2424
@class Pushwoosh, PWMessage, PWNotificationCenterDelegateProxy;
Binary file not shown.
Binary file not shown.

XCFramework/Pushwoosh.xcframework/Info.plist

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,16 @@
66
<array>
77
<dict>
88
<key>LibraryIdentifier</key>
9-
<string>ios-arm64_x86_64-maccatalyst</string>
9+
<string>ios-arm64_armv7</string>
1010
<key>LibraryPath</key>
1111
<string>Pushwoosh.framework</string>
1212
<key>SupportedArchitectures</key>
1313
<array>
1414
<string>arm64</string>
15-
<string>x86_64</string>
15+
<string>armv7</string>
1616
</array>
1717
<key>SupportedPlatform</key>
1818
<string>ios</string>
19-
<key>SupportedPlatformVariant</key>
20-
<string>maccatalyst</string>
2119
</dict>
2220
<dict>
2321
<key>LibraryIdentifier</key>
@@ -37,16 +35,18 @@
3735
</dict>
3836
<dict>
3937
<key>LibraryIdentifier</key>
40-
<string>ios-arm64_armv7</string>
38+
<string>ios-arm64_x86_64-maccatalyst</string>
4139
<key>LibraryPath</key>
4240
<string>Pushwoosh.framework</string>
4341
<key>SupportedArchitectures</key>
4442
<array>
4543
<string>arm64</string>
46-
<string>armv7</string>
44+
<string>x86_64</string>
4745
</array>
4846
<key>SupportedPlatform</key>
4947
<string>ios</string>
48+
<key>SupportedPlatformVariant</key>
49+
<string>maccatalyst</string>
5050
</dict>
5151
</array>
5252
<key>CFBundlePackageType</key>

XCFramework/Pushwoosh.xcframework/ios-arm64_armv7/Pushwoosh.framework/Headers/Pushwoosh.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#endif
2020

21-
#define PUSHWOOSH_VERSION @"6.5.5"
21+
#define PUSHWOOSH_VERSION @"6.5.6"
2222

2323

2424
@class Pushwoosh, PWMessage, PWNotificationCenterDelegateProxy;
Binary file not shown.

XCFramework/Pushwoosh.xcframework/ios-arm64_i386_x86_64-simulator/Pushwoosh.framework/Headers/Pushwoosh.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#endif
2020

21-
#define PUSHWOOSH_VERSION @"6.5.5"
21+
#define PUSHWOOSH_VERSION @"6.5.6"
2222

2323

2424
@class Pushwoosh, PWMessage, PWNotificationCenterDelegateProxy;

XCFramework/Pushwoosh.xcframework/ios-arm64_i386_x86_64-simulator/Pushwoosh.framework/_CodeSignature/CodeResources

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
</data>
5151
<key>Headers/Pushwoosh.h</key>
5252
<data>
53-
Rqo/ztLLr9zoJF4SI8EBQlvsi64=
53+
A+GgT1IuLu5/OHhKsBhlKGrqGB0=
5454
</data>
5555
<key>Info.plist</key>
5656
<data>
@@ -188,11 +188,11 @@
188188
<dict>
189189
<key>hash</key>
190190
<data>
191-
Rqo/ztLLr9zoJF4SI8EBQlvsi64=
191+
A+GgT1IuLu5/OHhKsBhlKGrqGB0=
192192
</data>
193193
<key>hash2</key>
194194
<data>
195-
u1MZ4EWQnx80JLX914bhORZA2nFUJqlra89gFVxhSso=
195+
+NQIDzZyBTbxCNHCKuCBEZZNdIy1fOzjBdOioVTjsVc=
196196
</data>
197197
</dict>
198198
<key>Modules/module.modulemap</key>

XCFramework/Pushwoosh.xcframework/ios-arm64_x86_64-maccatalyst/Pushwoosh.framework/Versions/A/Headers/Pushwoosh.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#endif
2020

21-
#define PUSHWOOSH_VERSION @"6.5.5"
21+
#define PUSHWOOSH_VERSION @"6.5.6"
2222

2323

2424
@class Pushwoosh, PWMessage, PWNotificationCenterDelegateProxy;

XCFramework/PushwooshGeozones.xcframework/Info.plist

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,32 @@
2121
</dict>
2222
<dict>
2323
<key>LibraryIdentifier</key>
24-
<string>ios-arm64_armv7</string>
24+
<string>ios-arm64_i386_x86_64-simulator</string>
2525
<key>LibraryPath</key>
2626
<string>PushwooshGeozones.framework</string>
2727
<key>SupportedArchitectures</key>
2828
<array>
2929
<string>arm64</string>
30-
<string>armv7</string>
30+
<string>i386</string>
31+
<string>x86_64</string>
3132
</array>
3233
<key>SupportedPlatform</key>
3334
<string>ios</string>
35+
<key>SupportedPlatformVariant</key>
36+
<string>simulator</string>
3437
</dict>
3538
<dict>
3639
<key>LibraryIdentifier</key>
37-
<string>ios-arm64_i386_x86_64-simulator</string>
40+
<string>ios-arm64_armv7</string>
3841
<key>LibraryPath</key>
3942
<string>PushwooshGeozones.framework</string>
4043
<key>SupportedArchitectures</key>
4144
<array>
4245
<string>arm64</string>
43-
<string>i386</string>
44-
<string>x86_64</string>
46+
<string>armv7</string>
4547
</array>
4648
<key>SupportedPlatform</key>
4749
<string>ios</string>
48-
<key>SupportedPlatformVariant</key>
49-
<string>simulator</string>
5050
</dict>
5151
</array>
5252
<key>CFBundlePackageType</key>

iOS_SDK/Pushwoosh/Pushwoosh.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Pod::Spec.new do |s|
66

77
s.name = "Pushwoosh"
8-
s.version = "6.5.5"
8+
s.version = "6.5.6"
99
s.summary = "Push notifications library by Pushwoosh."
1010
s.platform = :ios
1111

iOS_SDK/Pushwoosh/Pushwoosh/In-App Messages/PWInAppMessagesManager.m

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -187,40 +187,44 @@ - (void)postEventInternal:(NSString *)event withAttributes:(NSDictionary *)attri
187187
request.attributes = attributesDictionary;
188188

189189
__weak typeof(self) wself = self;
190-
[_requestManager sendRequest:request completion:^(NSError *error) {
191-
if (error) {
192-
completion(nil, error);
193-
return;
194-
}
195-
if (!request.resultCode) {
196-
PWLogInfo(@"No inapp is associated with this event: %@", event);
197-
completion(nil, nil);
198-
return;
199-
}
200-
201-
#if TARGET_OS_IOS || TARGET_OS_OSX
202-
[self setPostEventInAppCode:request.resultCode];
203-
204-
PWResource *resource = [[PWInAppStorage storage] resourceForCode:request.resultCode];
205-
if (request.required && resource == nil) {
206-
if (!isInlineInApp) {
207-
[PWShowLoading showLoadingWithCancelBlock:^{
208-
[[PWInAppStorage storage] resetBlocks];
190+
[_requestManager sendRequest:request completion:^(NSError *error) {
191+
if (error) {
192+
completion(nil, error);
193+
return;
194+
}
195+
if ([request.resultCode length] != 0) {
196+
197+
#if TARGET_OS_IOS || TARGET_OS_OSX
198+
[self setPostEventInAppCode:request.resultCode];
199+
200+
PWResource *resource = [[PWInAppStorage storage] resourceForCode:request.resultCode];
201+
if (request.required && resource == nil) {
202+
if (!isInlineInApp) {
203+
[PWShowLoading showLoadingWithCancelBlock:^{
204+
[[PWInAppStorage storage] resetBlocks];
205+
}];
206+
}
207+
208+
[[PWInAppStorage storage] resourcesForCode:request.resultCode
209+
completionBlock:^(PWResource *resource) {
210+
[PWShowLoading hideLoading];
211+
[wself processingResource:resource withRequest:request completion:completion];
209212
}];
213+
} else {
214+
[wself processingResource:resource withRequest:request completion:completion];
210215
}
211-
212-
[[PWInAppStorage storage] resourcesForCode:request.resultCode
213-
completionBlock:^(PWResource *resource) {
214-
[PWShowLoading hideLoading];
215-
[wself processingResource:resource withRequest:request completion:completion];
216-
}];
216+
} else if (request.richMedia) {
217+
PWResource *resource = [[PWInAppStorage storage] resourceForDictionary:request.richMedia];
218+
[resource getHTMLDataWithCompletion:^(NSString *htmlData, NSError *error){
219+
[wself processingResource:resource withRequest:request completion:completion];
220+
}];
217221
} else {
218-
[wself processingResource:resource withRequest:request completion:completion];
222+
completion(nil, nil);
219223
}
220-
#else
221-
completion(nil, nil);
222-
#endif
223-
}];
224+
#else
225+
completion(nil, nil);
226+
#endif
227+
}];
224228
}
225229

226230
#if TARGET_OS_IOS || TARGET_OS_OSX

iOS_SDK/Pushwoosh/Pushwoosh/Network/Requests/Events/PWPostEventRequest.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
//response
1616
@property (nonatomic, readonly, strong) NSString *resultCode;
17+
@property (nonatomic, readonly, strong) NSDictionary *richMedia;
1718
@property (nonatomic, readonly) BOOL required;
1819

1920
@end

iOS_SDK/Pushwoosh/Pushwoosh/Network/Requests/Events/PWPostEventRequest.m

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
@interface PWPostEventRequest ()
1212

1313
@property (nonatomic, strong) NSString *resultCode;
14+
@property (nonatomic, strong) NSDictionary *richMedia;
15+
1416

1517
@end
1618

@@ -80,8 +82,75 @@ - (NSObject *)convertAttribute:(NSObject *)attribute {
8082

8183
- (void)parseResponse:(NSDictionary *)response {
8284
_resultCode = [response pw_stringForKey:@"code"];
85+
86+
if ([_resultCode length] == 0) {
87+
if ([response objectForKey:@"richmedia"]){
88+
NSDictionary *richMediaDictionary = response[@"richmedia"];
89+
90+
if (![richMediaDictionary isKindOfClass:[NSDictionary class]]) {
91+
PWLogError(@"Invalid json type: %@, %@", [richMediaDictionary class], richMediaDictionary);
92+
return;
93+
}
94+
95+
NSString *url = richMediaDictionary[@"url"];
96+
if (!url) {
97+
PWLogError(@"Url is missing");
98+
return;
99+
}
100+
101+
NSDictionary *tags = richMediaDictionary[@"tags"];
102+
if (!tags)
103+
tags = @{};
104+
105+
tags = [self convertTags:tags];
106+
107+
NSString *ts = richMediaDictionary[@"ts"];
108+
if (!ts) {
109+
PWLogError(@"Timestamp is missing");
110+
return;
111+
}
112+
113+
NSString *code = [[url lastPathComponent] stringByDeletingPathExtension];
114+
code = [@"r-" stringByAppendingString:code]; // avoid inapp and richmedia code conflicts
115+
116+
_richMedia = @{ @"code" : code,
117+
@"url" : url,
118+
@"closeButtonType" : @"YES",
119+
@"layout" : @"topbanner",
120+
@"updated" : ts,
121+
@"tags" : tags };
122+
}
123+
}
83124
NSNumber *required = [response pw_numberForKey:@"required"];
84125
_required = required.boolValue;
85126
}
86127

128+
// tags must be NSString -> NSString dictionary
129+
- (NSDictionary *)convertTags:(NSDictionary *)tags {
130+
if (![tags isKindOfClass:[NSDictionary class]]) {
131+
return @{};
132+
}
133+
134+
NSMutableDictionary *result = [tags mutableCopy];
135+
for (NSString *key in [tags keyEnumerator]) {
136+
id value = tags[key];
137+
138+
if (![key isKindOfClass:[NSString class]]) {
139+
[result removeObjectForKey:key];
140+
continue;
141+
}
142+
143+
if ([value isKindOfClass:[NSNumber class]]) {
144+
result[key] = [(NSNumber *)value stringValue];
145+
continue;
146+
}
147+
148+
if (![value isKindOfClass:[NSString class]]) {
149+
[result removeObjectForKey:key];
150+
}
151+
}
152+
153+
return result;
154+
}
155+
87156
@end

iOS_SDK/Pushwoosh/Pushwoosh/Public/Pushwoosh.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#endif
2020

21-
#define PUSHWOOSH_VERSION @"6.5.5"
21+
#define PUSHWOOSH_VERSION @"6.5.6"
2222

2323

2424
@class Pushwoosh, PWMessage, PWNotificationCenterDelegateProxy;

iOS_SDK/Pushwoosh/PushwooshXCFramework.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Pod::Spec.new do |s|
66

77
s.name = "PushwooshXCFramework"
8-
s.version = "6.5.5"
8+
s.version = "6.5.6"
99
s.summary = "Push notifications library by Pushwoosh."
1010
s.platform = :ios
1111

0 Bytes
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)