Skip to content

Commit

Permalink
Pushwoosh iOS SDK 6.7.12
Browse files Browse the repository at this point in the history
  • Loading branch information
pushwoosh authored and pushwoosh committed Jan 27, 2025
1 parent ffa8a4c commit 795ff55
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 29 deletions.
2 changes: 0 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ body:
label: Your Pushwoosh iOS SDK version
description: Your iOS SDK version which was integrated to the app. You may find it on the [releases page](https://github.com/Pushwoosh/pushwoosh-ios-sdk/releases)
options:
- 6.7.12
- 6.7.12
- 6.7.12
- 6.7.11
- 6.7.10
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
12 changes: 6 additions & 6 deletions XCFramework/PushwooshGeozones.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
</dict>
<dict>
<key>BinaryPath</key>
<string>PushwooshGeozones.framework/PushwooshGeozones</string>
<string>PushwooshGeozones.framework/Versions/A/PushwooshGeozones</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<string>ios-arm64_x86_64-maccatalyst</string>
<key>LibraryPath</key>
<string>PushwooshGeozones.framework</string>
<key>SupportedArchitectures</key>
Expand All @@ -33,13 +33,13 @@
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
<string>maccatalyst</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>PushwooshGeozones.framework/Versions/A/PushwooshGeozones</string>
<string>PushwooshGeozones.framework/PushwooshGeozones</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-maccatalyst</string>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>PushwooshGeozones.framework</string>
<key>SupportedArchitectures</key>
Expand All @@ -50,7 +50,7 @@
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>maccatalyst</string>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
14 changes: 7 additions & 7 deletions XCFramework/PushwooshInboxUI.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,34 @@
<array>
<dict>
<key>BinaryPath</key>
<string>PushwooshInboxUI.framework/Versions/A/PushwooshInboxUI</string>
<string>PushwooshInboxUI.framework/PushwooshInboxUI</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-maccatalyst</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>PushwooshInboxUI.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>maccatalyst</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>PushwooshInboxUI.framework/PushwooshInboxUI</string>
<string>PushwooshInboxUI.framework/Versions/A/PushwooshInboxUI</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>ios-arm64_x86_64-maccatalyst</string>
<key>LibraryPath</key>
<string>PushwooshInboxUI.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>maccatalyst</string>
</dict>
<dict>
<key>BinaryPath</key>
Expand Down
4 changes: 1 addition & 3 deletions iOS_SDK/Pushwoosh/Pushwoosh/In-App Messages/PWInAppStorage.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,11 @@ - (instancetype)init {
_listeners = [NSMutableArray new];

if (data) {
if (TARGET_OS_IOS && [PWUtils isSystemVersionGreaterOrEqualTo:@"11.0"]) {
if (TARGET_OS_IOS) {
NSSet *set = [NSSet setWithObjects:[PWResource class], [NSString class], [NSDictionary class], nil];

PWUnarchiver *unarchiver = [[PWUnarchiver alloc] init];
_resources = [unarchiver unarchivedObjectOfClasses:set data:data];
} else {
_resources = [[NSKeyedUnarchiver unarchiveObjectWithData:data] copy];
}
} else {
_resources = @{};
Expand Down
8 changes: 2 additions & 6 deletions iOS_SDK/Pushwoosh/Pushwoosh/Persistence/PWCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,13 @@ - (void)addTags:(NSDictionary *)tags {
- (NSDictionary *)getTags {
NSDictionary *tags = nil;

if (TARGET_OS_IOS && [PWUtils isSystemVersionGreaterOrEqualTo:@"11.0"]) {
if (TARGET_OS_IOS) {
NSURL *url = [NSURL fileURLWithPath:self.tagsCacheFile];
NSData *data = [NSData dataWithContentsOfURL:url];

NSSet *set = [NSSet setWithObjects:[NSDictionary class], [NSString class], [NSNumber class], [NSArray class], nil];
PWUnarchiver *unarchiver = [[PWUnarchiver alloc] init];
tags = [unarchiver unarchivedObjectOfClasses:set data:data];
} else {
tags = [NSKeyedUnarchiver unarchiveObjectWithFile:self.tagsCacheFile];
}

PWLogVerbose(@"Get cached tags: %@", tags);
Expand Down Expand Up @@ -114,15 +112,13 @@ - (void)addEmailTags:(NSDictionary *)tags {
- (NSDictionary *)getEmailTags {
NSDictionary *tags = nil;

if (TARGET_OS_IOS && [PWUtils isSystemVersionGreaterOrEqualTo:@"11.0"]) {
if (TARGET_OS_IOS) {
NSURL *url = [NSURL fileURLWithPath:self.emailTagsCacheFile];
NSData *data = [NSData dataWithContentsOfURL:url];

NSSet *set = [NSSet setWithObjects:[NSString class], [NSDictionary class], nil];
PWUnarchiver *unarchiver = [[PWUnarchiver alloc] init];
tags = [unarchiver unarchivedObjectOfClasses:set data:data];
} else {
tags = [NSKeyedUnarchiver unarchiveObjectWithFile:self.emailTagsCacheFile];
}

PWLogVerbose(@"Get cached email tags: %@", tags);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,14 @@ - (NSMutableArray *)requestsQueue {
NSFileManager *fileManager = [NSFileManager new];
NSString *cachePath = [self cachePath:fileManager];
if ([fileManager fileExistsAtPath:cachePath]) {
if (TARGET_OS_IOS && [PWUtils isSystemVersionGreaterOrEqualTo:@"11.0"]) {
if (TARGET_OS_IOS) {
NSURL *url = [NSURL fileURLWithPath:cachePath];
NSData *data = [NSData dataWithContentsOfURL:url];

NSSet *set = [NSSet setWithObjects:[PWCachedRequest class], [NSMutableArray class], [NSURL class], nil];

PWUnarchiver *unarchiver = [[PWUnarchiver alloc] init];
_requestsQueue = [unarchiver unarchivedObjectOfClasses:set data:data];
} else {
_requestsQueue = [NSKeyedUnarchiver unarchiveObjectWithFile:cachePath];
}
}
if (!_requestsQueue) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ - (void)postEvent:(NSString *)blob {
if (successCallback) {
NSString *javaScriptRequest = [NSString stringWithFormat:@"%@()", successCallback, nil];

/**
Starting with iOS 14, we use WKContentWorld to run injected JavaScript in a secure sandboxed environment,
isolating it from untrusted web JavaScript. More details: https://developer.apple.com/documentation/webkit/wkcontentworld
*/
if (TARGET_OS_IOS && [PWUtils isSystemVersionGreaterOrEqualTo:@"14.0"]) {
WKContentWorld* sandbox = [WKContentWorld pageWorld];
[self.webClient.webView evaluateJavaScript:javaScriptRequest
Expand All @@ -117,7 +121,10 @@ - (void)postEvent:(NSString *)blob {
} else {
if (errorCallback) {
NSString *javaScriptRequest = [NSString stringWithFormat:@"%@('%@')", errorCallback, error.localizedDescription, nil];

/**
Starting with iOS 14, we use WKContentWorld to run injected JavaScript in a secure sandboxed environment,
isolating it from untrusted web JavaScript. More details: https://developer.apple.com/documentation/webkit/wkcontentworld
*/
if (TARGET_OS_IOS && [PWUtils isSystemVersionGreaterOrEqualTo:@"14.0"]) {
WKContentWorld* sandbox = [WKContentWorld pageWorld];
[self.webClient.webView evaluateJavaScript:javaScriptRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ - (NSString *)pw_stringByEvaluatingJavaScriptFromString:(NSString *)script error
__block NSError *tmpError = nil;
__weak typeof(self) wself = self;

/**
Starting with iOS 14, we use WKContentWorld to run injected JavaScript in a secure sandboxed environment,
isolating it from untrusted web JavaScript. More details: https://developer.apple.com/documentation/webkit/wkcontentworld
*/
if (TARGET_OS_IOS && [PWUtils isSystemVersionGreaterOrEqualTo:@"14.0"]) {
WKContentWorld* sandbox = [WKContentWorld pageWorld];
[self evaluateJavaScript:script
Expand Down Expand Up @@ -69,6 +73,10 @@ - (void)jsErrorHandlingWithResult:(id)result

//just execute the JS, dont wait for a response
- (void)pw_executeJavaScriptFromString:(NSString *)script {
/**
Starting with iOS 14, we use WKContentWorld to run injected JavaScript in a secure sandboxed environment,
isolating it from untrusted web JavaScript. More details: https://developer.apple.com/documentation/webkit/wkcontentworld
*/
if (TARGET_OS_IOS && [PWUtils isSystemVersionGreaterOrEqualTo:@"14.0"]) {
WKContentWorld* sandbox = [WKContentWorld pageWorld];
[self evaluateJavaScript:script
Expand Down
4 changes: 4 additions & 0 deletions iOS_SDK/Pushwoosh/Pushwoosh/Rich Media/PWWebClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,10 @@ - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigat
NSString *customData = [[PushNotificationManager pushManager] getCustomPushData:_richMedia.pushPayload];

if (customData) {
/**
Starting with iOS 14, we use WKContentWorld to run injected JavaScript in a secure sandboxed environment,
isolating it from untrusted web JavaScript. More details: https://developer.apple.com/documentation/webkit/wkcontentworld
*/
if (TARGET_OS_IOS && [PWUtils isSystemVersionGreaterOrEqualTo:@"14.0"]) {
WKContentWorld* sandbox = [WKContentWorld pageWorld];
[webView evaluateJavaScript:[NSString stringWithFormat:@"window.pushwoosh._customData = %@;", customData]
Expand Down
2 changes: 1 addition & 1 deletion iOS_SDK/Pushwoosh/Pushwoosh/Utils/PWUnarchiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

NS_ASSUME_NONNULL_BEGIN

@interface PWUnarchiver : NSObject <NSCoding, NSSecureCoding>
@interface PWUnarchiver : NSObject <NSSecureCoding>

- (id)unarchivedObjectOfClasses:(NSSet<Class> *)classes data:(NSData *)data;

Expand Down

0 comments on commit 795ff55

Please sign in to comment.