{"action":"created","comment":{"url":"https://api.github.com/repos/infinitered/bluepotion/pulls/comments/36334489","id":36334489,"diff_hunk":"@@ -118,9 +118,42 @@ def alert(options={}, &block)\n     # Send user to native Texting\n     # app.sms(\"555-555-5555\")\n     def sms(phone_number)\n-      sms_intent = Android::Content::Intent.new(\"android.intent.action.VIEW\")\n-      sms_intent.setData(Android::Net::Uri.fromParts(\"sms\", phone_number.to_s, nil))\n-      find.activity.startActivity(sms_intent)\n+      mp \"[BP Deprecated] use app.launch(sms: #{phone_number}) over app.sms\"\n+      launch(sms: phone_number)\n+    end\n+\n+    # Launch native services via intent\n+    # app.launch(sms: '5045558008')\n+    # app.launch(web: 'http://giphy.com')\n+    # app.launch(email: 'your@mom.com')\n+    # app.launch(email: 'your@mom.com', subject: \"Hey Chica\", message: \"Howdy\")\n+    # app.launch(chooser: 'I hope you have a nice day!')\n+    def launch(command={})\n+      action_view = \"android.intent.action.VIEW\"\n+      action_send = \"android.intent.action.SEND\"\n+      launch_intent = case command.keys.first #TODO: fragile, re-evaluate\n+      when :sms\n+        sms_intent = Android::Content::Intent.new(action_view)\n+        sms_intent.setData(Android::Net::Uri.fromParts(\"sms\", command[:sms].to_s, nil))\n+      when :email\n+        email_intent = Android::Content::Intent.new(action_view)\n+        email_string = \"mailto:#{command[:email]}\"\n+        email_string += \"?subject=#{command[:subject].to_s}\"\n+        email_string += \"&body=#{command[:message].to_s}\"\n+        email_intent.setData(Android::Net::Uri.parse(email_string))\n+      when :web\n+        web_intent = Android::Content::Intent.new(action_view)\n+        web_intent.setData(Android::Net::Uri.parse(command[:web]))\n+      when :chooser\n+        message_intent = Android::Content::Intent.new(action_send)\n+        message_intent.type = \"text/plain\"\n+        message_intent.putExtra(\"android.intent.extra.TEXT\", command[:chooser].to_s) if command[:chooser]\n+        Android::Content::Intent.createChooser(message_intent, nil)\n+      else\n+        mp \"[BP Warning] Unsupported launch type '#{command.keys.first}'\"","path":"lib/project/pro_motion/pm_application.rb","position":39,"original_position":39,"commit_id":"d74c34ebd7f5452c31caeea3e13809d76b7bd640","original_commit_id":"d74c34ebd7f5452c31caeea3e13809d76b7bd640","user":{"login":"skellock","id":68273,"avatar_url":"https://avatars.githubusercontent.com/u/68273?v=3","gravatar_id":"","url":"https://api.github.com/users/skellock","html_url":"https://github.com/skellock","followers_url":"https://api.github.com/users/skellock/followers","following_url":"https://api.github.com/users/skellock/following{/other_user}","gists_url":"https://api.github.com/users/skellock/gists{/gist_id}","starred_url":"https://api.github.com/users/skellock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skellock/subscriptions","organizations_url":"https://api.github.com/users/skellock/orgs","repos_url":"https://api.github.com/users/skellock/repos","events_url":"https://api.github.com/users/skellock/events{/privacy}","received_events_url":"https://api.github.com/users/skellock/received_events","type":"User","site_admin":false},"body":"Havent tested, but `mp` might have a non-nil return value which would cause the `launch_intent` to get triggered.  Perhaps just putting a `nil` after this line would fix?","created_at":"2015-08-05T18:12:41Z","updated_at":"2015-08-05T18:12:41Z","html_url":"https://github.com/infinitered/bluepotion/pull/67#discussion_r36334489","pull_request_url":"https://api.github.com/repos/infinitered/bluepotion/pulls/67","_links":{"self":{"href":"https://api.github.com/repos/infinitered/bluepotion/pulls/comments/36334489"},"html":{"href":"https://github.com/infinitered/bluepotion/pull/67#discussion_r36334489"},"pull_request":{"href":"https://api.github.com/repos/infinitered/bluepotion/pulls/67"}}},"pull_request":{"url":"https://api.github.com/repos/infinitered/bluepotion/pulls/67","id":41707667,"html_url":"https://github.com/infinitered/bluepotion/pull/67","diff_url":"https://github.com/infinitered/bluepotion/pull/67.diff","patch_url":"https://github.com/infinitered/bluepotion/pull/67.patch","issue_url":"https://api.github.com/repos/infinitered/bluepotion/issues/67","number":67,"state":"open","locked":false,"title":"Launcher feature","user":{"login":"GantMan","id":997157,"avatar_url":"https://avatars.githubusercontent.com/u/997157?v=3","gravatar_id":"","url":"https://api.github.com/users/GantMan","html_url":"https://github.com/GantMan","followers_url":"https://api.github.com/users/GantMan/followers","following_url":"https://api.github.com/users/GantMan/following{/other_user}","gists_url":"https://api.github.com/users/GantMan/gists{/gist_id}","starred_url":"https://api.github.com/users/GantMan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GantMan/subscriptions","organizations_url":"https://api.github.com/users/GantMan/orgs","repos_url":"https://api.github.com/users/GantMan/repos","events_url":"https://api.github.com/users/GantMan/events{/privacy}","received_events_url":"https://api.github.com/users/GantMan/received_events","type":"User","site_admin":false},"body":"```ruby\r\n    # Launch native services via intent\r\n    app.launch(sms: '5045558008')\r\n    app.launch(web: 'http://giphy.com')\r\n    app.launch(email: 'your@mom.com')\r\n    app.launch(email: 'your@mom.com', subject: \"Hey Chica\", message: \"Howdy\")\r\n    app.launch(chooser: 'I hope you have a nice day!')\r\n```\r\n\r\ntakes care of request in issue #66 ","created_at":"2015-08-05T18:02:49Z","updated_at":"2015-08-05T18:12:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0b3e7558ac2dfa93646dd57aeedfd1ad1210c329","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/infinitered/bluepotion/pulls/67/commits","review_comments_url":"https://api.github.com/repos/infinitered/bluepotion/pulls/67/comments","review_comment_url":"https://api.github.com/repos/infinitered/bluepotion/pulls/comments{/number}","comments_url":"https://api.github.com/repos/infinitered/bluepotion/issues/67/comments","statuses_url":"https://api.github.com/repos/infinitered/bluepotion/statuses/d74c34ebd7f5452c31caeea3e13809d76b7bd640","head":{"label":"infinitered:launcher_feature","ref":"launcher_feature","sha":"d74c34ebd7f5452c31caeea3e13809d76b7bd640","user":{"login":"infinitered","id":3902527,"avatar_url":"https://avatars.githubusercontent.com/u/3902527?v=3","gravatar_id":"","url":"https://api.github.com/users/infinitered","html_url":"https://github.com/infinitered","followers_url":"https://api.github.com/users/infinitered/followers","following_url":"https://api.github.com/users/infinitered/following{/other_user}","gists_url":"https://api.github.com/users/infinitered/gists{/gist_id}","starred_url":"https://api.github.com/users/infinitered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infinitered/subscriptions","organizations_url":"https://api.github.com/users/infinitered/orgs","repos_url":"https://api.github.com/users/infinitered/repos","events_url":"https://api.github.com/users/infinitered/events{/privacy}","received_events_url":"https://api.github.com/users/infinitered/received_events","type":"Organization","site_admin":false},"repo":{"id":34918811,"name":"bluepotion","full_name":"infinitered/bluepotion","owner":{"login":"infinitered","id":3902527,"avatar_url":"https://avatars.githubusercontent.com/u/3902527?v=3","gravatar_id":"","url":"https://api.github.com/users/infinitered","html_url":"https://github.com/infinitered","followers_url":"https://api.github.com/users/infinitered/followers","following_url":"https://api.github.com/users/infinitered/following{/other_user}","gists_url":"https://api.github.com/users/infinitered/gists{/gist_id}","starred_url":"https://api.github.com/users/infinitered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infinitered/subscriptions","organizations_url":"https://api.github.com/users/infinitered/orgs","repos_url":"https://api.github.com/users/infinitered/repos","events_url":"https://api.github.com/users/infinitered/events{/privacy}","received_events_url":"https://api.github.com/users/infinitered/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/infinitered/bluepotion","description":"Like RedPotion, but for Android","fork":false,"url":"https://api.github.com/repos/infinitered/bluepotion","forks_url":"https://api.github.com/repos/infinitered/bluepotion/forks","keys_url":"https://api.github.com/repos/infinitered/bluepotion/keys{/key_id}","collaborators_url":"https://api.github.com/repos/infinitered/bluepotion/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/infinitered/bluepotion/teams","hooks_url":"https://api.github.com/repos/infinitered/bluepotion/hooks","issue_events_url":"https://api.github.com/repos/infinitered/bluepotion/issues/events{/number}","events_url":"https://api.github.com/repos/infinitered/bluepotion/events","assignees_url":"https://api.github.com/repos/infinitered/bluepotion/assignees{/user}","branches_url":"https://api.github.com/repos/infinitered/bluepotion/branches{/branch}","tags_url":"https://api.github.com/repos/infinitered/bluepotion/tags","blobs_url":"https://api.github.com/repos/infinitered/bluepotion/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/infinitered/bluepotion/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/infinitered/bluepotion/git/refs{/sha}","trees_url":"https://api.github.com/repos/infinitered/bluepotion/git/trees{/sha}","statuses_url":"https://api.github.com/repos/infinitered/bluepotion/statuses/{sha}","languages_url":"https://api.github.com/repos/infinitered/bluepotion/languages","stargazers_url":"https://api.github.com/repos/infinitered/bluepotion/stargazers","contributors_url":"https://api.github.com/repos/infinitered/bluepotion/contributors","subscribers_url":"https://api.github.com/repos/infinitered/bluepotion/subscribers","subscription_url":"https://api.github.com/repos/infinitered/bluepotion/subscription","commits_url":"https://api.github.com/repos/infinitered/bluepotion/commits{/sha}","git_commits_url":"https://api.github.com/repos/infinitered/bluepotion/git/commits{/sha}","comments_url":"https://api.github.com/repos/infinitered/bluepotion/comments{/number}","issue_comment_url":"https://api.github.com/repos/infinitered/bluepotion/issues/comments{/number}","contents_url":"https://api.github.com/repos/infinitered/bluepotion/contents/{+path}","compare_url":"https://api.github.com/repos/infinitered/bluepotion/compare/{base}...{head}","merges_url":"https://api.github.com/repos/infinitered/bluepotion/merges","archive_url":"https://api.github.com/repos/infinitered/bluepotion/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/infinitered/bluepotion/downloads","issues_url":"https://api.github.com/repos/infinitered/bluepotion/issues{/number}","pulls_url":"https://api.github.com/repos/infinitered/bluepotion/pulls{/number}","milestones_url":"https://api.github.com/repos/infinitered/bluepotion/milestones{/number}","notifications_url":"https://api.github.com/repos/infinitered/bluepotion/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/infinitered/bluepotion/labels{/name}","releases_url":"https://api.github.com/repos/infinitered/bluepotion/releases{/id}","created_at":"2015-05-01T19:02:32Z","updated_at":"2015-08-05T08:08:01Z","pushed_at":"2015-08-05T18:02:49Z","git_url":"git://github.com/infinitered/bluepotion.git","ssh_url":"git@github.com:infinitered/bluepotion.git","clone_url":"https://github.com/infinitered/bluepotion.git","svn_url":"https://github.com/infinitered/bluepotion","homepage":"","size":1248,"stargazers_count":33,"watchers_count":33,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":33,"default_branch":"master"}},"base":{"label":"infinitered:master","ref":"master","sha":"f769f323e0b9771522935b60b90c0dfde5189bb8","user":{"login":"infinitered","id":3902527,"avatar_url":"https://avatars.githubusercontent.com/u/3902527?v=3","gravatar_id":"","url":"https://api.github.com/users/infinitered","html_url":"https://github.com/infinitered","followers_url":"https://api.github.com/users/infinitered/followers","following_url":"https://api.github.com/users/infinitered/following{/other_user}","gists_url":"https://api.github.com/users/infinitered/gists{/gist_id}","starred_url":"https://api.github.com/users/infinitered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infinitered/subscriptions","organizations_url":"https://api.github.com/users/infinitered/orgs","repos_url":"https://api.github.com/users/infinitered/repos","events_url":"https://api.github.com/users/infinitered/events{/privacy}","received_events_url":"https://api.github.com/users/infinitered/received_events","type":"Organization","site_admin":false},"repo":{"id":34918811,"name":"bluepotion","full_name":"infinitered/bluepotion","owner":{"login":"infinitered","id":3902527,"avatar_url":"https://avatars.githubusercontent.com/u/3902527?v=3","gravatar_id":"","url":"https://api.github.com/users/infinitered","html_url":"https://github.com/infinitered","followers_url":"https://api.github.com/users/infinitered/followers","following_url":"https://api.github.com/users/infinitered/following{/other_user}","gists_url":"https://api.github.com/users/infinitered/gists{/gist_id}","starred_url":"https://api.github.com/users/infinitered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/infinitered/subscriptions","organizations_url":"https://api.github.com/users/infinitered/orgs","repos_url":"https://api.github.com/users/infinitered/repos","events_url":"https://api.github.com/users/infinitered/events{/privacy}","received_events_url":"https://api.github.com/users/infinitered/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/infinitered/bluepotion","description":"Like RedPotion, but for Android","fork":false,"url":"https://api.github.com/repos/infinitered/bluepotion","forks_url":"https://api.github.com/repos/infinitered/bluepotion/forks","keys_url":"https://api.github.com/repos/infinitered/bluepotion/keys{/key_id}","collaborators_url":"https://api.github.com/repos/infinitered/bluepotion/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/infinitered/bluepotion/teams","hooks_url":"https://api.github.com/repos/infinitered/bluepotion/hooks","issue_events_url":"https://api.github.com/repos/infinitered/bluepotion/issues/events{/number}","events_url":"https://api.github.com/repos/infinitered/bluepotion/events","assignees_url":"https://api.github.com/repos/infinitered/bluepotion/assignees{/user}","branches_url":"https://api.github.com/repos/infinitered/bluepotion/branches{/branch}","tags_url":"https://api.github.com/repos/infinitered/bluepotion/tags","blobs_url":"https://api.github.com/repos/infinitered/bluepotion/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/infinitered/bluepotion/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/infinitered/bluepotion/git/refs{/sha}","trees_url":"https://api.github.com/repos/infinitered/bluepotion/git/trees{/sha}","statuses_url":"https://api.github.com/repos/infinitered/bluepotion/statuses/{sha}","languages_url":"https://api.github.com/repos/infinitered/bluepotion/languages","stargazers_url":"https://api.github.com/repos/infinitered/bluepotion/stargazers","contributors_url":"https://api.github.com/repos/infinitered/bluepotion/contributors","subscribers_url":"https://api.github.com/repos/infinitered/bluepotion/subscribers","subscription_url":"https://api.github.com/repos/infinitered/bluepotion/subscription","commits_url":"https://api.github.com/repos/infinitered/bluepotion/commits{/sha}","git_commits_url":"https://api.github.com/repos/infinitered/bluepotion/git/commits{/sha}","comments_url":"https://api.github.com/repos/infinitered/bluepotion/comments{/number}","issue_comment_url":"https://api.github.com/repos/infinitered/bluepotion/issues/comments{/number}","contents_url":"https://api.github.com/repos/infinitered/bluepotion/contents/{+path}","compare_url":"https://api.github.com/repos/infinitered/bluepotion/compare/{base}...{head}","merges_url":"https://api.github.com/repos/infinitered/bluepotion/merges","archive_url":"https://api.github.com/repos/infinitered/bluepotion/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/infinitered/bluepotion/downloads","issues_url":"https://api.github.com/repos/infinitered/bluepotion/issues{/number}","pulls_url":"https://api.github.com/repos/infinitered/bluepotion/pulls{/number}","milestones_url":"https://api.github.com/repos/infinitered/bluepotion/milestones{/number}","notifications_url":"https://api.github.com/repos/infinitered/bluepotion/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/infinitered/bluepotion/labels{/name}","releases_url":"https://api.github.com/repos/infinitered/bluepotion/releases{/id}","created_at":"2015-05-01T19:02:32Z","updated_at":"2015-08-05T08:08:01Z","pushed_at":"2015-08-05T18:02:49Z","git_url":"git://github.com/infinitered/bluepotion.git","ssh_url":"git@github.com:infinitered/bluepotion.git","clone_url":"https://github.com/infinitered/bluepotion.git","svn_url":"https://github.com/infinitered/bluepotion","homepage":"","size":1248,"stargazers_count":33,"watchers_count":33,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":33,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/infinitered/bluepotion/pulls/67"},"html":{"href":"https://github.com/infinitered/bluepotion/pull/67"},"issue":{"href":"https://api.github.com/repos/infinitered/bluepotion/issues/67"},"comments":{"href":"https://api.github.com/repos/infinitered/bluepotion/issues/67/comments"},"review_comments":{"href":"https://api.github.com/repos/infinitered/bluepotion/pulls/67/comments"},"review_comment":{"href":"https://api.github.com/repos/infinitered/bluepotion/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/infinitered/bluepotion/pulls/67/commits"},"statuses":{"href":"https://api.github.com/repos/infinitered/bluepotion/statuses/d74c34ebd7f5452c31caeea3e13809d76b7bd640"}}}}