{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-magnet/magnet-client/pulls/comments/62364497","id":62364497,"diff_hunk":"@@ -0,0 +1,74 @@\n+//\n+//  RNMagnetWebView.swift\n+//  IosCustomComponents\n+//\n+//  Created by Wilson Page on 05/05/2016.\n+//  Copyright © 2016 Facebook. All rights reserved.\n+//\n+\n+import Foundation\n+\n+class MagnetWebView : UIWebView, UIWebViewDelegate {\n+  @objc var onMagnetWebViewLoaded: RCTDirectEventBlock?\n+  \n+  @objc var source: [String: String]? {\n+    didSet {\n+      print(\"source did set \\(source)\")\n+      guard source != nil else { return }\n+      if let html = source![\"html\"] {\n+        loadHtml(html, baseUrl: source![\"baseUrl\"])\n+      } else if let uri = source![\"uri\"] {\n+        loadUri(uri)\n+      }\n+    }\n+  }\n+\n+  @objc var scrollEnabled: Bool = false {\n+    didSet {\n+      setScrollable(scrollEnabled)\n+    }\n+  }\n+  \n+  override init(frame: CGRect) {\n+    super.init(frame: frame)\n+    setScrollable(scrollEnabled)\n+    self.delegate = self\n+  }\n+\n+  func setScrollable(value: Bool) {\n+    scrollView.scrollEnabled = value\n+  }\n+  \n+  func loadUri(uri: String) {\n+    print(\"load uri: \\(uri)\")\n+    guard let url = NSURL(string: uri) else { return }\n+    let request = NSURLRequest(URL: url)\n+    guard request.URL != self.request?.URL else { return }\n+    loadRequest(NSURLRequest(URL: url))\n+  }\n+  \n+  func loadHtml(html: String, baseUrl: String?) {\n+    NSLog(\"load html: \\(html) \\(baseUrl)\")\n+    let url = NSURL(string: baseUrl ?? \"about:blank\");\n+    loadHTMLString(html, baseURL: url)\n+  }\n+  \n+  func webViewDidFinishLoad(webview: UIWebView) {\n+    guard !webview.loading else { return }","path":"ios/RNMagnetWebView.swift","position":57,"original_position":57,"commit_id":"6d2d416c9f36d96810aafa973873a67a716bb8d4","original_commit_id":"337e5983510b8f6f42f0d7bc6f481d62ce04dd43","user":{"login":"wilsonpage","id":1020551,"avatar_url":"https://avatars.githubusercontent.com/u/1020551?v=3","gravatar_id":"","url":"https://api.github.com/users/wilsonpage","html_url":"https://github.com/wilsonpage","followers_url":"https://api.github.com/users/wilsonpage/followers","following_url":"https://api.github.com/users/wilsonpage/following{/other_user}","gists_url":"https://api.github.com/users/wilsonpage/gists{/gist_id}","starred_url":"https://api.github.com/users/wilsonpage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilsonpage/subscriptions","organizations_url":"https://api.github.com/users/wilsonpage/orgs","repos_url":"https://api.github.com/users/wilsonpage/repos","events_url":"https://api.github.com/users/wilsonpage/events{/privacy}","received_events_url":"https://api.github.com/users/wilsonpage/received_events","type":"User","site_admin":false},"body":"Yes, this callback fires multiple times in iOS. Perhaps when individual assets finish loading?","created_at":"2016-05-06T17:48:39Z","updated_at":"2016-05-06T17:48:39Z","html_url":"https://github.com/mozilla-magnet/magnet-client/pull/65#discussion_r62364497","pull_request_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/pulls/65","_links":{"self":{"href":"https://api.github.com/repos/mozilla-magnet/magnet-client/pulls/comments/62364497"},"html":{"href":"https://github.com/mozilla-magnet/magnet-client/pull/65#discussion_r62364497"},"pull_request":{"href":"https://api.github.com/repos/mozilla-magnet/magnet-client/pulls/65"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-magnet/magnet-client/pulls/65","id":68890862,"html_url":"https://github.com/mozilla-magnet/magnet-client/pull/65","diff_url":"https://github.com/mozilla-magnet/magnet-client/pull/65.diff","patch_url":"https://github.com/mozilla-magnet/magnet-client/pull/65.patch","issue_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/issues/65","number":65,"state":"open","locked":false,"title":"Implemented custom webview (android) (issue #48)","user":{"login":"wilsonpage","id":1020551,"avatar_url":"https://avatars.githubusercontent.com/u/1020551?v=3","gravatar_id":"","url":"https://api.github.com/users/wilsonpage","html_url":"https://github.com/wilsonpage","followers_url":"https://api.github.com/users/wilsonpage/followers","following_url":"https://api.github.com/users/wilsonpage/following{/other_user}","gists_url":"https://api.github.com/users/wilsonpage/gists{/gist_id}","starred_url":"https://api.github.com/users/wilsonpage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilsonpage/subscriptions","organizations_url":"https://api.github.com/users/wilsonpage/orgs","repos_url":"https://api.github.com/users/wilsonpage/repos","events_url":"https://api.github.com/users/wilsonpage/events{/privacy}","received_events_url":"https://api.github.com/users/wilsonpage/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-04T16:22:07Z","updated_at":"2016-05-06T17:48:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ccf15cbb7235a1a7b265c71bc48757928f8c6632","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/pulls/65/commits","review_comments_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/pulls/65/comments","review_comment_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/issues/65/comments","statuses_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/statuses/6d2d416c9f36d96810aafa973873a67a716bb8d4","head":{"label":"wilsonpage:48-variable-height","ref":"48-variable-height","sha":"6d2d416c9f36d96810aafa973873a67a716bb8d4","user":{"login":"wilsonpage","id":1020551,"avatar_url":"https://avatars.githubusercontent.com/u/1020551?v=3","gravatar_id":"","url":"https://api.github.com/users/wilsonpage","html_url":"https://github.com/wilsonpage","followers_url":"https://api.github.com/users/wilsonpage/followers","following_url":"https://api.github.com/users/wilsonpage/following{/other_user}","gists_url":"https://api.github.com/users/wilsonpage/gists{/gist_id}","starred_url":"https://api.github.com/users/wilsonpage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilsonpage/subscriptions","organizations_url":"https://api.github.com/users/wilsonpage/orgs","repos_url":"https://api.github.com/users/wilsonpage/repos","events_url":"https://api.github.com/users/wilsonpage/events{/privacy}","received_events_url":"https://api.github.com/users/wilsonpage/received_events","type":"User","site_admin":false},"repo":{"id":56323623,"name":"magnet","full_name":"wilsonpage/magnet","owner":{"login":"wilsonpage","id":1020551,"avatar_url":"https://avatars.githubusercontent.com/u/1020551?v=3","gravatar_id":"","url":"https://api.github.com/users/wilsonpage","html_url":"https://github.com/wilsonpage","followers_url":"https://api.github.com/users/wilsonpage/followers","following_url":"https://api.github.com/users/wilsonpage/following{/other_user}","gists_url":"https://api.github.com/users/wilsonpage/gists{/gist_id}","starred_url":"https://api.github.com/users/wilsonpage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilsonpage/subscriptions","organizations_url":"https://api.github.com/users/wilsonpage/orgs","repos_url":"https://api.github.com/users/wilsonpage/repos","events_url":"https://api.github.com/users/wilsonpage/events{/privacy}","received_events_url":"https://api.github.com/users/wilsonpage/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wilsonpage/magnet","description":"","fork":true,"url":"https://api.github.com/repos/wilsonpage/magnet","forks_url":"https://api.github.com/repos/wilsonpage/magnet/forks","keys_url":"https://api.github.com/repos/wilsonpage/magnet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wilsonpage/magnet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wilsonpage/magnet/teams","hooks_url":"https://api.github.com/repos/wilsonpage/magnet/hooks","issue_events_url":"https://api.github.com/repos/wilsonpage/magnet/issues/events{/number}","events_url":"https://api.github.com/repos/wilsonpage/magnet/events","assignees_url":"https://api.github.com/repos/wilsonpage/magnet/assignees{/user}","branches_url":"https://api.github.com/repos/wilsonpage/magnet/branches{/branch}","tags_url":"https://api.github.com/repos/wilsonpage/magnet/tags","blobs_url":"https://api.github.com/repos/wilsonpage/magnet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wilsonpage/magnet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wilsonpage/magnet/git/refs{/sha}","trees_url":"https://api.github.com/repos/wilsonpage/magnet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wilsonpage/magnet/statuses/{sha}","languages_url":"https://api.github.com/repos/wilsonpage/magnet/languages","stargazers_url":"https://api.github.com/repos/wilsonpage/magnet/stargazers","contributors_url":"https://api.github.com/repos/wilsonpage/magnet/contributors","subscribers_url":"https://api.github.com/repos/wilsonpage/magnet/subscribers","subscription_url":"https://api.github.com/repos/wilsonpage/magnet/subscription","commits_url":"https://api.github.com/repos/wilsonpage/magnet/commits{/sha}","git_commits_url":"https://api.github.com/repos/wilsonpage/magnet/git/commits{/sha}","comments_url":"https://api.github.com/repos/wilsonpage/magnet/comments{/number}","issue_comment_url":"https://api.github.com/repos/wilsonpage/magnet/issues/comments{/number}","contents_url":"https://api.github.com/repos/wilsonpage/magnet/contents/{+path}","compare_url":"https://api.github.com/repos/wilsonpage/magnet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wilsonpage/magnet/merges","archive_url":"https://api.github.com/repos/wilsonpage/magnet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wilsonpage/magnet/downloads","issues_url":"https://api.github.com/repos/wilsonpage/magnet/issues{/number}","pulls_url":"https://api.github.com/repos/wilsonpage/magnet/pulls{/number}","milestones_url":"https://api.github.com/repos/wilsonpage/magnet/milestones{/number}","notifications_url":"https://api.github.com/repos/wilsonpage/magnet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wilsonpage/magnet/labels{/name}","releases_url":"https://api.github.com/repos/wilsonpage/magnet/releases{/id}","deployments_url":"https://api.github.com/repos/wilsonpage/magnet/deployments","created_at":"2016-04-15T13:50:36Z","updated_at":"2016-04-15T13:50:37Z","pushed_at":"2016-05-06T17:44:11Z","git_url":"git://github.com/wilsonpage/magnet.git","ssh_url":"git@github.com:wilsonpage/magnet.git","clone_url":"https://github.com/wilsonpage/magnet.git","svn_url":"https://github.com/wilsonpage/magnet","homepage":null,"size":44057,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla-magnet:master","ref":"master","sha":"444f3717af93c1d57e3a7a02445b0720ca077e99","user":{"login":"mozilla-magnet","id":17905978,"avatar_url":"https://avatars.githubusercontent.com/u/17905978?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-magnet","html_url":"https://github.com/mozilla-magnet","followers_url":"https://api.github.com/users/mozilla-magnet/followers","following_url":"https://api.github.com/users/mozilla-magnet/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-magnet/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-magnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-magnet/subscriptions","organizations_url":"https://api.github.com/users/mozilla-magnet/orgs","repos_url":"https://api.github.com/users/mozilla-magnet/repos","events_url":"https://api.github.com/users/mozilla-magnet/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-magnet/received_events","type":"Organization","site_admin":false},"repo":{"id":50177593,"name":"magnet-client","full_name":"mozilla-magnet/magnet-client","owner":{"login":"mozilla-magnet","id":17905978,"avatar_url":"https://avatars.githubusercontent.com/u/17905978?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-magnet","html_url":"https://github.com/mozilla-magnet","followers_url":"https://api.github.com/users/mozilla-magnet/followers","following_url":"https://api.github.com/users/mozilla-magnet/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-magnet/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-magnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-magnet/subscriptions","organizations_url":"https://api.github.com/users/mozilla-magnet/orgs","repos_url":"https://api.github.com/users/mozilla-magnet/repos","events_url":"https://api.github.com/users/mozilla-magnet/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-magnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-magnet/magnet-client","description":"A nearby content discovery client for Android & iOS","fork":false,"url":"https://api.github.com/repos/mozilla-magnet/magnet-client","forks_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/forks","keys_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/teams","hooks_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/hooks","issue_events_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/events","assignees_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/tags","blobs_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/languages","stargazers_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/stargazers","contributors_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/contributors","subscribers_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/subscribers","subscription_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/subscription","commits_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/merges","archive_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/downloads","issues_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla-magnet/magnet-client/deployments","created_at":"2016-01-22T11:32:12Z","updated_at":"2016-05-04T11:39:48Z","pushed_at":"2016-05-06T17:44:12Z","git_url":"git://github.com/mozilla-magnet/magnet-client.git","ssh_url":"git@github.com:mozilla-magnet/magnet-client.git","clone_url":"https://github.com/mozilla-magnet/magnet-client.git","svn_url":"https://github.com/mozilla-magnet/magnet-client","homepage":"","size":44058,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":29,"forks":5,"open_issues":29,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-magnet/magnet-client/pulls/65"},"html":{"href":"https://github.com/mozilla-magnet/magnet-client/pull/65"},"issue":{"href":"https://api.github.com/repos/mozilla-magnet/magnet-client/issues/65"},"comments":{"href":"https://api.github.com/repos/mozilla-magnet/magnet-client/issues/65/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-magnet/magnet-client/pulls/65/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-magnet/magnet-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla-magnet/magnet-client/pulls/65/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-magnet/magnet-client/statuses/6d2d416c9f36d96810aafa973873a67a716bb8d4"}}}}