{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/react-native-code-push/pulls/comments/45234958","id":45234958,"diff_hunk":"@@ -126,72 +126,106 @@ function checkForUpdate() {\n  * releases, and displaying a standard confirmation UI to the end-user\n  * when an update is available.\n  */\n-function sync(options = {}) {  \n+function sync(options = {}, syncStatusChangeCallback, downloadProgressCallback) {  \n   var syncOptions = {\n-    descriptionPrefix: \" Description: \",\n-    appendReleaseDescription: false,\n     \n     ignoreFailedUpdates: true,\n-    \n-    mandatoryContinueButtonLabel: \"Continue\",\n-    mandatoryUpdateMessage: \"An update is available that must be installed.\",\n-    \n-    optionalIgnoreButtonLabel: \"Ignore\",\n-    optionalInstallButtonLabel: \"Install\",\n-    optionalUpdateMessage: \"An update is available. Would you like to install it?\",\n-    \n+    installMode: CodePush.InstallMode.ON_NEXT_RESTART,\n     rollbackTimeout: 0,\n-    \n-    updateTitle: \"Update available\",\n+    updateDialog: null,\n     \n     ...options \n   };\n-\n+  \n+  syncStatusChangeCallback = typeof syncStatusChangeCallback == \"function\"\n+    ? syncStatusChangeCallback\n+    : function(syncStatus) {\n+        switch(syncStatus) {\n+          case CodePush.SyncStatus.CHECKING_FOR_UPDATE:\n+            console.log(\"[CodePush] Checking for update.\");","path":"CodePush.ios.js","position":61,"original_position":61,"commit_id":"3570f40ffb9ed206857093fb13f95d90c0b8a6c6","original_commit_id":"3570f40ffb9ed206857093fb13f95d90c0b8a6c6","user":{"login":"dlebu","id":12283206,"avatar_url":"https://avatars.githubusercontent.com/u/12283206?v=3","gravatar_id":"","url":"https://api.github.com/users/dlebu","html_url":"https://github.com/dlebu","followers_url":"https://api.github.com/users/dlebu/followers","following_url":"https://api.github.com/users/dlebu/following{/other_user}","gists_url":"https://api.github.com/users/dlebu/gists{/gist_id}","starred_url":"https://api.github.com/users/dlebu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlebu/subscriptions","organizations_url":"https://api.github.com/users/dlebu/orgs","repos_url":"https://api.github.com/users/dlebu/repos","events_url":"https://api.github.com/users/dlebu/events{/privacy}","received_events_url":"https://api.github.com/users/dlebu/received_events","type":"User","site_admin":false},"body":"Having a separate method that handles logging will make it easier if we want to change the `[CodePush]` tag in the future.","created_at":"2015-11-18T17:59:03Z","updated_at":"2015-11-18T17:59:03Z","html_url":"https://github.com/Microsoft/react-native-code-push/pull/55#discussion_r45234958","pull_request_url":"https://api.github.com/repos/Microsoft/react-native-code-push/pulls/55","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/react-native-code-push/pulls/comments/45234958"},"html":{"href":"https://github.com/Microsoft/react-native-code-push/pull/55#discussion_r45234958"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/react-native-code-push/pulls/55"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/react-native-code-push/pulls/55","id":51038074,"html_url":"https://github.com/Microsoft/react-native-code-push/pull/55","diff_url":"https://github.com/Microsoft/react-native-code-push/pull/55.diff","patch_url":"https://github.com/Microsoft/react-native-code-push/pull/55.patch","issue_url":"https://api.github.com/repos/Microsoft/react-native-code-push/issues/55","number":55,"state":"open","locked":false,"title":"Updated sync","user":{"login":"geof90","id":8598682,"avatar_url":"https://avatars.githubusercontent.com/u/8598682?v=3","gravatar_id":"","url":"https://api.github.com/users/geof90","html_url":"https://github.com/geof90","followers_url":"https://api.github.com/users/geof90/followers","following_url":"https://api.github.com/users/geof90/following{/other_user}","gists_url":"https://api.github.com/users/geof90/gists{/gist_id}","starred_url":"https://api.github.com/users/geof90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geof90/subscriptions","organizations_url":"https://api.github.com/users/geof90/orgs","repos_url":"https://api.github.com/users/geof90/repos","events_url":"https://api.github.com/users/geof90/events{/privacy}","received_events_url":"https://api.github.com/users/geof90/received_events","type":"User","site_admin":false},"body":"Couple of big (breaking) changes in this PR:\r\n\r\n1. Sync now takes in two function parameters, syncStatusChangeCallback and downloadProgressCallback. These are called periodically during the sync process to report the current state the sync action is in.\r\n2. Sync options have changed\r\n  - It includes an option for controlling when the app should restart when the downloaded update has been installed.\r\n  - The original options for customizing the strings that show up in the dialog is now moved to a nested object parameter. If the object parameter value passed in is falsey, the dialog will not be displayed to the user at all (it will be a silent update where the download happens automatically).\r\n3. Renamed localPackage.**apply** to localPackage.**install**. The action of saving an updated package to the location where the app recognizes to contain the latest version of the app will now be called install instead of apply.\r\n\r\nUpdated the example app to use Sync and demonstrate its capabilities.\r\n\r\nUpdated the docs.\r\n\r\n![syncstatus](https://cloud.githubusercontent.com/assets/8598682/11231561/9ebd2a60-8d5e-11e5-81f9-f20de5403fb5.gif)\r\n","created_at":"2015-11-18T03:20:36Z","updated_at":"2015-11-18T17:59:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b7098d7049af2b1c64bab41826c7443581a2ed0a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/react-native-code-push/pulls/55/commits","review_comments_url":"https://api.github.com/repos/Microsoft/react-native-code-push/pulls/55/comments","review_comment_url":"https://api.github.com/repos/Microsoft/react-native-code-push/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/react-native-code-push/issues/55/comments","statuses_url":"https://api.github.com/repos/Microsoft/react-native-code-push/statuses/3570f40ffb9ed206857093fb13f95d90c0b8a6c6","head":{"label":"Microsoft:updated-sync","ref":"updated-sync","sha":"3570f40ffb9ed206857093fb13f95d90c0b8a6c6","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","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":36749153,"name":"react-native-code-push","full_name":"Microsoft/react-native-code-push","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","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/react-native-code-push","description":"React Native plugin for the CodePush service","fork":false,"url":"https://api.github.com/repos/Microsoft/react-native-code-push","forks_url":"https://api.github.com/repos/Microsoft/react-native-code-push/forks","keys_url":"https://api.github.com/repos/Microsoft/react-native-code-push/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/react-native-code-push/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/react-native-code-push/teams","hooks_url":"https://api.github.com/repos/Microsoft/react-native-code-push/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/react-native-code-push/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/react-native-code-push/events","assignees_url":"https://api.github.com/repos/Microsoft/react-native-code-push/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/react-native-code-push/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/react-native-code-push/tags","blobs_url":"https://api.github.com/repos/Microsoft/react-native-code-push/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/react-native-code-push/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/react-native-code-push/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/react-native-code-push/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/react-native-code-push/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/react-native-code-push/languages","stargazers_url":"https://api.github.com/repos/Microsoft/react-native-code-push/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/react-native-code-push/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/react-native-code-push/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/react-native-code-push/subscription","commits_url":"https://api.github.com/repos/Microsoft/react-native-code-push/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/react-native-code-push/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/react-native-code-push/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/react-native-code-push/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/react-native-code-push/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/react-native-code-push/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/react-native-code-push/merges","archive_url":"https://api.github.com/repos/Microsoft/react-native-code-push/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/react-native-code-push/downloads","issues_url":"https://api.github.com/repos/Microsoft/react-native-code-push/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/react-native-code-push/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/react-native-code-push/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/react-native-code-push/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/react-native-code-push/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/react-native-code-push/releases{/id}","created_at":"2015-06-02T17:19:20Z","updated_at":"2015-11-18T14:55:10Z","pushed_at":"2015-11-18T06:09:23Z","git_url":"git://github.com/Microsoft/react-native-code-push.git","ssh_url":"git@github.com:Microsoft/react-native-code-push.git","clone_url":"https://github.com/Microsoft/react-native-code-push.git","svn_url":"https://github.com/Microsoft/react-native-code-push","homepage":"http://microsoft.github.io/code-push","size":2537,"stargazers_count":182,"watchers_count":182,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":9,"forks":16,"open_issues":9,"watchers":182,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"ff891dba769f979a453759519ce9af0a5788d46f","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","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":36749153,"name":"react-native-code-push","full_name":"Microsoft/react-native-code-push","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","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/react-native-code-push","description":"React Native plugin for the CodePush service","fork":false,"url":"https://api.github.com/repos/Microsoft/react-native-code-push","forks_url":"https://api.github.com/repos/Microsoft/react-native-code-push/forks","keys_url":"https://api.github.com/repos/Microsoft/react-native-code-push/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/react-native-code-push/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/react-native-code-push/teams","hooks_url":"https://api.github.com/repos/Microsoft/react-native-code-push/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/react-native-code-push/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/react-native-code-push/events","assignees_url":"https://api.github.com/repos/Microsoft/react-native-code-push/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/react-native-code-push/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/react-native-code-push/tags","blobs_url":"https://api.github.com/repos/Microsoft/react-native-code-push/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/react-native-code-push/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/react-native-code-push/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/react-native-code-push/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/react-native-code-push/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/react-native-code-push/languages","stargazers_url":"https://api.github.com/repos/Microsoft/react-native-code-push/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/react-native-code-push/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/react-native-code-push/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/react-native-code-push/subscription","commits_url":"https://api.github.com/repos/Microsoft/react-native-code-push/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/react-native-code-push/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/react-native-code-push/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/react-native-code-push/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/react-native-code-push/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/react-native-code-push/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/react-native-code-push/merges","archive_url":"https://api.github.com/repos/Microsoft/react-native-code-push/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/react-native-code-push/downloads","issues_url":"https://api.github.com/repos/Microsoft/react-native-code-push/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/react-native-code-push/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/react-native-code-push/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/react-native-code-push/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/react-native-code-push/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/react-native-code-push/releases{/id}","created_at":"2015-06-02T17:19:20Z","updated_at":"2015-11-18T14:55:10Z","pushed_at":"2015-11-18T06:09:23Z","git_url":"git://github.com/Microsoft/react-native-code-push.git","ssh_url":"git@github.com:Microsoft/react-native-code-push.git","clone_url":"https://github.com/Microsoft/react-native-code-push.git","svn_url":"https://github.com/Microsoft/react-native-code-push","homepage":"http://microsoft.github.io/code-push","size":2537,"stargazers_count":182,"watchers_count":182,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":9,"forks":16,"open_issues":9,"watchers":182,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/react-native-code-push/pulls/55"},"html":{"href":"https://github.com/Microsoft/react-native-code-push/pull/55"},"issue":{"href":"https://api.github.com/repos/Microsoft/react-native-code-push/issues/55"},"comments":{"href":"https://api.github.com/repos/Microsoft/react-native-code-push/issues/55/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/react-native-code-push/pulls/55/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/react-native-code-push/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/react-native-code-push/pulls/55/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/react-native-code-push/statuses/3570f40ffb9ed206857093fb13f95d90c0b8a6c6"}}}}