如何在Xamarin.iOS项目中使用以下代码或如何在Xamarin C#中使用iOS私有API?最好的问候。
Class LSApplicationWorkspace_class = objc_getClass("LSApplicationWorkspace");
NSObject * workspace = [LSApplicationWorkspace_class performSelector:@selector(defaultWorkspace)];
BOOL isopen = [workspace performSelector:@selector(openApplicationWithBundleID:) withObject:@"com.apple.mobilesafari"];
答案 0 :(得分:0)
试试这个:
NSObject LSApplicationWorkspace_class = new NSObject(Class.GetHandle("LSApplicationWorkspace"));
NSObject workspace = LSApplicationWorkspace_class.PerformSelector(new Selector("defaultWorkspace"));
var isOpen = workspace.PerformSelector(new Selector("openApplicationWithBundleID:"), new NSString("com.apple.mobilesafari"));