Skip to content

Commit 6f71c9d

Browse files
committed
moving setClass for NSKeyedUnarchiver outside of version check
This means that the NSKeyedUnarchiver class for OSInAppMessage will always be OSInAppMessageInternal even if the migration doesn't run. This is safe because OSInAppMessage does not conform to codeable so it should never be archived/unarchived.
1 parent f36acb5 commit 6f71c9d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

iOS_SDK/OneSignalSDK/Source/OSMigrationController.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ - (void)migrateIAMRedisplayCache {
118118
- (void)migrateToOSInAppMessageInternal {
119119
let nameChangeVersion = 30700;
120120
long sdkVersion = [OneSignalUserDefaults.initShared getSavedIntegerForKey:OSUD_CACHED_SDK_VERSION defaultValue:0];
121+
[NSKeyedUnarchiver setClass:[OSInAppMessageInternal class] forClassName:@"OSInAppMessage"];
121122
if (sdkVersion < nameChangeVersion) {
122123
[OneSignal onesignal_Log:ONE_S_LL_DEBUG message:[NSString stringWithFormat:@"Migrating OSInAppMessage from version: %ld", sdkVersion]];
123124

0 commit comments

Comments
 (0)