VilemKurz edited this page Nov 26, 2014 · 23 revisions


ShareKit needs a fair amount of configuration to ensure that it works correctly. The most basic configuration necessary consists of the name and URL of your app. The section that most impacts the sharing functionality of your app is the credentials for the various sharers. Additionally, the ShareKit interface (colors, transitions, etc) can be configured.

API Keys

Most of the web services that ShareKit integrates require you to use an API key when connecting. An API key is a unique identifer that tells the service what app is making the request.

You have to sign up for each api key, but they are all free and sign-ups are quick. Here are some links that might help you get through the process even quicker.

If you look at DefaultSHKConfigurator.m file, you will see instructions and links for each web service, which should help you to go through this smoothly.

Please, NEVER use credentials from the demo app!!! Always apply for your own.

Configuration Methods

ShareKit is intended to be incorporated as a submodule, and we moved configuration out of the ShareKit source code. This is a significant change, if you were used to configure it old SHKConfig.h way.

DefaultSHKConfigurator subclass configuration

To avoid the issue of modifying the ShareKit source code when configuring, you should create a DefaultSHKConfigurator subclass, and save it outside of ShareKit folder. DefaultSHKConfigurator is a configuration template, and provides empty (or default) implementations for all of the configuration methods. In your subclass, override the methods for which you have a custom configuration value.

Once your custom configurator has been written, ShareKit needs to be made aware of its existence. This should be done as early as possible in your application's lifecycle, preferably in the applicationDidFinishLaunching: method of your UIApplicationDelegate. The necessary line of code is (assuming your configuration delegate is called MySHKConfigurator):

DefaultSHKConfigurator *configurator = [[[MySHKConfigurator alloc] init] autorelease];
[SHKConfiguration sharedInstanceWithConfigurator:configurator];

Also include the header above

#import "SHKConfiguration.h"