Ionic app crashes on iOS 12.2 because of '_alwaysRunsAtForegroundPriority'

后端 未结 6 698
情话喂你
情话喂你 2021-02-06 10:36

On iOS 12.2 my app is terminated just after startup, with this message in xcode:

Terminating app due to uncaught exception \'NSUnknownKeyException\', rea

6条回答
  •  灰色年华
    2021-02-06 10:52

    Try this. Download plugin cordova-plugin-background-mode or cordova-plugin-better-background-mode in your local folder, attach it to project as a local plugin. Go to plugin file src\ios\APPBackgroundMode.m and replace following lines

    + (NSString*) wkProperty
    {
        NSString* str = @"X2Fsd2F5c1J1bnNBdEZvcmVncm91bmRQcmlvcml0eQ==";
        NSData* data  = [[NSData alloc] initWithBase64EncodedString:str options:0];
    
        return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
    }
    

    with

    + (NSString*) wkProperty
    {
        NSString* str = @"YWx3YXlzUnVuc0F0Rm9yZWdyb3VuZFByaW9yaXR5";
        NSData* data  = [[NSData alloc] initWithBase64EncodedString:str options:0];
    
        return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
    }
    

提交回复
热议问题