From 82c93a52c5609f88f0a8ad7ecc0c91a3caec011f Mon Sep 17 00:00:00 2001 From: Quentin Dreyer Date: Wed, 24 Apr 2019 11:22:47 +0200 Subject: [PATCH] fix: add compatibility for iOS >= 12.2 Replace private API _alwaysRunsAtForegroundPriority with alwaysRunsAtForegroundPriority --- src/ios/APPBackgroundMode.m | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ios/APPBackgroundMode.m b/src/ios/APPBackgroundMode.m index 20f0695b..163675ce 100644 --- a/src/ios/APPBackgroundMode.m +++ b/src/ios/APPBackgroundMode.m @@ -241,8 +241,13 @@ - (void) fireEvent:(NSString*)event */ + (NSString*) wkProperty { - NSString* str = @"X2Fsd2F5c1J1bnNBdEZvcmVncm91bmRQcmlvcml0eQ=="; - NSData* data = [[NSData alloc] initWithBase64EncodedString:str options:0]; + NSString* str; + if (@available(iOS 12.2, *)) { + str = @"YWx3YXlzUnVuc0F0Rm9yZWdyb3VuZFByaW9yaXR5"; + } else { + str = @"X2Fsd2F5c1J1bnNBdEZvcmVncm91bmRQcmlvcml0eQ=="; + } + NSData* data = [[NSData alloc] initWithBase64EncodedString:str options:0]; return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; }