From abb6b30cf837b266d2d8ca18b923611b5af02201 Mon Sep 17 00:00:00 2001 From: Jesper Balslev Date: Wed, 30 Oct 2019 14:07:52 +0000 Subject: [PATCH] Merged in JesperBalslev/cordova-plugin-run-in-background/Jesper-Balslev/previous-fix-wasnt-backwards-compatible--1572444052573 (pull request #3) Previous fix wasn't backwards compatible with versions older than 12.2. This fixes it. This fixes it. --- src/ios/APPBackgroundMode.m | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ios/APPBackgroundMode.m b/src/ios/APPBackgroundMode.m index 174b666..be941ee 100644 --- a/src/ios/APPBackgroundMode.m +++ b/src/ios/APPBackgroundMode.m @@ -241,7 +241,16 @@ NSString* const kAPPBackgroundEventDeactivate = @"deactivate"; */ + (NSString*) wkProperty { - NSString* str = @"YWx3YXlzUnVuc0F0Rm9yZWdyb3VuZFByaW9yaXR5"; + NSString * str = @""; + if (@available(iOS 12.2, *)) { + // do stuff for iOS 12.2 and newer + NSLog(@"iOS 12.2+ detected"); + str = @"YWx3YXlzUnVuc0F0Rm9yZWdyb3VuZFByaW9yaXR5"; + } else { + // do stuff for iOS 12.1 and older + NSLog(@"iOS Below 12.2 detected"); + str = @"X2Fsd2F5c1J1bnNBdEZvcmVncm91bmRQcmlvcml0eQ=="; + } NSData* data = [[NSData alloc] initWithBase64EncodedString:str options:0]; return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];