{"__v":29,"_id":"5433302067f20a080097a04d","category":{"__v":22,"_id":"542998547a6b690800768072","pages":["542a3de5e677b0080050898f","544e8298de6bac1000236fe9","542998547a6b690800768074","542ab90154d88d140075fbd4","5433300867f20a080097a04b","5433302067f20a080097a04d","544e7ae6de6bac1000236fb5","54330b4990d63b1c0030c129","543da24b31ca981a00a6ffe7","54333238a807e208003e72d2","544e8305bd51b9080037f9cb","54332b234aeeef0800410a73","5433306067f20a080097a051","543db19f31ca981a00a70053","543d31d6a10ab32000b3aa70","54a1f0af50465f1f00bfa3e8","54cfc5925ff7e617002bbda5","54f4f09158e9df0d00917b3e"],"project":"542998547a6b69080076806e","version":"542998547a6b690800768071","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-09-29T17:35:16.267Z","from_sync":false,"order":0,"slug":"getting-started","title":"Getting Started"},"is_link":false,"parentDoc":null,"project":"542998547a6b69080076806e","user":"542998207a6b690800768069","version":{"__v":9,"_id":"542998547a6b690800768071","project":"542998547a6b69080076806e","createdAt":"2014-09-29T17:35:16.249Z","releaseDate":"2014-09-29T17:35:16.249Z","categories":["542998547a6b690800768072","5433027990d63b1c0030c0f1","5433028190d63b1c0030c0f2","5433028d9a2b451a00ad4508","5433055790d63b1c0030c10a","5461417d37e5bc200049e1e4","54624066ddd31b0800a58db4","54625de66d1f1010002f3901","54d309955616470d0013cc55"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":["5449fe2327b7fc140078da3b","5449ffe5778b3e08002b226c","544a00ed778b3e08002b226e","544a01a0778b3e08002b226f","57d2e717db2574200016ac1d"],"next":{"pages":[],"description":""},"createdAt":"2014-10-07T00:13:20.135Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"basic_auth":false,"results":{"codes":[]},"try":true,"auth":"never","params":[],"url":""},"isReference":false,"order":5,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Create a Publisher Account\"\n}\n[/block]\nA Publisher Account is required to use your application, website or game with SuperRewards.\n\nIf you have not already done so, register for a Publisher Account at [pub.superrewards.com](https://pub.superrewards.com/signup).\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Our Unity Plugin\"\n}\n[/block]\nOur Unity plugin allows you to present an [offer wall](doc:basics-our-widgets-and-walls)  whenever it's appropriate in your game, receive notifications of user transactions, and more. Using the offer wall in your game involves three steps:\n\n1. [Install our SDK](#header-install)\n2. [Display the offer wall to a user](#header-display)\n3. [Get notified of new points available](#header-notification)\n\nThere are also notes below about how to:\n* [Test it out](#header-test)\n* [Get paid](#header-paid)\n* [Try it out in the demo app](#header-demo)\n[block:html]\n{\n  \"html\": \"<a name=\\\"header-install\\\"></a>\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"1. Install our SDK\"\n}\n[/block]\n* Download our Unity SDK here: [SuperRewards-1.0.2.unitypackage](http://files.superrewards.com/SDKs/unity/superrewards-1.0.2.unitypackage)\n* Open Unity, and then go to *Assets >> Import Package >> Custom Package*.  Unity will open a file browser.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/LxJwtMUlS6oTvGBeMxaZ_unity001.png\",\n        \"unity001.png\",\n        \"668\",\n        \"506\",\n        \"#31447e\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n* Navigate to the location where you saved our SDK file *SuperRewards-1.0.unitypackage*, and select it.\n* When prompted for *Items to Import*, make sure everything is selected and click *Import*\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/B9XKdCnlRbuVxpo3eNcF_unity002.png\",\n        \"unity002.png\",\n        \"750\",\n        \"643\",\n        \"#2f7136\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n* Once the import is completed, you will have a new *SuperRewards* folder in your *Assets->Standard Assets* folder.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/PU7Lx4AiQmOSMWBzVVA5_unity003.png\",\n        \"unity003.png\",\n        \"438\",\n        \"429\",\n        \"#b19e1b\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:html]\n{\n  \"html\": \"<a name=\\\"header-display\\\"></a>\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"2. Display the Offer Wall to a user\"\n}\n[/block]\nTo display the wall, first instantiate the SuperRewards object, then call ShowOfferWall():\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"SuperRewards.Initialize(\\n  <app hash>,\\n  <user ID>,\\n  <on user points changed callback>,\\n  <preload offers>\\n);\\n\\nSuperRewards.ShowOfferWall();\",\n      \"language\": \"javascript\",\n      \"name\": null\n    }\n  ]\n}\n[/block]\n* `app hash` here is the hash string of your app, which you can find in your [Dashboard](https://pub.superrewards.com/login).  For more info see [Foundation: Hashes and Keys](doc:foundation-app-hashes-keys-and-signing).\n* `user ID` field should be a unique ID for the user, either numeric or text. Check out our [Notes on UIDs](doc:notes-on-uids).\n* `on user points changed callback` is a callback function, where our SDK will notify you of new points earned by your user, more on that in the next section.\n* `preload offers` is boolean option to load the offers list before displaying it.  Defaults to `false`.\n[block:html]\n{\n  \"html\": \"<a name='header-notification'></a>\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"3. Get notified of transactions\"\n}\n[/block]\nComing soon: An example of the callback, and info on the fields and format.\n[block:html]\n{\n  \"html\": \"<a name='header-test'></a>\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"4. Test it out\"\n}\n[/block]\nComing soon: we will make it possible to fire notifications to your app, to test the full process.\n[block:html]\n{\n  \"html\": \"<a name='header-paid'></a>\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"5. Get paid\"\n}\n[/block]\nCheck your earnings in real-time in your [Dashboard](https://pub.superrewards.com).  We do payouts every two weeks, and our fees are the best around, check out the details in [Basics: Getting Paid](doc:basics-getting-paid).\n\n[block:html]\n{\n  \"html\": \"Enter your banking information in your <a href='https://pub.superrewards.com/account'>Dashboard</a>, or  <a class=\\\"btn btn-primary\\\" role=\\\"button\\\" href='https://pub.superrewards.com/signup'>Sign up</a>.\"\n}\n[/block]\n\n[block:html]\n{\n  \"html\": \"<a name='header-demo'></a>\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"6. Try it out in a demo app\"\n}\n[/block]\nThere is a demo application that shows the Super Rewards offer wall in the Assets folder under *Standard Assets → SuperRewards → Demo*:\n\nClick on the Demo Unity Icon and press the play button to launch the demo:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/DXvBpWxqSKeQNs7V1A4Z_unity004.png\",\n        \"unity004.png\",\n        \"800\",\n        \"719\",\n        \"#19552d\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"getting-started-unity","type":"basic","title":"Getting Started - Unity"}

Getting Started - Unity


[block:api-header] { "type": "basic", "title": "Create a Publisher Account" } [/block] A Publisher Account is required to use your application, website or game with SuperRewards. If you have not already done so, register for a Publisher Account at [pub.superrewards.com](https://pub.superrewards.com/signup). [block:api-header] { "type": "basic", "title": "Our Unity Plugin" } [/block] Our Unity plugin allows you to present an [offer wall](doc:basics-our-widgets-and-walls) whenever it's appropriate in your game, receive notifications of user transactions, and more. Using the offer wall in your game involves three steps: 1. [Install our SDK](#header-install) 2. [Display the offer wall to a user](#header-display) 3. [Get notified of new points available](#header-notification) There are also notes below about how to: * [Test it out](#header-test) * [Get paid](#header-paid) * [Try it out in the demo app](#header-demo) [block:html] { "html": "<a name=\"header-install\"></a>" } [/block] [block:api-header] { "type": "basic", "title": "1. Install our SDK" } [/block] * Download our Unity SDK here: [SuperRewards-1.0.2.unitypackage](http://files.superrewards.com/SDKs/unity/superrewards-1.0.2.unitypackage) * Open Unity, and then go to *Assets >> Import Package >> Custom Package*. Unity will open a file browser. [block:image] { "images": [ { "image": [ "https://files.readme.io/LxJwtMUlS6oTvGBeMxaZ_unity001.png", "unity001.png", "668", "506", "#31447e", "" ] } ] } [/block] * Navigate to the location where you saved our SDK file *SuperRewards-1.0.unitypackage*, and select it. * When prompted for *Items to Import*, make sure everything is selected and click *Import* [block:image] { "images": [ { "image": [ "https://files.readme.io/B9XKdCnlRbuVxpo3eNcF_unity002.png", "unity002.png", "750", "643", "#2f7136", "" ] } ] } [/block] * Once the import is completed, you will have a new *SuperRewards* folder in your *Assets->Standard Assets* folder. [block:image] { "images": [ { "image": [ "https://files.readme.io/PU7Lx4AiQmOSMWBzVVA5_unity003.png", "unity003.png", "438", "429", "#b19e1b", "" ] } ] } [/block] [block:html] { "html": "<a name=\"header-display\"></a>" } [/block] [block:api-header] { "type": "basic", "title": "2. Display the Offer Wall to a user" } [/block] To display the wall, first instantiate the SuperRewards object, then call ShowOfferWall(): [block:code] { "codes": [ { "code": "SuperRewards.Initialize(\n <app hash>,\n <user ID>,\n <on user points changed callback>,\n <preload offers>\n);\n\nSuperRewards.ShowOfferWall();", "language": "javascript", "name": null } ] } [/block] * `app hash` here is the hash string of your app, which you can find in your [Dashboard](https://pub.superrewards.com/login). For more info see [Foundation: Hashes and Keys](doc:foundation-app-hashes-keys-and-signing). * `user ID` field should be a unique ID for the user, either numeric or text. Check out our [Notes on UIDs](doc:notes-on-uids). * `on user points changed callback` is a callback function, where our SDK will notify you of new points earned by your user, more on that in the next section. * `preload offers` is boolean option to load the offers list before displaying it. Defaults to `false`. [block:html] { "html": "<a name='header-notification'></a>" } [/block] [block:api-header] { "type": "basic", "title": "3. Get notified of transactions" } [/block] Coming soon: An example of the callback, and info on the fields and format. [block:html] { "html": "<a name='header-test'></a>" } [/block] [block:api-header] { "type": "basic", "title": "4. Test it out" } [/block] Coming soon: we will make it possible to fire notifications to your app, to test the full process. [block:html] { "html": "<a name='header-paid'></a>" } [/block] [block:api-header] { "type": "basic", "title": "5. Get paid" } [/block] Check your earnings in real-time in your [Dashboard](https://pub.superrewards.com). We do payouts every two weeks, and our fees are the best around, check out the details in [Basics: Getting Paid](doc:basics-getting-paid). [block:html] { "html": "Enter your banking information in your <a href='https://pub.superrewards.com/account'>Dashboard</a>, or <a class=\"btn btn-primary\" role=\"button\" href='https://pub.superrewards.com/signup'>Sign up</a>." } [/block] [block:html] { "html": "<a name='header-demo'></a>" } [/block] [block:api-header] { "type": "basic", "title": "6. Try it out in a demo app" } [/block] There is a demo application that shows the Super Rewards offer wall in the Assets folder under *Standard Assets → SuperRewards → Demo*: Click on the Demo Unity Icon and press the play button to launch the demo: [block:image] { "images": [ { "image": [ "https://files.readme.io/DXvBpWxqSKeQNs7V1A4Z_unity004.png", "unity004.png", "800", "719", "#19552d", "" ] } ] } [/block]