mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-02-11 00:00:08 +08:00
Return expiration and platform
This commit is contained in:
@@ -124,6 +124,16 @@ 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#>
|
||||
|
||||
|
||||
@@ -158,6 +158,16 @@ 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 {
|
||||
|
||||
Reference in New Issue
Block a user