mirror of
https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background
synced 2024-11-21 23:04:53 +00:00
Prefer setProperty over the private setter
This commit is contained in:
parent
d7dd8a913c
commit
ca3530d232
@ -252,9 +252,9 @@ NSString* const kAPPBackgroundEventFailure = @"failure";
|
|||||||
/**
|
/**
|
||||||
* Method to swizzle.
|
* Method to swizzle.
|
||||||
*/
|
*/
|
||||||
+ (NSString*) swizzleMethod
|
+ (NSString*) wkProperty
|
||||||
{
|
{
|
||||||
NSString* str = @"X3NldEFsd2F5c1J1bnNBdEZvcmVncm91bmRQcmlvcml0eTo=";
|
NSString* str = @"X2Fsd2F5c1J1bnNBdEZvcmVncm91bmRQcmlvcml0eQ==";
|
||||||
NSData* data = [[NSData alloc] initWithBase64EncodedString:str options:0];
|
NSData* data = [[NSData alloc] initWithBase64EncodedString:str options:0];
|
||||||
|
|
||||||
return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
|
return [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
|
||||||
@ -275,8 +275,8 @@ NSString* const kAPPBackgroundEventFailure = @"failure";
|
|||||||
^(CDVPlugin *self, NSDictionary *settings) {
|
^(CDVPlugin *self, NSDictionary *settings) {
|
||||||
id obj = ((id (*)(id, SEL, NSDictionary*))_imp)(self, _cmd, settings);
|
id obj = ((id (*)(id, SEL, NSDictionary*))_imp)(self, _cmd, settings);
|
||||||
|
|
||||||
SEL sel = NSSelectorFromString([APPBackgroundMode swizzleMethod]);
|
[obj setValue:[NSNumber numberWithBool:YES]
|
||||||
((void (*)(id, SEL, BOOL))[obj methodForSelector:sel])(obj, sel, YES);
|
forKey:[APPBackgroundMode wkProperty]];
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user