{"action":"opened","issue":{"url":"https://api.github.com/repos/TobiasHennig/nativescript-toast/issues/2","labels_url":"https://api.github.com/repos/TobiasHennig/nativescript-toast/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/TobiasHennig/nativescript-toast/issues/2/comments","events_url":"https://api.github.com/repos/TobiasHennig/nativescript-toast/issues/2/events","html_url":"https://github.com/TobiasHennig/nativescript-toast/issues/2","id":98457429,"number":2,"title":"iOS Version","user":{"login":"TobiasHennig","id":3656893,"avatar_url":"https://avatars.githubusercontent.com/u/3656893?v=3","gravatar_id":"","url":"https://api.github.com/users/TobiasHennig","html_url":"https://github.com/TobiasHennig","followers_url":"https://api.github.com/users/TobiasHennig/followers","following_url":"https://api.github.com/users/TobiasHennig/following{/other_user}","gists_url":"https://api.github.com/users/TobiasHennig/gists{/gist_id}","starred_url":"https://api.github.com/users/TobiasHennig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TobiasHennig/subscriptions","organizations_url":"https://api.github.com/users/TobiasHennig/orgs","repos_url":"https://api.github.com/users/TobiasHennig/repos","events_url":"https://api.github.com/users/TobiasHennig/events{/privacy}","received_events_url":"https://api.github.com/users/TobiasHennig/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-31T19:38:16Z","updated_at":"2015-07-31T19:38:16Z","closed_at":null,"body":"There are obviously no Toasts on iOS. To prevent us from `Failed to find module 'nativescript-toast'` errors it is easy to wrap everything in statement:\r\n\r\n```js\r\nvar applicationModule = require(\"application\");\r\nif (applicationModule.android) {\r\n    var Toast = require(\"nativescript-toast\");\r\n}\r\n\r\n// ...\r\n\r\nif (applicationModule.android) {\r\n    Toast.makeText(\"Hello World\").show();\r\n}\r\n```\r\n\r\nbut i think that's a lot of extra code.\r\n\r\nAnother possibility could be an additional iOS module which `console.log()` everything instead of a Toast. No need to wrap everything.\r\n\r\n... I think I add the iOS module, so everyone can choose between the two solutions."}}