Require Only App-Extension-Safe API
Currently there is nothing in the code review/analysis or compile phase within Xamarin.iOS
that will warn or prevent APIs that are not allowed within Extensions,
i.e. There are TODO
notes within the healthkit.cs:
// FIXME NS_EXTENSION_UNAVAILABLE("Not available to extensions") ;
It currently is up to the C# developer to follow Apple's Guidelines. Obviously the following would cause an app to be rejected if this was within Extension code:
var a = UIKit.UIApplication.SharedApplication;
But the Some APIs Are Unavailable to App Extensions list provided by Apple is fairly concise on what is not allowed:
Personally For code sharing purposes I add a compiler directive to my Extension projects to conditional compile code that I need to remove... ("NS_EXTENSION_UNAVAILABLE_IOS", just like what is available in ObjC/Swift Extension projects)