Skip to content

New service creator's guidelines

VilemKurz edited this page Dec 23, 2011 · 11 revisions

The new service should inherit as much functionality as possible from ShareKit's base classes. This is crucial for maintainability of the ShareKit:

  • SHKOAuthSharer for services using OAuth for authentication
  • SHKSharer for all other services

For creating a new service, please carefully follow the steps in original developer's guidelines. There is a lot of useful and still valid info - especially the templates with amazing comments, which can guide you easily through the implementation process. Here is a couple of further advices, which are specific to ShareKit 2.0:

  • before using a new UI string, please look at existing strings in localizable.strings. The english file is the definite list of strings used in ShareKit so far. If you decide to use existing string, there is no need to translate it, and your sharer is already localized in all supported languages. If you really need to add new strings, please add them to the end of english localizable.strings in new paragraph and comment what sharer they are for, so that it is easier for translators to find what's new to translate.

  • sometimes programmers need to show logged in usernames somewhere in the app. If the service uses OAuth for authentication, this info is not stored locally - we need to fetch it from the service after successful login. We introduced new SHKItem's shareType SHKShareTypeUserInfo. If your service uses OAuth, please implement it. Look at SHKTwitter, or SHKFacebook to get an idea.

  • ShareKit has a form (SHKFormController) used for editing the share content. This one is not ideal when you expect the user to write longer text message, but is suitable if the service requires some other settings such as tags, private settings etc. For sharers, which use only a text field you can choose alternative form (SHKFormControllerLargeTextField). Please see, how it is used in SHKTwitter and SHKFacebook.

  • The place to add app's API keys is primarily DefaultSHKConfigurator.m . Old Config.h way of configuring ShareKit is deprecated.

Clone this wiki locally