{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/pulls/comments/156149057","pull_request_review_id":82580318,"id":156149057,"diff_hunk":"@@ -93,14 +104,103 @@ export default class CrashesScreen extends Component {\n               Crash native code\n             </Text>\n           </TouchableOpacity>\n+          <TouchableOpacity onPress={() => { this.dialogComponent.show(); }}>\n+            <Text style={styles.button}>\n+              Set text error attachment\n+            </Text>\n+          </TouchableOpacity>\n+          <Text style={SharedStyles.enabledText}>{'Current value:'}{this.state.textAttachment}</Text>\n+          <TouchableOpacity onPress={this.showFilePicker}>\n+            <Text style={styles.button}>\n+              Select image as binary error attachment\n+            </Text>\n+          </TouchableOpacity>\n+          <Text style={SharedStyles.enabledText}>{'Current value:'}{this.state.binaryAttachment}</Text>\n           <Text style={styles.lastSessionHeader}>Last session:</Text>\n           <Text style={styles.lastSessionInfo}>\n             {this.state.lastSessionStatus}\n           </Text>\n         </ScrollView>\n+        {this.getTextAttachmentDialog()}\n       </View>\n     );\n   }\n+\n+  getTextAttachmentDialog() {\n+    return (\n+      <DialogComponent\n+        ref={(dialogComponent) => { this.dialogComponent = dialogComponent; }}\n+        width={0.9}\n+      >\n+        <View>\n+          <TextInput\n+            style={{\n+               height: 40, borderColor: 'gray', borderWidth: 1, margin: 8\n+              }}\n+            onChangeText={text => this.setState({ textAttachment: text })}\n+          />\n+          <View style={{ flex: 1, flexDirection: 'row', justifyContent: 'space-between' }}>\n+            <TouchableOpacity\n+              style={{ height: 50 }}\n+              onPress={() => {\n+                    AttachmentsProvider.saveTextAttachment(this.state.textAttachment);\n+                    this.dialogComponent.dismiss();\n+              }}\n+            >\n+              <Text style={styles.button}>\n+                Save\n+              </Text>\n+            </TouchableOpacity>\n+            <TouchableOpacity\n+              style={{ height: 50 }}\n+              onPress={() => { this.dialogComponent.dismiss(); }}\n+            >\n+              <Text style={styles.button}>\n+                Cancel\n+              </Text>\n+            </TouchableOpacity>\n+          </View>\n+        </View>\n+      </DialogComponent>\n+    );\n+  }\n+\n+  showFilePicker() {\n+    ImagePicker.showImagePicker(null, async (response) => {\n+      if (response.didCancel) {\n+        console.log('User cancelled image picker');\n+      } else if (response.error) {\n+        console.log('ImagePicker Error: ', response.error);\n+      } else {\n+        AttachmentsProvider.saveBinaryAttachment(getFileName(response), response.data, getFileType(response), getFileSize(response));\n+        const binaryAttachmentValue = await AttachmentsProvider.getBinaryAttachmentInfo();\n+        this.setState({ binaryAttachment: binaryAttachmentValue });\n+      }\n+    });\n+\n+    function getFileName(response) {\n+      return response.fileName != null ? response.fileName : 'binary.jpeg';","path":"TestApp/CrashesScreen.js","position":142,"original_position":142,"commit_id":"3ef07668937c4e79a7b3258fec45a57b54de8a5f","original_commit_id":"3ef07668937c4e79a7b3258fec45a57b54de8a5f","user":{"login":"dhei","id":4079255,"avatar_url":"https://avatars1.githubusercontent.com/u/4079255?v=4","gravatar_id":"","url":"https://api.github.com/users/dhei","html_url":"https://github.com/dhei","followers_url":"https://api.github.com/users/dhei/followers","following_url":"https://api.github.com/users/dhei/following{/other_user}","gists_url":"https://api.github.com/users/dhei/gists{/gist_id}","starred_url":"https://api.github.com/users/dhei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhei/subscriptions","organizations_url":"https://api.github.com/users/dhei/orgs","repos_url":"https://api.github.com/users/dhei/repos","events_url":"https://api.github.com/users/dhei/events{/privacy}","received_events_url":"https://api.github.com/users/dhei/received_events","type":"User","site_admin":false},"body":"use `!==` instead of `!=`.\r\n\r\n`fileName != null` will false when `fileName` is `null` or `undefined`.","created_at":"2017-12-11T17:54:38Z","updated_at":"2017-12-11T17:54:38Z","html_url":"https://github.com/Microsoft/AppCenter-SDK-React-Native/pull/179#discussion_r156149057","pull_request_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/pulls/179","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/pulls/comments/156149057"},"html":{"href":"https://github.com/Microsoft/AppCenter-SDK-React-Native/pull/179#discussion_r156149057"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/pulls/179"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/pulls/179","id":156463387,"html_url":"https://github.com/Microsoft/AppCenter-SDK-React-Native/pull/179","diff_url":"https://github.com/Microsoft/AppCenter-SDK-React-Native/pull/179.diff","patch_url":"https://github.com/Microsoft/AppCenter-SDK-React-Native/pull/179.patch","issue_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/issues/179","number":179,"state":"open","locked":false,"title":"Custom text and binary attachments in test apps","user":{"login":"bmourat","id":833045,"avatar_url":"https://avatars3.githubusercontent.com/u/833045?v=4","gravatar_id":"","url":"https://api.github.com/users/bmourat","html_url":"https://github.com/bmourat","followers_url":"https://api.github.com/users/bmourat/followers","following_url":"https://api.github.com/users/bmourat/following{/other_user}","gists_url":"https://api.github.com/users/bmourat/gists{/gist_id}","starred_url":"https://api.github.com/users/bmourat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmourat/subscriptions","organizations_url":"https://api.github.com/users/bmourat/orgs","repos_url":"https://api.github.com/users/bmourat/repos","events_url":"https://api.github.com/users/bmourat/events{/privacy}","received_events_url":"https://api.github.com/users/bmourat/received_events","type":"User","site_admin":false},"body":"Please do not merge this yet, as there are some changes that need to be discussed.\r\nThis PR adds support to set text and binary attachments to test app. There is one major change in Crashes module, I've made getErrorAttachments function async so we could wait for attachments to be read from disk. \r\n```\r\nasync getErrorAttachments(report)\r\n```\r\nThis caused this change in Crashes module:\r\n```\r\nfilteredReports.forEach(async (report) => {\r\n  const attachments = await getErrorAttachmentsMethod(report);\r\n  AppCenterReactNativeCrashes.sendErrorAttachments(attachments, report.id);\r\n});\r\n```\r\n\r\nIf this solution is ok, I'll change other test apps too.","created_at":"2017-12-05T13:32:28Z","updated_at":"2017-12-11T17:54:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bb9f2697cd829efc351d826874bb40bce38b04d5","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/pulls/179/commits","review_comments_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/pulls/179/comments","review_comment_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/issues/179/comments","statuses_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/statuses/3ef07668937c4e79a7b3258fec45a57b54de8a5f","head":{"label":"bmourat:text-binary-attachments-in-test-apps","ref":"text-binary-attachments-in-test-apps","sha":"3ef07668937c4e79a7b3258fec45a57b54de8a5f","user":{"login":"bmourat","id":833045,"avatar_url":"https://avatars3.githubusercontent.com/u/833045?v=4","gravatar_id":"","url":"https://api.github.com/users/bmourat","html_url":"https://github.com/bmourat","followers_url":"https://api.github.com/users/bmourat/followers","following_url":"https://api.github.com/users/bmourat/following{/other_user}","gists_url":"https://api.github.com/users/bmourat/gists{/gist_id}","starred_url":"https://api.github.com/users/bmourat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmourat/subscriptions","organizations_url":"https://api.github.com/users/bmourat/orgs","repos_url":"https://api.github.com/users/bmourat/repos","events_url":"https://api.github.com/users/bmourat/events{/privacy}","received_events_url":"https://api.github.com/users/bmourat/received_events","type":"User","site_admin":false},"repo":{"id":106538048,"name":"mobile-center-sdk-react-native","full_name":"bmourat/mobile-center-sdk-react-native","owner":{"login":"bmourat","id":833045,"avatar_url":"https://avatars3.githubusercontent.com/u/833045?v=4","gravatar_id":"","url":"https://api.github.com/users/bmourat","html_url":"https://github.com/bmourat","followers_url":"https://api.github.com/users/bmourat/followers","following_url":"https://api.github.com/users/bmourat/following{/other_user}","gists_url":"https://api.github.com/users/bmourat/gists{/gist_id}","starred_url":"https://api.github.com/users/bmourat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmourat/subscriptions","organizations_url":"https://api.github.com/users/bmourat/orgs","repos_url":"https://api.github.com/users/bmourat/repos","events_url":"https://api.github.com/users/bmourat/events{/privacy}","received_events_url":"https://api.github.com/users/bmourat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bmourat/mobile-center-sdk-react-native","description":"Development repository for the Mobile Center SDK for React Native","fork":true,"url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native","forks_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/forks","keys_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/teams","hooks_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/hooks","issue_events_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/issues/events{/number}","events_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/events","assignees_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/assignees{/user}","branches_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/branches{/branch}","tags_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/tags","blobs_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/statuses/{sha}","languages_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/languages","stargazers_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/stargazers","contributors_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/contributors","subscribers_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/subscribers","subscription_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/subscription","commits_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/contents/{+path}","compare_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/merges","archive_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/downloads","issues_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/issues{/number}","pulls_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/pulls{/number}","milestones_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/milestones{/number}","notifications_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/labels{/name}","releases_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/releases{/id}","deployments_url":"https://api.github.com/repos/bmourat/mobile-center-sdk-react-native/deployments","created_at":"2017-10-11T10:09:01Z","updated_at":"2017-10-11T10:09:04Z","pushed_at":"2017-12-11T08:42:31Z","git_url":"git://github.com/bmourat/mobile-center-sdk-react-native.git","ssh_url":"git@github.com:bmourat/mobile-center-sdk-react-native.git","clone_url":"https://github.com/bmourat/mobile-center-sdk-react-native.git","svn_url":"https://github.com/bmourat/mobile-center-sdk-react-native","homepage":"","size":76875,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"Microsoft:develop","ref":"develop","sha":"5ddfe7f70742b6a3c92577fd3e025554d686abf5","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":67550257,"name":"AppCenter-SDK-React-Native","full_name":"Microsoft/AppCenter-SDK-React-Native","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/AppCenter-SDK-React-Native","description":"Development repository for the App Center SDK for React Native","fork":false,"url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native","forks_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/forks","keys_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/teams","hooks_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/events","assignees_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/tags","blobs_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/languages","stargazers_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/subscription","commits_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/merges","archive_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/downloads","issues_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/deployments","created_at":"2016-09-06T22:04:57Z","updated_at":"2017-12-06T05:56:23Z","pushed_at":"2017-12-11T08:42:33Z","git_url":"git://github.com/Microsoft/AppCenter-SDK-React-Native.git","ssh_url":"git@github.com:Microsoft/AppCenter-SDK-React-Native.git","clone_url":"https://github.com/Microsoft/AppCenter-SDK-React-Native.git","svn_url":"https://github.com/Microsoft/AppCenter-SDK-React-Native","homepage":"","size":76866,"stargazers_count":77,"watchers_count":77,"language":"Objective-C","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":24,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":24,"open_issues":7,"watchers":77,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/pulls/179"},"html":{"href":"https://github.com/Microsoft/AppCenter-SDK-React-Native/pull/179"},"issue":{"href":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/issues/179"},"comments":{"href":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/issues/179/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/pulls/179/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/pulls/179/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/AppCenter-SDK-React-Native/statuses/3ef07668937c4e79a7b3258fec45a57b54de8a5f"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"dhei"}}