Skip to content

Commit

Permalink
Pushwoosh iOS SDK 6.5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
PushwooshCI committed Dec 19, 2023
1 parent fa998d6 commit 59777c0
Show file tree
Hide file tree
Showing 22 changed files with 127 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#endif

#define PUSHWOOSH_VERSION @"6.5.5"
#define PUSHWOOSH_VERSION @"6.5.6"


@class Pushwoosh, PWMessage, PWNotificationCenterDelegateProxy;
Expand Down
Binary file modified Framework/Pushwoosh.framework/Versions/A/Pushwoosh
Binary file not shown.
Binary file not shown.
12 changes: 6 additions & 6 deletions XCFramework/Pushwoosh.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,16 @@
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-maccatalyst</string>
<string>ios-arm64_armv7</string>
<key>LibraryPath</key>
<string>Pushwoosh.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
<string>armv7</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>maccatalyst</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
Expand All @@ -37,16 +35,18 @@
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_armv7</string>
<string>ios-arm64_x86_64-maccatalyst</string>
<key>LibraryPath</key>
<string>Pushwoosh.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>armv7</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>maccatalyst</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#endif

#define PUSHWOOSH_VERSION @"6.5.5"
#define PUSHWOOSH_VERSION @"6.5.6"


@class Pushwoosh, PWMessage, PWNotificationCenterDelegateProxy;
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#endif

#define PUSHWOOSH_VERSION @"6.5.5"
#define PUSHWOOSH_VERSION @"6.5.6"


@class Pushwoosh, PWMessage, PWNotificationCenterDelegateProxy;
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</data>
<key>Headers/Pushwoosh.h</key>
<data>
Rqo/ztLLr9zoJF4SI8EBQlvsi64=
A+GgT1IuLu5/OHhKsBhlKGrqGB0=
</data>
<key>Info.plist</key>
<data>
Expand Down Expand Up @@ -188,11 +188,11 @@
<dict>
<key>hash</key>
<data>
Rqo/ztLLr9zoJF4SI8EBQlvsi64=
A+GgT1IuLu5/OHhKsBhlKGrqGB0=
</data>
<key>hash2</key>
<data>
u1MZ4EWQnx80JLX914bhORZA2nFUJqlra89gFVxhSso=
+NQIDzZyBTbxCNHCKuCBEZZNdIy1fOzjBdOioVTjsVc=
</data>
</dict>
<key>Modules/module.modulemap</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#endif

#define PUSHWOOSH_VERSION @"6.5.5"
#define PUSHWOOSH_VERSION @"6.5.6"


@class Pushwoosh, PWMessage, PWNotificationCenterDelegateProxy;
Expand Down
Binary file not shown.
14 changes: 7 additions & 7 deletions XCFramework/PushwooshGeozones.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,32 @@
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_armv7</string>
<string>ios-arm64_i386_x86_64-simulator</string>
<key>LibraryPath</key>
<string>PushwooshGeozones.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>armv7</string>
<string>i386</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_i386_x86_64-simulator</string>
<string>ios-arm64_armv7</string>
<key>LibraryPath</key>
<string>PushwooshGeozones.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>i386</string>
<string>x86_64</string>
<string>armv7</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
2 changes: 1 addition & 1 deletion iOS_SDK/Pushwoosh/Pushwoosh.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

//response
@property (nonatomic, readonly, strong) NSString *resultCode;
@property (nonatomic, readonly, strong) NSDictionary *richMedia;
@property (nonatomic, readonly) BOOL required;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
@interface PWPostEventRequest ()

@property (nonatomic, strong) NSString *resultCode;
@property (nonatomic, strong) NSDictionary *richMedia;


@end

Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion iOS_SDK/Pushwoosh/Pushwoosh/Public/Pushwoosh.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#endif

#define PUSHWOOSH_VERSION @"6.5.5"
#define PUSHWOOSH_VERSION @"6.5.6"


@class Pushwoosh, PWMessage, PWNotificationCenterDelegateProxy;
Expand Down
2 changes: 1 addition & 1 deletion iOS_SDK/Pushwoosh/PushwooshXCFramework.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Binary file modified iOS_SDK/Pushwoosh/build/XCBuildData/build.db
Binary file not shown.
Binary file not shown.
Binary file modified iOS_SDK/Pushwoosh/buildI/XCBuildData/build.db
Binary file not shown.
Binary file not shown.

0 comments on commit 59777c0

Please sign in to comment.