[watchos][gamekit] Enable GameKit on watchOS (#452)

Apple does not (yet?) ship the headers for GameKit on the watch simulator (radar [1]). The static registrar was tweaked to skip this on the simulator.

[1] https://trello.com/c/Okdw58IO/51-27476259-gamekit-header-files-are-missing-for-watchsimulator
This commit is contained in:
Sebastien Pouliot 2016-07-22 13:35:59 -04:00 коммит произвёл GitHub
Родитель a112163980
Коммит 5a9d8240c2
9 изменённых файлов: 209 добавлений и 29 удалений

Просмотреть файл

@ -54,10 +54,14 @@ namespace XamCore.GameKit {
if (categoryOrIdentifier == null)
throw new ArgumentNullException ("categoryOrIdentifier");
#if WATCH
Handle = InitWithLeaderboardIdentifier (categoryOrIdentifier);
#else
if (UIDevice.CurrentDevice.CheckSystemVersion (7, 0))
Handle = InitWithLeaderboardIdentifier (categoryOrIdentifier);
else
Handle = InitWithCategory (categoryOrIdentifier);
#endif
}
#if !XAMCORE_2_0

Просмотреть файл

@ -18,15 +18,14 @@ namespace XamCore.GameKit {
#if !MONOMAC
#if !TVOS
// NSUInteger -> GKPeerPickerController.h
[NoTV][NoWatch]
[Native]
[Availability (Introduced = Platform.iOS_3_0, Deprecated = Platform.iOS_7_0)]
public enum GKPeerPickerConnectionType : nuint_compat_int {
Online = 1 << 0,
Nearby = 1 << 1
}
#endif
// untyped enum -> GKPublicConstants.h
[Availability (Introduced = Platform.iOS_3_0, Deprecated = Platform.iOS_7_0)]
@ -234,6 +233,7 @@ namespace XamCore.GameKit {
}
// NSInteger -> GKGameCenterViewController.h
[NoWatch]
[Native]
public enum GKGameCenterViewControllerState : nint {
Default = -1,

Просмотреть файл

@ -14,7 +14,7 @@ using XamCore.Foundation;
using XamCore.CoreFoundation;
namespace XamCore.GameKit {
#if !MONOMAC && !TVOS
#if !MONOMAC && !TVOS && !WATCH
public class GKDataReceivedEventArgs : EventArgs {
public GKDataReceivedEventArgs (NSData data, string peer, GKSession session)
{
@ -61,7 +61,7 @@ namespace XamCore.GameKit {
}
#endif
#if !TVOS
#if !TVOS && !WATCH
public partial class GKSession {
#if !XAMCORE_2_0
public bool SendData (NSData data, string [] peers, GKSendDataMode mode, out NSError error)
@ -327,7 +327,7 @@ namespace XamCore.GameKit {
}
public partial class GKMatch {
#if !TVOS
#if !XAMCORE_3_0
// Compatbility with the broken API, it is deprecated, so that is good.
public virtual bool SendData (NSData data, string [] players, GKMatchSendDataMode mode, NSError error)
{

Просмотреть файл

@ -11,10 +11,6 @@ namespace XamCore.ObjCRuntime {
#endif
static partial class Messaging {
internal const string LIBOBJC_DYLIB = "/usr/lib/libobjc.dylib";
// not generated anymore (by other bindings) but needed in NSObject2.cs
[DllImport ("/usr/lib/libobjc.dylib", EntryPoint="objc_msgSend")]
public extern static void void_objc_msgSend_IntPtr_IntPtr_bool (IntPtr receiver, IntPtr selector, IntPtr arg1, IntPtr arg2, bool arg3);
}
}
#endif // WATCH

Просмотреть файл

@ -1465,9 +1465,10 @@ SHARED_SOURCES = \
# wkwebkit.cs (webkit.cs is already used for Mac bindings)
#
COMMON_FRAMEWORKS = \
CoreFoundation \
Foundation \
COMMON_FRAMEWORKS = \
CoreFoundation \
Foundation \
GameKit \
MAC_FRAMEWORKS = \
$(COMMON_FRAMEWORKS) \
@ -1499,7 +1500,6 @@ MAC_FRAMEWORKS = \
EventKit \
FinderSync \
GameController \
GameKit \
GameplayKit \
GLKit \
ImageIO \
@ -1574,7 +1574,6 @@ IOS_FRAMEWORKS = \
ExternalAccessory \
GLKit \
GameController \
GameKit \
GameplayKit \
HealthKit \
HealthKitUI \
@ -1670,7 +1669,6 @@ TVOS_FRAMEWORKS = \
CoreVideo \
GLKit \
GameController \
GameKit \
GameplayKit \
HomeKit \
ImageIO \

Просмотреть файл

@ -51,13 +51,16 @@ namespace XamCore.GameKit {
delegate void GKChallengeComposeHandler (UIViewController composeController, bool issuedChallenge, string [] sentPlayerIDs);
#endif
#if TVOS
// hack to let [NoTV] work properly
enum GKPeerPickerConnectionType {}
#if WATCH
// hacks to let [NoWatch] work properly
interface UIAppearance {}
interface UIViewController {}
interface UINavigationController {}
#endif
#if !MONOMAC
[NoWatch]
[NoTV]
[BaseType (typeof (NSObject))]
[Model]
@ -76,6 +79,7 @@ namespace XamCore.GameKit {
void ControllerCancelled (GKPeerPickerController picker);
}
[NoWatch]
[NoTV]
[BaseType (typeof (NSObject))]
[Availability (Introduced = Platform.iOS_3_0, Deprecated = Platform.iOS_7_0, Message = "Use MCBrowserViewController from the MultipeerConnectivity framework instead")]
@ -100,6 +104,7 @@ namespace XamCore.GameKit {
bool Visible { [Bind ("isVisible")] get; }
}
[NoWatch] // only exposed thru GKVoiceChatService (not in 3.0)
[NoTV]
[BaseType (typeof (NSObject))]
[Model]
@ -128,6 +133,7 @@ namespace XamCore.GameKit {
void ReceivedInvitation (GKVoiceChatService voiceChatService, string participantID, nint callID);
}
[NoWatch] // deprecated in 2.0 (but framework not added before 3.0)
[NoTV]
[BaseType (typeof (NSObject))]
[Availability (Introduced = Platform.iOS_3_0, Deprecated = Platform.iOS_7_0, Message = "Use GKVoiceChat instead")]
@ -191,6 +197,7 @@ namespace XamCore.GameKit {
}
[NoTV]
[NoWatch] // only exposed thru GKSession (not in 3.0)
[BaseType (typeof (NSObject))]
[Model]
[Protocol]
@ -209,6 +216,7 @@ namespace XamCore.GameKit {
}
[NoTV]
[NoWatch] // deprecated in 2.0 (but framework not added before 3.0)
[BaseType (typeof (NSObject))]
[Availability (Introduced = Platform.iOS_3_0 | Platform.Mac_10_8, Deprecated = Platform.iOS_7_0 | Platform.Mac_10_10, Message = "Use MultipeerConnectivity.MCSession instead")]
interface GKSession {
@ -292,7 +300,8 @@ namespace XamCore.GameKit {
string [] PeersWithConnectionState (GKPeerConnectionState state);
}
#endif
[Watch (3,0)]
[iOS (4,2), Mac (10, 8)]
[BaseType (typeof (NSObject))]
interface GKLeaderboard {
@ -305,6 +314,7 @@ namespace XamCore.GameKit {
[Export ("maxRange", ArgumentSemantic.Assign)]
nint MaxRange { get; }
[NoWatch] // deprecated in 2.0 (but framework not added before 3.0)
[NoTV]
[Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_10, Message = "Use Identifier instead")]
[NullAllowed] // by default this property is null
@ -323,6 +333,7 @@ namespace XamCore.GameKit {
[Export ("localPlayerScore", ArgumentSemantic.Retain)]
GKScore LocalPlayerScore { get; }
[NoWatch] // deprecated in 2.0 (but framework not added before 3.0)
[Availability (Deprecated = Platform.iOS_8_0 | Platform.Mac_10_10, Message = "Use ctor (GKPlayer [] players) instead")]
[Export ("initWithPlayerIDs:")]
IntPtr Constructor ([NullAllowed] string [] players);
@ -332,6 +343,7 @@ namespace XamCore.GameKit {
void LoadScores ([NullAllowed] GKScoresLoadedHandler scoresLoadedHandler);
[NoTV]
[NoWatch] // deprecated in 2.0 (but framework not added before 3.0)
[Availability (Deprecated = Platform.iOS_6_0 | Platform.Mac_10_9, Message = "Use LoadLeaderboards instead")]
[Static]
[Export ("loadCategoriesWithCompletionHandler:")]
@ -339,6 +351,7 @@ namespace XamCore.GameKit {
void LoadCategories ([NullAllowed] GKCategoryHandler categoryHandler);
[NoTV]
[NoWatch] // deprecated in 2.0 (but framework not added before 3.0)
[Static]
[Since (5,0)]
[Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_10, Message = "Use SetDefaultLeaderboard on GKLocalPlayer instead")]
@ -367,6 +380,7 @@ namespace XamCore.GameKit {
string Identifier { get; set; }
[NoTV]
[NoWatch]
[Since (7,0)]
[Export ("loadImageWithCompletionHandler:")]
[Async]
@ -383,6 +397,7 @@ namespace XamCore.GameKit {
}
#if !MONOMAC
[Watch (3,0)]
[Since (7,0)]
[BaseType (typeof (NSObject))]
interface GKLeaderboardSet : NSCoding, NSSecureCoding {
@ -407,12 +422,14 @@ namespace XamCore.GameKit {
void LoadLeaderboards ([NullAllowed] GKLeaderboardsHandler completionHandler);
[NoTV]
[NoWatch]
[Export ("loadImageWithCompletionHandler:")]
[Async]
void LoadImage ([NullAllowed] GKImageLoadedHandler completionHandler);
}
#endif
[Watch (3,0)]
[iOS (10,0)][Mac (10,12)]
[BaseType (typeof(NSObject))]
interface GKBasePlayer
@ -424,6 +441,7 @@ namespace XamCore.GameKit {
string DisplayName { get; }
}
[Watch (3,0)]
[iOS (10,0)][Mac (10,12)]
[BaseType (typeof(GKBasePlayer))]
interface GKCloudPlayer
@ -433,6 +451,7 @@ namespace XamCore.GameKit {
void GetCurrentSignedInPlayer ([NullAllowed] string containerName, Action<GKCloudPlayer, NSError> handler);
}
[Watch (3,0)]
[Since (4,2)]
[BaseType (typeof (GKBasePlayer))]
// note: NSSecureCoding conformity is undocumented - but since it's a runtime check (on ObjC) we still need it
@ -444,6 +463,7 @@ namespace XamCore.GameKit {
string Alias { get; }
[NoTV]
[NoWatch]
[Availability (Deprecated = Platform.iOS_8_0 | Platform.Mac_10_10, Message = "Use GKLocalPlayer.LoadFriendPlayers instead")]
[Export ("isFriend")]
bool IsFriend { get; }
@ -457,6 +477,7 @@ namespace XamCore.GameKit {
// This name looks wrong, see the "Notification" at the end.
NSString DidChangeNotificationNameNotification { get; }
[NoWatch]
[Since (5,0)]
[Export ("loadPhotoForSize:withCompletionHandler:")]
[Async]
@ -468,19 +489,23 @@ namespace XamCore.GameKit {
string DisplayName { get; }
#endif
[NoWatch]
[Availability (Introduced = Platform.iOS_9_0 | Platform.Mac_10_11)]
[Static]
[Export ("anonymousGuestPlayerWithIdentifier:")]
GKPlayer GetAnonymousGuestPlayer (string guestIdentifier);
[NoWatch]
[Availability (Introduced = Platform.iOS_9_0 | Platform.Mac_10_11)]
[Export ("guestIdentifier")]
string GuestIdentifier { get; }
}
[Watch (3,0)]
[Since (4,1)]
[BaseType (typeof (NSObject))]
interface GKScore : NSSecureCoding {
[NoWatch]
[Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_10, Message = "Use InitWithLeaderboardIdentifier instead")]
[Internal][NullAllowed]
[Export ("initWithCategory:")]
@ -491,6 +516,7 @@ namespace XamCore.GameKit {
IntPtr Constructor (string identifier, GKPlayer player);
#if !MONOMAC
[NoWatch]
[Since (7,0)]
[Export ("initWithLeaderboardIdentifier:forPlayer:")]
IntPtr Constructor (string identifier, string playerID);
@ -502,6 +528,7 @@ namespace XamCore.GameKit {
#endif
#if !XAMCORE_2_0
[NoWatch]
// [Availability (Deprecated = Platform.iOS_8_0 | Platform.Mac_10_10, Message = "Use Player instead")] - Unlike rest of deprecations we are just ripping out due to poor naming
[Export ("playerID", ArgumentSemantic.Retain)]
string Player { get; }
@ -529,6 +556,7 @@ namespace XamCore.GameKit {
[Export ("formattedValue", ArgumentSemantic.Copy)]
string FormattedValue { get; }
[NoWatch]
[NoTV]
[Availability (Introduced = Platform.iOS_4_1 | Platform.Mac_10_8, Deprecated = Platform.iOS_7_0 | Platform.Mac_10_10, Message = "Use LeaderboardIdentifier instead")]
[NullAllowed] // by default this property is null
@ -540,6 +568,7 @@ namespace XamCore.GameKit {
string category { get; set; }
#endif
[NoWatch]
[NoTV]
[Availability (Introduced = Platform.iOS_4_1 | Platform.Mac_10_8, Deprecated = Platform.iOS_7_0 | Platform.Mac_10_10, Message = "Use ReportScores instead")]
[Export ("reportScoreWithCompletionHandler:")]
@ -559,6 +588,7 @@ namespace XamCore.GameKit {
bool ShouldSetDefaultLeaderboard { get; set; }
[NoTV]
[NoWatch]
[Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_10, Message = "Pass GKPlayers to ChallengeComposeController (GKPlayer [] players, string message, ... ) and present the view controller instead")]
[iOS (6,0), Mac (10,8)]
[Export ("issueChallengeToPlayers:message:")]
@ -575,12 +605,13 @@ namespace XamCore.GameKit {
[Export ("leaderboardIdentifier", ArgumentSemantic.Copy)]
string LeaderboardIdentifier { get; set; }
[NoWatch]
[Since (7,0)]
[Export ("reportScores:withEligibleChallenges:withCompletionHandler:"), Static]
[Async]
void ReportScores (GKScore[] scores, [NullAllowed] GKChallenge[] challenges, [NullAllowed] Action<NSError> completionHandler);
[NoTV]
[NoTV][NoWatch]
[Availability (Deprecated = Platform.iOS_8_0, Message = "Pass GKPlayers to ChallengeComposeController (GKPlayer [] players, string message, ...) instead")]
[iOS (7,0)]
[Export ("challengeComposeControllerWithPlayers:message:completionHandler:")]
@ -592,12 +623,14 @@ namespace XamCore.GameKit {
[Export ("challengeComposeControllerWithMessage:players:completionHandler:")]
NSViewController ChallengeComposeController ([NullAllowed] string message, [NullAllowed] GKPlayer [] players, [NullAllowed] GKChallengeComposeHandler completionHandler);
#else
[NoWatch]
[iOS (8,0)]
[Export ("challengeComposeControllerWithMessage:players:completionHandler:")]
UIViewController ChallengeComposeController ([NullAllowed] string message, [NullAllowed] GKPlayer [] players, [NullAllowed] GKChallengeComposeHandler completionHandler);
#endif
}
[NoWatch]
[NoTV]
[Since (4,2)]
[Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_10, Message = "Use GKGameCenterViewController instead")]
@ -613,7 +646,7 @@ namespace XamCore.GameKit {
void DidFinish (GKLeaderboardViewController viewController);
}
[NoTV]
[NoTV][NoWatch]
[Availability (Introduced = Platform.iOS_4_2 | Platform.Mac_10_8, Deprecated = Platform.iOS_7_0 | Platform.Mac_10_10, Message = "Use GKGameCenterViewController instead")]
#if MONOMAC
[BaseType (typeof (GKGameCenterViewController), Events=new Type [] { typeof (GKLeaderboardViewControllerDelegate)}, Delegates=new string [] {"WeakDelegate"})]
@ -645,6 +678,7 @@ namespace XamCore.GameKit {
GKLeaderboardTimeScope TimeScope { get; set; }
}
[Watch (3,0)]
[Since (4,2)]
[MountainLion]
[BaseType (typeof (GKPlayer))]
@ -652,6 +686,7 @@ namespace XamCore.GameKit {
[Export ("authenticated")]
bool Authenticated { [Bind ("isAuthenticated")] get; }
[NoWatch]
[NoTV]
[Availability (Deprecated = Platform.iOS_8_0 | Platform.Mac_10_10, Message = "Use LoadFriendPlayers instead and collect the friends from the invoked callback")]
[Export ("friends", ArgumentSemantic.Retain)]
@ -664,6 +699,7 @@ namespace XamCore.GameKit {
bool IsUnderage { get; }
[NoTV]
[NoWatch]
[Availability (Deprecated = Platform.iOS_6_0 | Platform.Mac_10_8, Message = "Set the AuthenticationHandler instead")]
[Export ("authenticateWithCompletionHandler:")]
[Async]
@ -679,6 +715,7 @@ namespace XamCore.GameKit {
void LoadRecentPlayers ([NullAllowed] Action<GKPlayer[], NSError> completionHandler);
[NoTV]
[NoWatch]
[Availability (Deprecated = Platform.iOS_8_0 | Platform.Mac_10_10, Message = "Use LoadRecentPlayers(..) instead")]
[Export ("loadFriendsWithCompletionHandler:")]
[Async]
@ -688,15 +725,16 @@ namespace XamCore.GameKit {
[Notification]
NSString AuthenticationDidChangeNotificationName { get; }
#if !MONOMAC
[iOS (6,0)]
[NullAllowed] // by default this property is null
[Export ("authenticateHandler", ArgumentSemantic.Copy)]
#if WATCH
[Watch (3,0)]
Action<NSError> AuthenticateHandler { get; set; }
#elif !MONOMAC
[iOS (6,0)]
Action<UIViewController, NSError> AuthenticateHandler { get; set; }
#else
[Mac (10,9)]
[NullAllowed] // by default this property is null
[Export ("authenticateHandler", ArgumentSemantic.Copy)]
Action<NSViewController, NSError> AuthenticateHandler { get; set; }
#endif
@ -711,6 +749,7 @@ namespace XamCore.GameKit {
void SetDefaultLeaderboardIdentifier (string leaderboardIdentifier, [NullAllowed] Action<NSError> completionHandler);
[NoTV]
[NoWatch]
[Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_10, Message = "Use LoadDefaultLeaderboardIdentifier(..) instead")]
[Since (6,0)]
[Export ("loadDefaultLeaderboardCategoryIDWithCompletionHandler:")]
@ -718,6 +757,7 @@ namespace XamCore.GameKit {
void LoadDefaultLeaderboardCategoryID ([NullAllowed] Action<string, NSError> completionHandler);
[NoTV]
[NoWatch]
[Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_10, Message = "Use SetDefaultLeaderboardIdentifier(..) instead")]
[iOS (6,0), Mac (10,8)]
[Export ("setDefaultLeaderboardCategoryID:completionHandler:")]
@ -745,24 +785,28 @@ namespace XamCore.GameKit {
[Export ("loadFriendPlayersWithCompletionHandler:")]
void LoadFriendPlayers ([NullAllowed] Action<GKPlayer [], NSError> completionHandler);
[NoWatch]
[NoTV]
[iOS (8,0)]
[Mac (10,10)]
[Export ("fetchSavedGamesWithCompletionHandler:")]
void FetchSavedGames ([NullAllowed] Action<GKSavedGame[], NSError> handler);
[NoWatch]
[NoTV]
[iOS (8,0)]
[Mac (10,10)]
[Export ("saveGameData:withName:completionHandler:")]
void SaveGameData (NSData data, string name, [NullAllowed] Action<GKSavedGame, NSError> handler);
[NoWatch]
[NoTV]
[iOS (8,0)]
[Mac (10,10)]
[Export ("deleteSavedGamesWithName:completionHandler:")]
void DeleteSavedGames (string name, [NullAllowed] Action<NSError> handler);
[NoWatch]
[NoTV]
[iOS (8,0)]
[Mac (10,10)]
@ -770,6 +814,7 @@ namespace XamCore.GameKit {
void ResolveConflictingSavedGames (GKSavedGame [] conflictingSavedGames, NSData data, [NullAllowed] Action<GKSavedGame[], NSError> handler);
}
[NoWatch]
[NoTV]
[iOS (8,0)]
[Mac (10,10)] // dyld: Symbol not found: _OBJC_CLASS_$_GKSavedGame in 10.9
@ -789,6 +834,7 @@ namespace XamCore.GameKit {
void LoadData ([NullAllowed] Action<NSData, NSError> handler);
}
[NoWatch]
[NoTV]
[Protocol, Model]
[BaseType (typeof (NSObject))]
@ -800,6 +846,7 @@ namespace XamCore.GameKit {
void HasConflictingSavedGames (GKPlayer player, GKSavedGame [] savedGames);
}
[NoWatch]
[Since (4,2)]
[BaseType (typeof (NSObject), Delegates=new string [] { "WeakDelegate" }, Events=new Type [] {typeof(GKMatchDelegate)})]
// Objective-C exception thrown. Name: NSInvalidArgumentException Reason: -[__NSCFDictionary setObject:forKey:]: attempt to insert nil value (key: 1500388194)
@ -863,6 +910,7 @@ namespace XamCore.GameKit {
bool SendData (NSData data, GKPlayer [] players, GKMatchSendDataMode mode, out NSError error);
}
[NoWatch]
[Since (4,2)]
[BaseType (typeof (NSObject))]
[Model]
@ -924,6 +972,7 @@ namespace XamCore.GameKit {
void DataReceivedForRecipient (GKMatch match, NSData data, GKPlayer recipient, GKPlayer player);
}
[NoWatch]
[Since (4,2)]
[BaseType (typeof (NSObject))]
interface GKVoiceChat {
@ -978,6 +1027,7 @@ namespace XamCore.GameKit {
void SetMuteStatus (GKPlayer player, bool isMuted);
}
[Watch (3,0)]
[BaseType (typeof (NSObject))]
interface GKMatchRequest {
[Export ("minPlayers", ArgumentSemantic.Assign)]
@ -993,6 +1043,7 @@ namespace XamCore.GameKit {
uint PlayerAttributes { get; set; } /* uint32_t */
[NoTV]
[NoWatch]
[NullAllowed] // by default this property is null
[Export ("playersToInvite", ArgumentSemantic.Retain)]
string [] PlayersToInvite { get; set; }
@ -1009,6 +1060,7 @@ namespace XamCore.GameKit {
#endif
[NoTV]
[NoWatch]
[Availability (Deprecated = Platform.iOS_8_0 | Platform.Mac_10_10, Message = "Use RecipientResponseHandler instead")]
[Since (6,0)]
[NullAllowed] // by default this property is null
@ -1031,6 +1083,7 @@ namespace XamCore.GameKit {
GKPlayer [] Recipients { get; set; }
}
[NoWatch]
[BaseType (typeof (NSObject))]
interface GKInvite {
@ -1055,6 +1108,7 @@ namespace XamCore.GameKit {
GKPlayer Sender { get; }
}
[NoWatch]
[BaseType (typeof (NSObject))]
interface GKMatchmaker {
[Static]
@ -1095,6 +1149,7 @@ namespace XamCore.GameKit {
void QueryActivity ([NullAllowed] GKQueryHandler completionHandler);
#if !MONOMAC
[NoWatch]
[Since (6,0)]
[Export ("matchForInvite:completionHandler:")]
[Async]
@ -1136,6 +1191,7 @@ namespace XamCore.GameKit {
void StartBrowsingForNearbyPlayers ([NullAllowed] Action<GKPlayer, bool> handler);
}
[NoWatch]
#if MONOMAC
[BaseType (typeof (NSViewController), Delegates=new string [] { "WeakMatchmakerDelegate" }, Events=new Type [] {typeof(GKMatchmakerViewControllerDelegate)})]
[Mac (10,8)]
@ -1192,6 +1248,7 @@ namespace XamCore.GameKit {
void SetHostedPlayerConnected (GKPlayer playerID, bool connected);
}
[NoWatch]
[BaseType (typeof (NSObject))]
[Model]
[Since (4,2)]
@ -1285,6 +1342,7 @@ namespace XamCore.GameKit {
[Export ("reportAchievementWithCompletionHandler:")]
[Async]
#if XAMCORE_2_0
[NoWatch]
[NoTV]
[Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_10, Message = "Use ReportAchievements (GKAchievement[] achievements, Action<NSError> completionHandler) instead")]
void ReportAchievement ([NullAllowed] Action<NSError> completionHandler);
@ -1297,6 +1355,7 @@ namespace XamCore.GameKit {
[Export ("showsCompletionBanner", ArgumentSemantic.Assign)]
bool ShowsCompletionBanner { get; set; }
[NoWatch]
[iOS (6,0), Mac (10,8)]
[Static]
[Export ("reportAchievements:withCompletionHandler:")]
@ -1308,12 +1367,14 @@ namespace XamCore.GameKit {
#endif
[NoTV]
[NoWatch]
[Availability (Deprecated = Platform.iOS_7_0 | Platform.Mac_10_10, Message = "Pass GKPlayers to ChallengeComposeController(GKPlayer[] players, string message, ...) and present the view controller instead")]
[iOS (6,0), Mac (10,8)]
[Export ("issueChallengeToPlayers:message:")]
void IssueChallengeToPlayers ([NullAllowed] string[] playerIDs, [NullAllowed] string message);
[NoTV]
[NoWatch]
[iOS (6,0), Mac (10,8)]
[Availability (Deprecated = Platform.iOS_8_0 | Platform.Mac_10_10, Message = "Pass GKPlayers to SelectChallengeablePlayers instead")]
[Export ("selectChallengeablePlayerIDs:withCompletionHandler:")]
@ -1335,6 +1396,7 @@ namespace XamCore.GameKit {
}
#endif
[NoWatch]
[iOS (7,0), Mac (10,10)]
[Export ("reportAchievements:withEligibleChallenges:withCompletionHandler:"), Static]
[Async]
@ -1355,18 +1417,20 @@ namespace XamCore.GameKit {
[Export ("challengeComposeControllerWithMessage:players:completionHandler:")]
NSViewController ChallengeComposeController ([NullAllowed] string message, GKPlayer [] players, [NullAllowed] GKChallengeComposeHandler completionHandler);
#else
[NoWatch]
[iOS (8,0)]
[Export ("challengeComposeControllerWithMessage:players:completionHandler:")]
UIViewController ChallengeComposeController ([NullAllowed] string message, GKPlayer [] players, [NullAllowed] GKChallengeComposeHandler completionHandler);
#endif
[NoWatch]
[iOS (8,0), Mac (10,10)]
[Async]
[Export ("selectChallengeablePlayers:withCompletionHandler:")]
void SelectChallengeablePlayers (GKPlayer [] players, [NullAllowed] Action<GKPlayer [], NSError> completionHandler);
#if !MONOMAC
[NoTV]
[NoTV][NoWatch]
[iOS (7,0)]
[Availability (Deprecated = Platform.iOS_8_0)]
[Export ("challengeComposeControllerWithPlayers:message:completionHandler:")]
@ -1400,6 +1464,7 @@ namespace XamCore.GameKit {
[Async]
void LoadAchievementDescriptions ([NullAllowed] GKAchievementDescriptionHandler handler);
[NoWatch]
[Export ("loadImageWithCompletionHandler:")]
[Async]
void LoadImage ([NullAllowed] GKImageLoadedHandler imageLoadedHandler);
@ -1421,10 +1486,12 @@ namespace XamCore.GameKit {
[Export ("image")]
UIImage Image { get; }
[NoWatch]
[Static]
[Export ("incompleteAchievementImage")]
UIImage IncompleteAchievementImage { get; }
[NoWatch]
[Static]
[Export ("placeholderCompletedAchievementImage")]
UIImage PlaceholderCompletedAchievementImage { get; }
@ -1439,6 +1506,7 @@ namespace XamCore.GameKit {
#endif
}
[NoWatch]
[NoTV]
[Availability (Introduced = Platform.iOS_4_1 | Platform.Mac_10_8, Deprecated = Platform.iOS_7_0 | Platform.Mac_10_10, Message = "Use GKGameCenterViewController instead")]
[BaseType (typeof (NSObject))]
@ -1453,7 +1521,7 @@ namespace XamCore.GameKit {
void DidFinish (GKAchievementViewController viewController);
}
[NoTV]
[NoTV][NoWatch]
[Availability (Introduced = Platform.iOS_4_1 | Platform.Mac_10_8, Deprecated = Platform.iOS_7_0 | Platform.Mac_10_10, Message = "Use GKGameCenterViewController instead")]
#if MONOMAC
[BaseType (typeof (GKGameCenterViewController), Events=new Type [] { typeof (GKAchievementViewControllerDelegate)}, Delegates=new string [] {"WeakDelegate"})]
@ -1492,6 +1560,7 @@ namespace XamCore.GameKit {
}
#endif
[NoWatch]
#if MONOMAC
[Mac (10,8)]
[Deprecated (PlatformName.MacOSX, 10, 12)]
@ -1535,6 +1604,7 @@ namespace XamCore.GameKit {
#endif
}
[NoWatch]
[NoTV]
[BaseType (typeof (NSObject))]
[Model]
@ -1547,6 +1617,7 @@ namespace XamCore.GameKit {
void DidFinish (GKFriendRequestComposeViewController viewController);
}
[NoWatch]
[Since (5,0)]
[BaseType(typeof(NSObject))]
public partial interface GKNotificationBanner {
@ -1831,6 +1902,7 @@ namespace XamCore.GameKit {
#endif
}
[NoWatch]
// iOS6 -> Objective-C exception thrown. Name: NSInvalidArgumentException Reason: <GKTurnBasedMatchmakerViewController: 0x18299df0>: must use one of the designated initializers
[DisableDefaultCtor]
#if MONOMAC
@ -1857,6 +1929,7 @@ namespace XamCore.GameKit {
GKTurnBasedMatchmakerViewControllerDelegate Delegate { get; set; }
}
[NoWatch]
[Since (5,0)]
[BaseType (typeof (NSObject))]
[Model]
@ -1887,6 +1960,7 @@ namespace XamCore.GameKit {
void PlayerQuitForMatch (GKTurnBasedMatchmakerViewController viewController, GKTurnBasedMatch match);
}
[NoWatch]
[Since (6,0)][Mavericks]
[BaseType (typeof (NSObject))]
interface GKChallenge : NSSecureCoding {
@ -1928,6 +2002,7 @@ namespace XamCore.GameKit {
GKPlayer ReceivingPlayer { get; }
}
[NoWatch]
[Since (6,0)][Mavericks]
[BaseType (typeof (GKChallenge))]
interface GKScoreChallenge {
@ -1936,6 +2011,7 @@ namespace XamCore.GameKit {
GKScore Score { get; }
}
[NoWatch]
[Since (6,0)][Mavericks]
[BaseType (typeof (GKChallenge))]
interface GKAchievementChallenge {
@ -1944,6 +2020,7 @@ namespace XamCore.GameKit {
GKAchievement Achievement { get; }
}
[NoWatch]
[Since (6,0), Mac (10,9)]
[BaseType (
#if MONOMAC
@ -1985,6 +2062,7 @@ namespace XamCore.GameKit {
string LeaderboardIdentifier { get; set; }
}
[NoWatch]
[Since (6,0)]
[Model]
[BaseType (typeof (NSObject))]
@ -1999,6 +2077,7 @@ namespace XamCore.GameKit {
}
#if !MONOMAC
[NoWatch]
[NoTV]
[Availability (Introduced = Platform.iOS_6_0 | Platform.Mac_10_8, Deprecated = Platform.iOS_7_0 | Platform.Mac_10_10, Message = "Implement the IGKChallengeListener interface and register a listener with GKLocalPlayer")]
[BaseType (typeof (NSObject), Events=new[] { typeof (GKChallengeEventHandlerDelegate) }, Delegates=new[] { "WeakDelegate"})]
@ -2017,6 +2096,7 @@ namespace XamCore.GameKit {
GKChallengeEventHandler Instance { get; }
}
[NoWatch]
[NoTV]
[Availability (Introduced = Platform.iOS_6_0 | Platform.Mac_10_8, Deprecated = Platform.iOS_7_0 | Platform.Mac_10_10, Message = "Implement the IGKChallengeListener interface and register a listener with GKLocalPlayer")]
[Model]
@ -2120,13 +2200,17 @@ namespace XamCore.GameKit {
[Since (7,0), Mac (10,10)]
[Model, Protocol, BaseType (typeof (NSObject))]
interface GKLocalPlayerListener : GKChallengeListener, GKInviteEventListener, GKTurnBasedEventListener
#if !TVOS
interface GKLocalPlayerListener : GKTurnBasedEventListener
#if !TVOS && !WATCH
, GKSavedGameListener
#endif
#if !WATCH
, GKChallengeListener, GKInviteEventListener
#endif
{
}
[NoWatch]
[Since (7,0), Mac (10,10)]
[Model, Protocol, BaseType (typeof (NSObject))]
interface GKChallengeListener
@ -2144,6 +2228,7 @@ namespace XamCore.GameKit {
void IssuedChallengeWasCompleted (GKPlayer player, GKChallenge challenge, GKPlayer friendPlayer);
}
[NoWatch]
[Since (7,0), Mac (10,10)]
[Protocol, Model, BaseType (typeof (NSObject))]
interface GKInviteEventListener
@ -2167,6 +2252,7 @@ namespace XamCore.GameKit {
[Model, Protocol, BaseType (typeof (NSObject))]
interface GKTurnBasedEventListener
{
[NoWatch]
[NoTV]
[Availability (Deprecated = Platform.iOS_8_0, Message = "Use DidRequestMatchWithOtherPlayers instead")]
[Export ("player:didRequestMatchWithPlayers:")]
@ -2187,6 +2273,7 @@ namespace XamCore.GameKit {
[Export ("player:receivedExchangeReplies:forCompletedExchange:forMatch:")]
void ReceivedExchangeReplies (GKPlayer player, GKTurnBasedExchangeReply[] replies, GKTurnBasedExchange exchange, GKTurnBasedMatch match);
[NoWatch]
[iOS (8,0)]
[Export ("player:didRequestMatchWithOtherPlayers:")]
void DidRequestMatchWithOtherPlayers (GKPlayer player, GKPlayer [] playersToInvite);
@ -2310,6 +2397,7 @@ namespace XamCore.GameKit {
}
#if !MONOMAC
[NoWatch]
[NoiOS][TV (10,0)]
[BaseType (typeof(UIViewController))]
interface GKGameSessionSharingViewController
@ -2330,6 +2418,7 @@ namespace XamCore.GameKit {
interface IGKGameSessionSharingViewControllerDelegate {}
[NoWatch]
[NoiOS][TV (10,0)]
[Protocol, Model]
[BaseType (typeof(NSObject))]

Просмотреть файл

@ -14,6 +14,92 @@
!missing-enum! NSTextWritingDirection not bound
# GameKit
## All members of the protocol sare not available on watchOS (but the protocols are not decorated)
!missing-protocol! GKChallengeListener not bound
!missing-protocol! GKInviteEventListener not bound
## types/members marked as deprecated in watchOS 2.0 (even if the framework was not available before 3.0)
## or deprecated well before that (and have alternatives). The last ones might be there but it seems better
## to avoid exposing them (since they might be removed later) as better API exists
!missing-type! GKSession not bound
!missing-protocol! GKSessionDelegate not bound
!missing-selector! GKSession::acceptConnectionFromPeer:error: not bound
!missing-selector! GKSession::cancelConnectToPeer: not bound
!missing-selector! GKSession::connectToPeer:withTimeout: not bound
!missing-selector! GKSession::delegate not bound
!missing-selector! GKSession::denyConnectionFromPeer: not bound
!missing-selector! GKSession::disconnectPeerFromAllPeers: not bound
!missing-selector! GKSession::disconnectTimeout not bound
!missing-selector! GKSession::displayName not bound
!missing-selector! GKSession::displayNameForPeer: not bound
!missing-selector! GKSession::initWithSessionID:displayName:sessionMode: not bound
!missing-selector! GKSession::isAvailable not bound
!missing-selector! GKSession::peerID not bound
!missing-selector! GKSession::peersWithConnectionState: not bound
!missing-selector! GKSession::sendData:toPeers:withDataMode:error: not bound
!missing-selector! GKSession::sendDataToAllPeers:withDataMode:error: not bound
!missing-selector! GKSession::sessionID not bound
!missing-selector! GKSession::sessionMode not bound
!missing-selector! GKSession::setAvailable: not bound
!missing-selector! GKSession::setDataReceiveHandler:withContext: not bound
!missing-selector! GKSession::setDelegate: not bound
!missing-selector! GKSession::setDisconnectTimeout: not bound
!missing-protocol-member! GKTurnBasedEventListener::player:didRequestMatchWithPlayers: not found
!missing-selector! GKAchievement::reportAchievementWithCompletionHandler: not bound
!missing-selector! GKLeaderboard::category not bound
!missing-selector! GKLeaderboard::initWithPlayerIDs: not bound
!missing-selector! GKLeaderboard::setCategory: not bound
!missing-selector! GKLocalPlayer::authenticateWithCompletionHandler: not bound
!missing-selector! GKLocalPlayer::friends not bound
!missing-selector! GKLocalPlayer::loadDefaultLeaderboardCategoryIDWithCompletionHandler: not bound
!missing-selector! GKLocalPlayer::loadFriendsWithCompletionHandler: not bound
!missing-selector! GKLocalPlayer::setDefaultLeaderboardCategoryID:completionHandler: not bound
!missing-selector! GKPlayer::isFriend not bound
!missing-selector! GKMatch::chooseBestHostPlayerWithCompletionHandler: not bound
!missing-selector! GKMatch::playerIDs not bound
!missing-selector! GKMatch::sendData:toPlayers:withDataMode:error: not bound
!missing-selector! GKMatchmaker::cancelInviteToPlayer: not bound
!missing-selector! GKMatchmaker::findPlayersForHostedMatchRequest:withCompletionHandler: not bound
!missing-selector! GKMatchmaker::inviteHandler not bound
!missing-selector! GKMatchmaker::setInviteHandler: not bound
!missing-selector! GKMatchmaker::startBrowsingForNearbyPlayersWithReachableHandler: not bound
!missing-selector! GKMatchRequest::inviteeResponseHandler not bound
!missing-selector! GKMatchRequest::playersToInvite not bound
!missing-selector! GKMatchRequest::setInviteeResponseHandler: not bound
!missing-selector! GKMatchRequest::setPlayersToInvite: not bound
!missing-selector! GKScore::category not bound
!missing-selector! GKScore::initWithCategory: not bound
!missing-selector! GKScore::initWithLeaderboardIdentifier:forPlayer: not bound
!missing-selector! GKScore::reportScoreWithCompletionHandler: not bound
!missing-selector! GKScore::setCategory: not bound
!missing-type! GKVoiceChatService not bound
!missing-protocol! GKVoiceChatClient not bound
!missing-selector! GKVoiceChat::playerIDs not bound
!missing-selector! GKVoiceChat::playerStateUpdateHandler not bound
!missing-selector! GKVoiceChat::setMute:forPlayer: not bound
!missing-selector! GKVoiceChat::setPlayerStateUpdateHandler: not bound
!missing-selector! GKVoiceChatService::acceptCallID:error: not bound
!missing-selector! GKVoiceChatService::client not bound
!missing-selector! GKVoiceChatService::denyCallID: not bound
!missing-selector! GKVoiceChatService::inputMeterLevel not bound
!missing-selector! GKVoiceChatService::isInputMeteringEnabled not bound
!missing-selector! GKVoiceChatService::isMicrophoneMuted not bound
!missing-selector! GKVoiceChatService::isOutputMeteringEnabled not bound
!missing-selector! GKVoiceChatService::outputMeterLevel not bound
!missing-selector! GKVoiceChatService::receivedData:fromParticipantID: not bound
!missing-selector! GKVoiceChatService::receivedRealTimeData:fromParticipantID: not bound
!missing-selector! GKVoiceChatService::remoteParticipantVolume not bound
!missing-selector! GKVoiceChatService::setClient: not bound
!missing-selector! GKVoiceChatService::setInputMeteringEnabled: not bound
!missing-selector! GKVoiceChatService::setMicrophoneMuted: not bound
!missing-selector! GKVoiceChatService::setOutputMeteringEnabled: not bound
!missing-selector! GKVoiceChatService::setRemoteParticipantVolume: not bound
!missing-selector! GKVoiceChatService::startVoiceChatWithParticipantID:error: not bound
!missing-selector! GKVoiceChatService::stopVoiceChatWithParticipantID: not bound
# UIKit
## Implemented in managed code

Просмотреть файл

@ -261,6 +261,7 @@ public class Frameworks : Dictionary <string, Framework>
{ "WatchConnectivity", "WatchConnectivity", 2 },
{ "WatchKit", "WatchKit", 2 },
{ "GameKit", "GameKit", 3 },
{ "UserNotifications", "UserNotifications", 3 },
};
}

Просмотреть файл

@ -1771,6 +1771,12 @@ namespace XamCore.Registrar {
#if !MONOMAC
if (IsSimulator)
return;
#endif
goto default;
case "GameKit":
#if !MONOMAC
if (IsSimulator && Driver.App.Platform == Xamarin.Utils.ApplePlatform.WatchOS)
return; // No headers provided for watchOS/simulator.
#endif
goto default;
case "WatchKit":