I solved this using the latest version of ShareKit (0.2.1), which I downloaded from GitHut , but the same version is also available on getsharekit.com/install .
Then I added the “ShareKit” folder located in the “Classes”, dragging it into the Xcode project (as usual).
. sharings (FB, Twitter,...) "DefaultSHKConfigurator.m". (Btw.I DefaultSHKConfigurator, )
FB, :
- (NSString*)facebookAppId {
return @"..."; //app-id from facebook (create fb-app first, if not already done)
}
- (NSString*)facebookLocalAppId {
return @"";
}
: didFinishLaunchingWithOptions: , ShareKonfiguration.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
DefaultSHKConfigurator *configurator = [[DefaultSHKConfigurator alloc] init];
[SHKConfiguration sharedInstanceWithConfigurator:configurator];
[configurator release];
..
}
URL ( XCode 4.x , , "" → " URL" ) URL "fb + fb-app" ( "fb35486.." ).
FB , ,
- (void) openFBWithURL:(NSURL*) URL {
if (URL != nil) {
NSString* scheme = [URL scheme];
NSString* prefix = [NSString stringWithFormat:@"fb%@", SHKCONFIG(facebookAppId)];
if ([scheme hasPrefix:prefix]) {
[SHKFacebook handleOpenURL:URL];
}
}
}
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
[self openFBWithURL:url];
return YES;
}
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
[self openFBWithURL:url];
return YES;
}
.