iOS SDK hits 1.0
in Libraries -
Our iOS SDK has been available as a public beta for quite a while. We've gotten some great feedback from you guys, and I've been working hard over the last few weeks to fix all of the known bugs and layout issues. We're finally ready to make it 1.0!
At the same time we are announcing that the SDK now supports the iPad! Landscape mode on the iPhone is now ready to use as well.
In addition to polishing the SDK itself, we have released an example iOS app on GitHub showing how to use it. We think this will make it a lot easier for you to get everything set up correctly in XCode.
To get started, download the example project and pull down the SDK. Replace the demo URL with your own UserVoice site. Log into your UserVoice account and add an iOS app under Settings -> Channels -> iOS Apps. Copy the API key and secret into the example codebase. That should be all you need to do to see your own feedback forum in the example app.
To set up the SDK in your existing app, you will need to do the following things.
- Run XCode 4.2 (there is an XCode 3 branch, but it is not up to date)
- Have your project inside an XCode workspace
- Download the SDK and drag it into your workspace
- Add
libUserVoice.aunder theLink Binary With Librariesbuild phase - Set
User Heading Search Pathsto$(BUILD_PRODUCTS_DIR) - Set
Always Search User PathstoYes - Add
-ObjCand-all_loadto theOther Linker Flagssetting -
Drag the
Includegroup from the SDK into your projectCreate groups for any added subfoldersshould be selected- Uncheck any targets
- You may want to rename the group something like
UVHeaders
-
Drag the
Resourcesgroup from the SDK into your projectCreate groups for any added subfoldersshould be selected- Add to your target
- You may want to rename the group something like
UVResources
Once you have completed these steps, you are ready to launch the UserVoice UI
from your code. Import UserVoice.h and call one of the three methods on the
UserVoice class.
1. Standard Login: This is the most basic option, which will allow users to either sign in, or create a UserVoice account, from inside the UserVoice UI. This is ideal if your app does not have any information about the user.
[UserVoice presentUserVoiceModalViewControllerForParent:self
andSite:@"YOUR_USERVOICE_URL"
andKey:@"YOUR_KEY"
andSecret:@"YOUR_SECRET"];
2. SSO for local users: This will find or create a new user by passing a name, email, and unique id. However, it will only find users that were previously created using this method. It will not allow you to log the user in as an existing UserVoice account. This is ideal if you only want to use UserVoice with your iOS app.
[UserVoice presentUserVoiceModalViewControllerForParent:self
andSite:@"YOUR_USERVOICE_URL"
andKey:@"YOUR_KEY"
andSecret:@"YOUR_SECRET"
andEmail:@"USER_EMAIL"
andDisplayName:@"USER_DISPLAY_NAME"
andGUID:@"GUID"];
3. UserVoice SSO: This is the most flexible option. It allows you to log the user in using a UserVoice SSO token. This is ideal if you are planning to use single signon with UserVoice across multiple platforms. We recommend you encrypt the token on your servers and pass it to the iOS app.
[UserVoice presentUserVoiceModalViewControllerForParent:self
andSite:@"YOUR_USERVOICE_URL"
andKey:@"YOUR_KEY"
andSecret:@"YOUR_SECRET",
andSSOToken:@"SOME_BIG_LONG_SSO_TOKEN"];
We can't wait to see what you guys do with this! As always, we are eager to hear your feedback on the iOS SDK feedback forum.
-Austin Taylor
Developer, UserVoice