{"id":21820318,"url":"https://github.com/trademe/ioswrapper","last_synced_at":"2025-04-14T02:44:34.298Z","repository":{"id":148328055,"uuid":"10370259","full_name":"TradeMe/iOSWrapper","owner":"TradeMe","description":"Official Trade Me API for iOS","archived":false,"fork":false,"pushed_at":"2017-05-08T21:58:49.000Z","size":4049,"stargazers_count":9,"open_issues_count":1,"forks_count":2,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-03-27T16:49:52.163Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TradeMe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-05-29T21:55:46.000Z","updated_at":"2021-02-11T23:00:24.000Z","dependencies_parsed_at":"2023-05-19T19:45:40.095Z","dependency_job_id":null,"html_url":"https://github.com/TradeMe/iOSWrapper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TradeMe%2FiOSWrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TradeMe%2FiOSWrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TradeMe%2FiOSWrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TradeMe%2FiOSWrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TradeMe","download_url":"https://codeload.github.com/TradeMe/iOSWrapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248812786,"owners_count":21165482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-27T16:31:27.491Z","updated_at":"2025-04-14T02:44:34.285Z","avatar_url":"https://github.com/TradeMe.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Trade Me API Wrapper\n====================\n\nThe Trade Me API Wrapper is an iOS wrapper around the online Trade Me API located at [http://developer.trademe.co.nz](http://developer.trademe.co.nz)\n\nThis guide is intended to get you started with the API Wrapper in your own project.\n\nWe have also included a sample application that shows how to implement OAuth authentication when consuming the Trade Me API.\n\nThis guide consists of two parts:\n\n* Installing the API Wrapper\n* Running the Sample Application\n\nInstallation\n------------\n\u003e *NOTE*: These instructions assume you are using XCode 4\n\n### Register an application to use with the API\n\n\u003e *NOTE*: While developing and testing your app it is advisable to use Trade Me's sandbox site located at [http://www.tmsandbox.co.nz](http://www.tmsandbox.co.nz)\n\nPoint your browser at [http://www.trademe.co.nz](http://www.trademe.co.nz)\n\nLog in to your Trade Me account and navigate to your [My Trade Me page](http://www.trademe.co.nz/MyTradeMe/Default.aspx).\n\n![My Trade Me](readme_images/mtm.png)\n\nUnder the *More options* section, click on the [My applications link](http://www.trademe.co.nz/MyTradeMe/Api/MyApplications.aspx). This will show a list of all the applications you have allowed to access your account.\n\n![More options](readme_images/more_options.png)\n\nClick the [Developer options](http://www.trademe.co.nz/MyTradeMe/Api/DeveloperOptions.aspx) link at the bottom. If you have registered any applications to use with the API, this is where they will be shown.\n\n![Developer options](readme_images/developer_options.png)\n\nClick the [Register a new application](http://www.trademe.co.nz/MyTradeMe/Api/RegisterNewApplication.aspx) link at the bottom.\n\n![Register application](readme_images/register_application.png)\n\nFill out the details for your application. Under the *Application Type* section select *Browser* and set a custom URL callback. This can be used from within your app to determine when the OAuth login process has finished. See the included sample app for details on how to do this.\n\n![Application details](readme_images/application_details.png)\n\nTrade Me has an internal approval process for all API consumers. Once your application has been approved, when you return to the *Developer options* page, you will see your application in the list along with the *Consumer key* and *Consumer secret* required to make API calls with your application.\n\n![Consumer key](readme_images/consumer_key.png)\n\n### Add AFNetworking and SSKeychain to your project\n\nPrior to using the API Wrapper, both AFNetworking (v 1.1.0) and SSKeychain (v 0.1.4) need to be added to your project.\n\nAFNetworking can be downloaded from\n[https://github.com/AFNetworking/AFNetworking/tree/1.1.0](https://github.com/AFNetworking/AFNetworking/tree/1.1.0).\n\nThe installation instructions can be found at\n[https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking](https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking)\n\nSSKeychain and the installation instructions are available at [https://github.com/soffes/sskeychain/tree/0.1.4](https://github.com/soffes/sskeychain/tree/0.1.4)\n\n### Add the API Wrapper library files to your project\n\nOpen your XCode project.\n\nClick 'File -\u003e Add Files to \"...\"'. An add files dialog will be presented. Navigate to where you have downloaded the API Wrapper.\n\nSelect the *TMEClient* directory that contains the *headers* directory and the *libTMEClient.a* file.\n\nMake sure the following options are selected before clicking *Add*:\n\n+ *Destination* Copy items into destination group's folder (if needed) [Checked]\n+ *Folders* Create groups for any added folders [Selected]\n+ *Add to Targets* The application targets you wish to use with the API wrapper\n\n![Add to project](readme_images/add_to_project.png)\n\nImport the TMAPI.h header file wherever you want to use the Wrapper (or add it to your '.pch' to have access throughout your project):\n\n\t    #import \"TMEAPI.h\"\n\nIn your App Delegate's application:didFinishLaunchingWithOptions: method (or a single place before you start using other API wrapper methods) add the following line.\n\n\t[[TMEClient sharedInstance] setConsumerKey:@\"CONSUMER KEY GOES HERE\" consumerSecret:@\"CONSUMER SECRET GOES HERE\"];\n\n\u003e The Consumer Key and Secret can be obtained by following the instructions in the *Register an application to use with the API* section.\n\nThe iOS Wrapper API endpoint can be configured in the *TMEClient.h* file by changing the following line:\n\n\t#define TMEClientBaseURL    @\"https://api.trademe.co.nz\"\n\nThis can be useful if you want to point the API wrapper at the Trade Me sandbox environment located at [http://api.tmsandbox.co.nz](http://api.tmsandbox.co.nz)\n\nThe Sample Application\n----------------------\n\n\u003e The Sample Application requires AFNetworking (v 1.1.0) and SSKeychain (v 0.1.4) to be added to the project before compiling.\n\nThe Sample Application shows how to implement OAuth authentication when using the API Wrapper. It also demonstrates how to make a single API call to fetch the currently authenticated member's details.\n\nBefore using the Sample Application, you must follow the steps in the *Add the API Wrapper library files to your project* section.\n\nOnce you have added the API Wrapper library, the *Consumer Key* and *Consumer Secret* must be set in the *TMEAppDelegate.m* file:\n\n\t#define TMEConsumerKey    @\"CONSUMER KEY\"\n\t#define TMEConsumerSecret @\"CONSUMER SECRET\"\n\nThe callback URL configured in the first step (when registering your app) must also be set in the *TMEOAuthViewController.m* file:\n\n\t#define TMECallbackURL    @\"CALLBACK URL\"\n\nLastly, the *TMEAPI.h* file needs to be imported in the *TradeMeAPIClientSample-Prefix.pch* file by adding the following line:\n\n    #import \"TMEAPI.h\"\n\nContact\n-------\n\nFor any questions regarding the API, please visit our developer website at [http://developer.trademe.co.nz/](http://developer.trademe.co.nz/)\n\nor find us on Twitter at [https://twitter.com/TradeMe_Mobile](https://twitter.com/TradeMe_Mobile)\n\nLicense\n-------\n\nThe MIT License (MIT)\nCopyright © 2013 Trade Me Ltd [http://www.trademe.co.nz](http://www.trademe.co.nz)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nYou agree that this licence and your use of this Software is subject to the laws of New Zealand, that New Zealand law will apply to any dispute arising from your use of this Software, and you agree to the non-exclusive jurisdiction of the New Zealand courts to hear any such dispute.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrademe%2Fioswrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrademe%2Fioswrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrademe%2Fioswrapper/lists"}