Domanda

In Mele documentazione per Game Center che dice di usare questo codice per rilevare se Game Center è disponibile:

+ (BOOL) isGameCenterAvailable {
  Class gcClass = (NSClassFromString(@"GKLocalPlayer"));

  NSString *reqSysVer = @"4.1";
  NSString *currSysVer = [[UIDevice currentDevice] systemVersion];
  BOOL osVersionSupported = ([currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending);

  return (gcClass && osVersionSupported);
}

ma restituisce YES sul mio iPhone 3G che non dispone di Game Center. Chiunque là fuori che ha risolto questo?

È stato utile?

Soluzione 3

La risposta è che non si può. Apple ci vuole tentare di login per vedere se Game Center è lì. Strano, ma è così che è.

Altri suggerimenti

In realtà, è possibile verificare se l'applicazione può aprire uno dei GameCenter:. Schemi URL

BOOL canOpenGC = [[UIApplication sharedApplication] canOpenURL:[NSURL urlWithString:@"gamecenter:/me/account]];

Vedere questa risposta StackOverflow in materia

Non ho provato questo, ma provare a ottenere il giocatore Singleton locale:

if (![gcClass localPlayer]) {
    // then you havnt got game center support
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top