mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2024-10-07 01:32:08 +08:00
Remove expiration class method and convert platform to class property
This commit is contained in:
parent
7d9f0abe76
commit
c05b7215eb
@ -98,6 +98,11 @@ NS_SWIFT_NAME(handle(logMessage:));
|
||||
*/
|
||||
@interface OpenVPNAdapter (Public)
|
||||
|
||||
/**
|
||||
Returns platform description
|
||||
*/
|
||||
@property (class, nonnull, readonly, nonatomic) NSString *platform;
|
||||
|
||||
/**
|
||||
<#Description#>
|
||||
*/
|
||||
@ -124,16 +129,6 @@ NS_SWIFT_NAME(handle(logMessage:));
|
||||
*/
|
||||
@property (nonnull, readonly, nonatomic) OpenVPNInterfaceStats *interfaceStats;
|
||||
|
||||
/**
|
||||
Returns date/time of app expiration
|
||||
*/
|
||||
+ (nonnull NSDate *)expiration;
|
||||
|
||||
/**
|
||||
Returns platform description
|
||||
*/
|
||||
+ (nonnull NSString *)platform;
|
||||
|
||||
/**
|
||||
<#Description#>
|
||||
|
||||
|
@ -128,6 +128,11 @@ NSString * const OpenVPNAdapterErrorEventKey = @"me.ss-abramchuk.openvpn-adapter
|
||||
|
||||
#pragma mark Properties
|
||||
|
||||
+ (NSString *)platform {
|
||||
std::string platform = OpenVPNClient::platform();
|
||||
return [NSString stringWithUTF8String:platform.c_str()];
|
||||
}
|
||||
|
||||
- (void)setDelegate:(id<OpenVPNAdapterDelegate>)delegate {
|
||||
_delegate = delegate;
|
||||
}
|
||||
@ -158,16 +163,6 @@ NSString * const OpenVPNAdapterErrorEventKey = @"me.ss-abramchuk.openvpn-adapter
|
||||
return [[OpenVPNInterfaceStats alloc] initWithInterfaceStats:stats];
|
||||
}
|
||||
|
||||
+ (NSDate *)expiration {
|
||||
NSNumber *time = [NSNumber numberWithInteger:OpenVPNClient::app_expire()];
|
||||
return [NSDate dateWithTimeIntervalSince1970:[time doubleValue]];
|
||||
}
|
||||
|
||||
+ (NSString *)platform {
|
||||
std::string platform = OpenVPNClient::platform();
|
||||
return [NSString stringWithUTF8String:platform.c_str()];
|
||||
}
|
||||
|
||||
#pragma mark Client Configuration
|
||||
|
||||
- (OpenVPNProperties *)applyConfiguration:(nonnull OpenVPNConfiguration *)configuration error:(out NSError * __nullable * __nullable)error {
|
||||
|
Loading…
Reference in New Issue
Block a user