{"action":"created","issue":{"url":"https://api.github.com/repos/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/issues/133","repository_url":"https://api.github.com/repos/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK","labels_url":"https://api.github.com/repos/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/issues/133/labels{/name}","comments_url":"https://api.github.com/repos/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/issues/133/comments","events_url":"https://api.github.com/repos/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/issues/133/events","html_url":"https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/issues/133","id":151611139,"number":133,"title":"Multiple serious errors in JSON Data causing exception and ambiguity in processing","user":{"login":"barocsi","id":851560,"avatar_url":"https://avatars.githubusercontent.com/u/851560?v=3","gravatar_id":"","url":"https://api.github.com/users/barocsi","html_url":"https://github.com/barocsi","followers_url":"https://api.github.com/users/barocsi/followers","following_url":"https://api.github.com/users/barocsi/following{/other_user}","gists_url":"https://api.github.com/users/barocsi/gists{/gist_id}","starred_url":"https://api.github.com/users/barocsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barocsi/subscriptions","organizations_url":"https://api.github.com/users/barocsi/orgs","repos_url":"https://api.github.com/users/barocsi/repos","events_url":"https://api.github.com/users/barocsi/events{/privacy}","received_events_url":"https://api.github.com/users/barocsi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-04-28T10:59:13Z","updated_at":"2016-04-29T15:20:40Z","closed_at":null,"body":"So this is something that needs to be fixed asap. \r\nCodebase is identical, but the result is different on Android and on iOS.\r\nThre are multiple errors here.\r\n\r\nBoth tests same values using below for Facebook\r\n```javascript\r\n contentMetadata: {\r\n                         '$state': \"main.tabs.single\",\r\n                         '$stateParams': {\"postId\": post.id},\r\n                         something_else:{test:'bar'},\r\n                         '$og_app_id': bt_const.fbAPPId\r\n                       }\r\n```\r\n## Test 1 Android\r\n### Result in dashboard\r\n```json\r\n{\r\n  \"$og_app_id\": \"1757534501136057\",\r\n  \"$stateParams\": \"{\\\\\\\"postId\\\\\\\":\\\\\\\"571c1d4ba5800ace7c9e4558\\\\\\\"}\",\r\n  \"~creation_source\": 2,\r\n  \"$og_title\": \"Is our president evil? Yes or No ?\",\r\n  \"~tags\": [],\r\n  \"$content_type\": \"\",\r\n  \"~channel\": \"Facebook\",\r\n  \"$state\": \"main.tabs.single\",\r\n  \"source\": \"android\",\r\n  \"$og_image_url\": \"https://api.grademill.com/api/localstorages/shared_2016-4-28/download/dc3d559a-df92-4551-b5f6-f8fab69ccf13.jpg\",\r\n  \"$og_description\": \"This is a question, shared by @barocsi! Click and answer on Grademill asap, the real-time decision making app!\",\r\n  \"$one_time_use\": false,\r\n  \"$identity_id\": \"253230631314557549\",\r\n  \"something_else\": \"{\\\\\\\"test\\\\\\\":\\\\\\\"bar\\\\\\\"}\",\r\n  \"$canonical_identifier\": \"571c1d4ba5800ace7c9e4558_1461840113431\",\r\n  \"$exp_date\": \"0\",\r\n  \"~feature\": \"share\",\r\n  \"$keywords\": [],\r\n  \"~id\": \"254182727471912546\",\r\n  \"+url\": \"bnc.lt/F5kk/iJsxzC3jWs\",\r\n  \"$canonical_url\": \"\"\r\n}\r\n```\r\n\r\n## Test 2 iOS\r\n### Result in dashboard:\r\n```json\r\n{\r\n  \"$og_app_id\": \"1757534501136057\",\r\n  \"$stateParams\": {\"postId\": \"571c1d4ba5800ace7c9e4558\"},\r\n  \"~creation_source\": 3,\r\n  \"$og_title\": \"Is our president evil? Yes or No ?\",\r\n  \"~channel\": \"facebook\",\r\n  \"~feature\": \"share\",\r\n  \"$state\": \"main.tabs.single\",\r\n  \"$og_description\": \"This is a question, shared by @barocsi! Click and answer on Grademill asap, the real-time decision making app!\",\r\n  \"~stage\": \"my_post\",\r\n  \"$one_time_use\": false,\r\n  \"$identity_id\": \"253230631314557549\",\r\n  \"something_else\": {\"test\": \"bar\"},\r\n  \"$canonical_identifier\": \"571c1d4ba5800ace7c9e4558_1461840337208\",\r\n  \"$exp_date\": 0,\r\n  \"$og_image_url\": \"https://api.grademill.com/api/localstorages/shared_2016-4-28/download/d7336874-06e6-4cbe-8082-547c696c7bcf.jpg\",\r\n  \"$publicly_indexable\": 1,\r\n  \"~id\": \"254183698788828614\",\r\n  \"+url\": \"bnc.lt/F5kk/mTfaOIkkWs\"\r\n}\r\n```\r\n## Problems:\r\n\r\n1. ~channel names are different. This is not good if later one wants to combine statistics.\r\n2. Double escaping causes exception when processing link metadata generated by Android\r\n3. Stage parameter is still missing from Android generated link as stated to be resolved in https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/issues/122 but apparently not (probably I am using a wrong version 2.0.12.\r\n\r\nPlease fix, I wonder other clients never bump into these.\r\n"},"comment":{"url":"https://api.github.com/repos/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/issues/comments/215752681","html_url":"https://github.com/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/issues/133#issuecomment-215752681","issue_url":"https://api.github.com/repos/BranchMetrics/Cordova-Ionic-PhoneGap-Deferred-Deep-Linking-SDK/issues/133","id":215752681,"user":{"login":"barocsi","id":851560,"avatar_url":"https://avatars.githubusercontent.com/u/851560?v=3","gravatar_id":"","url":"https://api.github.com/users/barocsi","html_url":"https://github.com/barocsi","followers_url":"https://api.github.com/users/barocsi/followers","following_url":"https://api.github.com/users/barocsi/following{/other_user}","gists_url":"https://api.github.com/users/barocsi/gists{/gist_id}","starred_url":"https://api.github.com/users/barocsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barocsi/subscriptions","organizations_url":"https://api.github.com/users/barocsi/orgs","repos_url":"https://api.github.com/users/barocsi/repos","events_url":"https://api.github.com/users/barocsi/events{/privacy}","received_events_url":"https://api.github.com/users/barocsi/received_events","type":"User","site_admin":false},"created_at":"2016-04-29T15:20:39Z","updated_at":"2016-04-29T15:20:39Z","body":"Meanwhile this workaround did the trick \r\n```javascript\r\n      if (typeof payload.$stateParams == 'string') {\r\n        var __unescaped = payload.$stateParams.replace(/\\\\/g, \"\");\r\n        payload.$stateParams = JSON.parse(__unescaped);\r\n      }\r\n```"}}