{"action":"created","comment":{"url":"https://api.github.com/repos/segmentio/analytics-android/pulls/comments/30621946","id":30621946,"diff_hunk":"@@ -0,0 +1,98 @@\n+package com.segment.analytics.internal.integrations;\n+\n+import com.segment.analytics.Analytics;\n+import com.segment.analytics.Traits;\n+import com.segment.analytics.ValueMap;\n+import com.segment.analytics.internal.AbstractIntegration;\n+import com.segment.analytics.internal.model.payloads.GroupPayload;\n+import com.segment.analytics.internal.model.payloads.IdentifyPayload;\n+import com.segment.analytics.internal.model.payloads.TrackPayload;\n+import com.taplytics.sdk.Taplytics;\n+import java.util.Map;\n+import java.util.Set;\n+import org.json.JSONException;\n+import org.json.JSONObject;\n+\n+import static com.segment.analytics.internal.Utils.isNullOrEmpty;\n+import static com.segment.analytics.internal.Utils.newSet;\n+\n+/**\n+ * Taplytics is a native mobile A/B testing platform that allows you to create new tests and push\n+ * them live without changing any code. Analytics, push notifications, and more.\n+ *\n+ * @see <a href=\"https://taplytics.com\">Taplytics</a>\n+ * @see <a href=\"https://segment.com/docs/integrations/taplytics\">Taplytics Integration</a>\n+ * @see <a href=\"https://github.com/taplytics/Taplytics-Android-SDK\">Taplytics Android SDK</a>\n+ */\n+public class TaplyticsIntegration extends AbstractIntegration<Taplytics> {\n+  static final String TAPLYTICS_KEY = \"Taplytics\";\n+\n+  private static final Set<String> KNOWN_TRAITS =\n+      newSet(\"name\", \"email\", \"gender\", \"firstName\", \"lastName\", \"age\");\n+\n+  @Override public void initialize(Analytics analytics, ValueMap settings)\n+      throws IllegalStateException {\n+    String apiKey = settings.getString(\"apiKey\");\n+    Taplytics.startTaplytics(analytics.getApplication(), apiKey);\n+  }\n+\n+  @Override public String key() {\n+    return TAPLYTICS_KEY;\n+  }\n+\n+  @Override public void track(TrackPayload track) {\n+    super.track(track);\n+    JSONObject metaData = track.properties().toJsonObject();\n+    Taplytics.logEvent(track.event(), track.properties().value(), metaData);","path":"analytics-integrations/taplytics/src/main/java/com/segment/analytics/internal/integrations/TaplyticsIntegration.java","position":46,"original_position":46,"commit_id":"513d623497960fe0162f25bddb17e415fb26c26c","original_commit_id":"513d623497960fe0162f25bddb17e415fb26c26c","user":{"login":"f2prateek","id":843979,"avatar_url":"https://avatars.githubusercontent.com/u/843979?v=3","gravatar_id":"","url":"https://api.github.com/users/f2prateek","html_url":"https://github.com/f2prateek","followers_url":"https://api.github.com/users/f2prateek/followers","following_url":"https://api.github.com/users/f2prateek/following{/other_user}","gists_url":"https://api.github.com/users/f2prateek/gists{/gist_id}","starred_url":"https://api.github.com/users/f2prateek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f2prateek/subscriptions","organizations_url":"https://api.github.com/users/f2prateek/orgs","repos_url":"https://api.github.com/users/f2prateek/repos","events_url":"https://api.github.com/users/f2prateek/events{/privacy}","received_events_url":"https://api.github.com/users/f2prateek/received_events","type":"User","site_admin":false},"body":"The method is an alias to `getDouble()`, if it isn't a number then it returns zero.","created_at":"2015-05-19T17:07:40Z","updated_at":"2015-05-19T17:07:40Z","html_url":"https://github.com/segmentio/analytics-android/pull/282#discussion_r30621946","pull_request_url":"https://api.github.com/repos/segmentio/analytics-android/pulls/282","_links":{"self":{"href":"https://api.github.com/repos/segmentio/analytics-android/pulls/comments/30621946"},"html":{"href":"https://github.com/segmentio/analytics-android/pull/282#discussion_r30621946"},"pull_request":{"href":"https://api.github.com/repos/segmentio/analytics-android/pulls/282"}}},"pull_request":{"url":"https://api.github.com/repos/segmentio/analytics-android/pulls/282","id":35687702,"html_url":"https://github.com/segmentio/analytics-android/pull/282","diff_url":"https://github.com/segmentio/analytics-android/pull/282.diff","patch_url":"https://github.com/segmentio/analytics-android/pull/282.patch","issue_url":"https://api.github.com/repos/segmentio/analytics-android/issues/282","number":282,"state":"open","locked":false,"title":"Add Taplytics Integration","user":{"login":"f2prateek","id":843979,"avatar_url":"https://avatars.githubusercontent.com/u/843979?v=3","gravatar_id":"","url":"https://api.github.com/users/f2prateek","html_url":"https://github.com/f2prateek","followers_url":"https://api.github.com/users/f2prateek/followers","following_url":"https://api.github.com/users/f2prateek/following{/other_user}","gists_url":"https://api.github.com/users/f2prateek/gists{/gist_id}","starred_url":"https://api.github.com/users/f2prateek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f2prateek/subscriptions","organizations_url":"https://api.github.com/users/f2prateek/orgs","repos_url":"https://api.github.com/users/f2prateek/repos","events_url":"https://api.github.com/users/f2prateek/events{/privacy}","received_events_url":"https://api.github.com/users/f2prateek/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-19T00:59:35Z","updated_at":"2015-05-19T17:07:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"22ecfcf51e790394dfe93858f2083b4a6073d3bf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/segmentio/analytics-android/pulls/282/commits","review_comments_url":"https://api.github.com/repos/segmentio/analytics-android/pulls/282/comments","review_comment_url":"https://api.github.com/repos/segmentio/analytics-android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/segmentio/analytics-android/issues/282/comments","statuses_url":"https://api.github.com/repos/segmentio/analytics-android/statuses/513d623497960fe0162f25bddb17e415fb26c26c","head":{"label":"segmentio:pr/281","ref":"pr/281","sha":"513d623497960fe0162f25bddb17e415fb26c26c","user":{"login":"segmentio","id":819518,"avatar_url":"https://avatars.githubusercontent.com/u/819518?v=3","gravatar_id":"","url":"https://api.github.com/users/segmentio","html_url":"https://github.com/segmentio","followers_url":"https://api.github.com/users/segmentio/followers","following_url":"https://api.github.com/users/segmentio/following{/other_user}","gists_url":"https://api.github.com/users/segmentio/gists{/gist_id}","starred_url":"https://api.github.com/users/segmentio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/segmentio/subscriptions","organizations_url":"https://api.github.com/users/segmentio/orgs","repos_url":"https://api.github.com/users/segmentio/repos","events_url":"https://api.github.com/users/segmentio/events{/privacy}","received_events_url":"https://api.github.com/users/segmentio/received_events","type":"Organization","site_admin":false},"repo":{"id":9185941,"name":"analytics-android","full_name":"segmentio/analytics-android","owner":{"login":"segmentio","id":819518,"avatar_url":"https://avatars.githubusercontent.com/u/819518?v=3","gravatar_id":"","url":"https://api.github.com/users/segmentio","html_url":"https://github.com/segmentio","followers_url":"https://api.github.com/users/segmentio/followers","following_url":"https://api.github.com/users/segmentio/following{/other_user}","gists_url":"https://api.github.com/users/segmentio/gists{/gist_id}","starred_url":"https://api.github.com/users/segmentio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/segmentio/subscriptions","organizations_url":"https://api.github.com/users/segmentio/orgs","repos_url":"https://api.github.com/users/segmentio/repos","events_url":"https://api.github.com/users/segmentio/events{/privacy}","received_events_url":"https://api.github.com/users/segmentio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/segmentio/analytics-android","description":"The hassle-free way to add analytics to your Android app.","fork":false,"url":"https://api.github.com/repos/segmentio/analytics-android","forks_url":"https://api.github.com/repos/segmentio/analytics-android/forks","keys_url":"https://api.github.com/repos/segmentio/analytics-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/segmentio/analytics-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/segmentio/analytics-android/teams","hooks_url":"https://api.github.com/repos/segmentio/analytics-android/hooks","issue_events_url":"https://api.github.com/repos/segmentio/analytics-android/issues/events{/number}","events_url":"https://api.github.com/repos/segmentio/analytics-android/events","assignees_url":"https://api.github.com/repos/segmentio/analytics-android/assignees{/user}","branches_url":"https://api.github.com/repos/segmentio/analytics-android/branches{/branch}","tags_url":"https://api.github.com/repos/segmentio/analytics-android/tags","blobs_url":"https://api.github.com/repos/segmentio/analytics-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/segmentio/analytics-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/segmentio/analytics-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/segmentio/analytics-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/segmentio/analytics-android/statuses/{sha}","languages_url":"https://api.github.com/repos/segmentio/analytics-android/languages","stargazers_url":"https://api.github.com/repos/segmentio/analytics-android/stargazers","contributors_url":"https://api.github.com/repos/segmentio/analytics-android/contributors","subscribers_url":"https://api.github.com/repos/segmentio/analytics-android/subscribers","subscription_url":"https://api.github.com/repos/segmentio/analytics-android/subscription","commits_url":"https://api.github.com/repos/segmentio/analytics-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/segmentio/analytics-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/segmentio/analytics-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/segmentio/analytics-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/segmentio/analytics-android/contents/{+path}","compare_url":"https://api.github.com/repos/segmentio/analytics-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/segmentio/analytics-android/merges","archive_url":"https://api.github.com/repos/segmentio/analytics-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/segmentio/analytics-android/downloads","issues_url":"https://api.github.com/repos/segmentio/analytics-android/issues{/number}","pulls_url":"https://api.github.com/repos/segmentio/analytics-android/pulls{/number}","milestones_url":"https://api.github.com/repos/segmentio/analytics-android/milestones{/number}","notifications_url":"https://api.github.com/repos/segmentio/analytics-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/segmentio/analytics-android/labels{/name}","releases_url":"https://api.github.com/repos/segmentio/analytics-android/releases{/id}","created_at":"2013-04-03T03:28:33Z","updated_at":"2015-05-07T01:00:41Z","pushed_at":"2015-05-19T01:00:08Z","git_url":"git://github.com/segmentio/analytics-android.git","ssh_url":"git@github.com:segmentio/analytics-android.git","clone_url":"https://github.com/segmentio/analytics-android.git","svn_url":"https://github.com/segmentio/analytics-android","homepage":"https://segment.com/docs/libraries/android/","size":40809,"stargazers_count":93,"watchers_count":93,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":50,"mirror_url":null,"open_issues_count":14,"forks":50,"open_issues":14,"watchers":93,"default_branch":"master"}},"base":{"label":"segmentio:master","ref":"master","sha":"78bac05c5a48f22707930d7aa43ea75f84ce4165","user":{"login":"segmentio","id":819518,"avatar_url":"https://avatars.githubusercontent.com/u/819518?v=3","gravatar_id":"","url":"https://api.github.com/users/segmentio","html_url":"https://github.com/segmentio","followers_url":"https://api.github.com/users/segmentio/followers","following_url":"https://api.github.com/users/segmentio/following{/other_user}","gists_url":"https://api.github.com/users/segmentio/gists{/gist_id}","starred_url":"https://api.github.com/users/segmentio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/segmentio/subscriptions","organizations_url":"https://api.github.com/users/segmentio/orgs","repos_url":"https://api.github.com/users/segmentio/repos","events_url":"https://api.github.com/users/segmentio/events{/privacy}","received_events_url":"https://api.github.com/users/segmentio/received_events","type":"Organization","site_admin":false},"repo":{"id":9185941,"name":"analytics-android","full_name":"segmentio/analytics-android","owner":{"login":"segmentio","id":819518,"avatar_url":"https://avatars.githubusercontent.com/u/819518?v=3","gravatar_id":"","url":"https://api.github.com/users/segmentio","html_url":"https://github.com/segmentio","followers_url":"https://api.github.com/users/segmentio/followers","following_url":"https://api.github.com/users/segmentio/following{/other_user}","gists_url":"https://api.github.com/users/segmentio/gists{/gist_id}","starred_url":"https://api.github.com/users/segmentio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/segmentio/subscriptions","organizations_url":"https://api.github.com/users/segmentio/orgs","repos_url":"https://api.github.com/users/segmentio/repos","events_url":"https://api.github.com/users/segmentio/events{/privacy}","received_events_url":"https://api.github.com/users/segmentio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/segmentio/analytics-android","description":"The hassle-free way to add analytics to your Android app.","fork":false,"url":"https://api.github.com/repos/segmentio/analytics-android","forks_url":"https://api.github.com/repos/segmentio/analytics-android/forks","keys_url":"https://api.github.com/repos/segmentio/analytics-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/segmentio/analytics-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/segmentio/analytics-android/teams","hooks_url":"https://api.github.com/repos/segmentio/analytics-android/hooks","issue_events_url":"https://api.github.com/repos/segmentio/analytics-android/issues/events{/number}","events_url":"https://api.github.com/repos/segmentio/analytics-android/events","assignees_url":"https://api.github.com/repos/segmentio/analytics-android/assignees{/user}","branches_url":"https://api.github.com/repos/segmentio/analytics-android/branches{/branch}","tags_url":"https://api.github.com/repos/segmentio/analytics-android/tags","blobs_url":"https://api.github.com/repos/segmentio/analytics-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/segmentio/analytics-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/segmentio/analytics-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/segmentio/analytics-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/segmentio/analytics-android/statuses/{sha}","languages_url":"https://api.github.com/repos/segmentio/analytics-android/languages","stargazers_url":"https://api.github.com/repos/segmentio/analytics-android/stargazers","contributors_url":"https://api.github.com/repos/segmentio/analytics-android/contributors","subscribers_url":"https://api.github.com/repos/segmentio/analytics-android/subscribers","subscription_url":"https://api.github.com/repos/segmentio/analytics-android/subscription","commits_url":"https://api.github.com/repos/segmentio/analytics-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/segmentio/analytics-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/segmentio/analytics-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/segmentio/analytics-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/segmentio/analytics-android/contents/{+path}","compare_url":"https://api.github.com/repos/segmentio/analytics-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/segmentio/analytics-android/merges","archive_url":"https://api.github.com/repos/segmentio/analytics-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/segmentio/analytics-android/downloads","issues_url":"https://api.github.com/repos/segmentio/analytics-android/issues{/number}","pulls_url":"https://api.github.com/repos/segmentio/analytics-android/pulls{/number}","milestones_url":"https://api.github.com/repos/segmentio/analytics-android/milestones{/number}","notifications_url":"https://api.github.com/repos/segmentio/analytics-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/segmentio/analytics-android/labels{/name}","releases_url":"https://api.github.com/repos/segmentio/analytics-android/releases{/id}","created_at":"2013-04-03T03:28:33Z","updated_at":"2015-05-07T01:00:41Z","pushed_at":"2015-05-19T01:00:08Z","git_url":"git://github.com/segmentio/analytics-android.git","ssh_url":"git@github.com:segmentio/analytics-android.git","clone_url":"https://github.com/segmentio/analytics-android.git","svn_url":"https://github.com/segmentio/analytics-android","homepage":"https://segment.com/docs/libraries/android/","size":40809,"stargazers_count":93,"watchers_count":93,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":50,"mirror_url":null,"open_issues_count":14,"forks":50,"open_issues":14,"watchers":93,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/segmentio/analytics-android/pulls/282"},"html":{"href":"https://github.com/segmentio/analytics-android/pull/282"},"issue":{"href":"https://api.github.com/repos/segmentio/analytics-android/issues/282"},"comments":{"href":"https://api.github.com/repos/segmentio/analytics-android/issues/282/comments"},"review_comments":{"href":"https://api.github.com/repos/segmentio/analytics-android/pulls/282/comments"},"review_comment":{"href":"https://api.github.com/repos/segmentio/analytics-android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/segmentio/analytics-android/pulls/282/commits"},"statuses":{"href":"https://api.github.com/repos/segmentio/analytics-android/statuses/513d623497960fe0162f25bddb17e415fb26c26c"}}}}