mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Added #ifdef for JMC integration.
This commit is contained in:
parent
ac1ac09411
commit
2dadd66658
@ -62,20 +62,29 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
+ (BOOL)isJMCActive {
|
+ (BOOL)isJMCActive {
|
||||||
|
#ifdef JMC_ENABLED
|
||||||
id jmcClass = NSClassFromString(@"JMC");
|
id jmcClass = NSClassFromString(@"JMC");
|
||||||
id jmcInstance = [jmcClass performSelector:@selector(instance)];
|
id jmcInstance = [jmcClass performSelector:@selector(instance)];
|
||||||
|
|
||||||
return (jmcInstance) && ([jmcInstance performSelector:@selector(url)]);
|
return (jmcInstance) && ([jmcInstance performSelector:@selector(url)]);
|
||||||
|
#else
|
||||||
|
return NO;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (BOOL)isJMCPresent {
|
+ (BOOL)isJMCPresent {
|
||||||
|
#ifdef JMC_ENABLED
|
||||||
id jmcClass = NSClassFromString(@"JMC");
|
id jmcClass = NSClassFromString(@"JMC");
|
||||||
return (jmcClass) && ([jmcClass respondsToSelector:@selector(instance)]);
|
return (jmcClass) && ([jmcClass respondsToSelector:@selector(instance)]);
|
||||||
|
#else
|
||||||
|
return NO;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Private Class Methods
|
#pragma mark - Private Class Methods
|
||||||
|
|
||||||
+ (void)disableJMCCrashReporter {
|
+ (void)disableJMCCrashReporter {
|
||||||
|
#ifdef JMC_ENABLED
|
||||||
id jmcClass = NSClassFromString(@"JMC");
|
id jmcClass = NSClassFromString(@"JMC");
|
||||||
id jmcInstance = [jmcClass performSelector:@selector(instance)];
|
id jmcInstance = [jmcClass performSelector:@selector(instance)];
|
||||||
id jmcOptions = [jmcInstance performSelector:@selector(options)];
|
id jmcOptions = [jmcInstance performSelector:@selector(options)];
|
||||||
@ -88,16 +97,22 @@
|
|||||||
invocation.selector = crashReporterSelector;
|
invocation.selector = crashReporterSelector;
|
||||||
[invocation setArgument:&value atIndex:2];
|
[invocation setArgument:&value atIndex:2];
|
||||||
[invocation invoke];
|
[invocation invoke];
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (BOOL)checkJMCConfiguration:(NSDictionary *)configuration {
|
+ (BOOL)checkJMCConfiguration:(NSDictionary *)configuration {
|
||||||
|
#ifdef JMC_ENABLED
|
||||||
return (([[configuration valueForKey:@"enabled"] boolValue]) &&
|
return (([[configuration valueForKey:@"enabled"] boolValue]) &&
|
||||||
([[configuration valueForKey:@"url"] length] > 0) &&
|
([[configuration valueForKey:@"url"] length] > 0) &&
|
||||||
([[configuration valueForKey:@"key"] length] > 0) &&
|
([[configuration valueForKey:@"key"] length] > 0) &&
|
||||||
([[configuration valueForKey:@"project"] length] > 0));
|
([[configuration valueForKey:@"project"] length] > 0));
|
||||||
|
#else
|
||||||
|
return NO;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void)applyJMCConfiguration:(NSDictionary *)configuration {
|
+ (void)applyJMCConfiguration:(NSDictionary *)configuration {
|
||||||
|
#ifdef JMC_ENABLED
|
||||||
id jmcClass = NSClassFromString(@"JMC");
|
id jmcClass = NSClassFromString(@"JMC");
|
||||||
id jmcInstance = [jmcClass performSelector:@selector(instance)];
|
id jmcInstance = [jmcClass performSelector:@selector(instance)];
|
||||||
SEL configureSelector = @selector(configureJiraConnect:projectKey:apiKey:);
|
SEL configureSelector = @selector(configureJiraConnect:projectKey:apiKey:);
|
||||||
@ -113,6 +128,7 @@
|
|||||||
[invocation setArgument:&project atIndex:3];
|
[invocation setArgument:&project atIndex:3];
|
||||||
[invocation setArgument:&key atIndex:4];
|
[invocation setArgument:&key atIndex:4];
|
||||||
[invocation invoke];
|
[invocation invoke];
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Public Instance Methods (Configuration)
|
#pragma mark - Public Instance Methods (Configuration)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user