我想实现我在iOS私有API Xamarin的项目.
有人可以解释一下,我如何在Xamarin中实现以下私有API?
我想,我需要建立一个绑定的项目,但我不能得到它的工作.
在我的本机iOS项目中运行时,以下代码有效.
我的.h文件:
#import <Foundation/Foundation.h>
@interface NSURLRequest (IgnoreSSL)
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString*)host;
@end
Run Code Online (Sandbox Code Playgroud)
我的.m文件:
#import "NSURLRequest+IgnoreSSL.h"
@interface NSURLRequest ()
@end
@implementation NSURLRequest (IgnoreSSL)
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString*)host
{
// ignore certificate errors only for this domain
return YES;
}
@end
Run Code Online (Sandbox Code Playgroud)