{"action":"created","comment":{"url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/pulls/comments/245399695","pull_request_review_id":189498244,"id":245399695,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NTM5OTY5NQ==","diff_hunk":"@@ -317,16 +368,48 @@ public void createNotification(Context context, Bundle extras) {\n         notificationIntent.putExtra(PUSH_BUNDLE, extras);\n         notificationIntent.putExtra(NOT_ID, notId);\n \n-        int requestCode = new Random().nextInt();\n-        PendingIntent contentIntent = PendingIntent.getActivity(this, requestCode, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n+        SecureRandom random = new SecureRandom();\n+        int requestCode = random.nextInt();\n+        PendingIntent contentIntent = PendingIntent.getActivity(this, requestCode, notificationIntent,\n+                PendingIntent.FLAG_UPDATE_CURRENT);\n+\n+        Intent dismissedNotificationIntent = new Intent(this, PushDismissedHandler.class);\n+        dismissedNotificationIntent.putExtra(PUSH_BUNDLE, extras);\n+        dismissedNotificationIntent.putExtra(NOT_ID, notId);\n+        dismissedNotificationIntent.putExtra(DISMISSED, true);\n+        dismissedNotificationIntent.setAction(PUSH_DISMISSED);\n+\n+        requestCode = random.nextInt();\n+        PendingIntent deleteIntent = PendingIntent.getBroadcast(this, requestCode, dismissedNotificationIntent,\n+                PendingIntent.FLAG_CANCEL_CURRENT);\n+\n+        NotificationCompat.Builder mBuilder = null;\n+\n+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n+            String channelID = extras.getString(ANDROID_CHANNEL_ID);\n \n-        NotificationCompat.Builder mBuilder =\n-                new NotificationCompat.Builder(context)\n-                        .setWhen(System.currentTimeMillis())\n-                        .setContentTitle(fromHtml(extras.getString(TITLE)))\n-                        .setTicker(fromHtml(extras.getString(TITLE)))\n-                        .setContentIntent(contentIntent)\n-                        .setAutoCancel(true);\n+            // if the push payload specifies a channel use it\n+            if (channelID != null) {\n+                mBuilder = new NotificationCompat.Builder(context, channelID);\n+            } else {\n+                List<NotificationChannel> channels = mNotificationManager.getNotificationChannels();\n+\n+                if (channels.size() == 1) {\n+                    channelID = channels.get(0).getId();\n+                } else {\n+                    channelID = extras.getString(ANDROID_CHANNEL_ID, DEFAULT_CHANNEL_ID);\n+                }\n+                Log.d(LOG_TAG, \"Using channel ID = \" + channelID);\n+                mBuilder = new NotificationCompat.Builder(context, channelID);\n+            }\n+","path":"src/android/com/adobe/phonegap/push/FCMIntentService.java","position":354,"original_position":354,"commit_id":"c59f1e9a20fe07188a4d0778440ec47e4ce7346f","original_commit_id":"c59f1e9a20fe07188a4d0778440ec47e4ce7346f","user":{"login":"xchopox","id":4441569,"node_id":"MDQ6VXNlcjQ0NDE1Njk=","avatar_url":"https://avatars2.githubusercontent.com/u/4441569?v=4","gravatar_id":"","url":"https://api.github.com/users/xchopox","html_url":"https://github.com/xchopox","followers_url":"https://api.github.com/users/xchopox/followers","following_url":"https://api.github.com/users/xchopox/following{/other_user}","gists_url":"https://api.github.com/users/xchopox/gists{/gist_id}","starred_url":"https://api.github.com/users/xchopox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xchopox/subscriptions","organizations_url":"https://api.github.com/users/xchopox/orgs","repos_url":"https://api.github.com/users/xchopox/repos","events_url":"https://api.github.com/users/xchopox/events{/privacy}","received_events_url":"https://api.github.com/users/xchopox/received_events","type":"User","site_admin":false},"body":"Favor de eliminar salto de linea","created_at":"2019-01-04T19:38:40Z","updated_at":"2019-01-04T19:44:49Z","html_url":"https://github.com/avidueira/phonegap-plugin-push/pull/1#discussion_r245399695","pull_request_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/pulls/1","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/avidueira/phonegap-plugin-push/pulls/comments/245399695"},"html":{"href":"https://github.com/avidueira/phonegap-plugin-push/pull/1#discussion_r245399695"},"pull_request":{"href":"https://api.github.com/repos/avidueira/phonegap-plugin-push/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/pulls/1","id":242324312,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQyMzI0MzEy","html_url":"https://github.com/avidueira/phonegap-plugin-push/pull/1","diff_url":"https://github.com/avidueira/phonegap-plugin-push/pull/1.diff","patch_url":"https://github.com/avidueira/phonegap-plugin-push/pull/1.patch","issue_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/issues/1","number":1,"state":"open","locked":false,"title":"Se migra plugin de gcm a fcm","user":{"login":"avidueira","id":39281715,"node_id":"MDQ6VXNlcjM5MjgxNzE1","avatar_url":"https://avatars1.githubusercontent.com/u/39281715?v=4","gravatar_id":"","url":"https://api.github.com/users/avidueira","html_url":"https://github.com/avidueira","followers_url":"https://api.github.com/users/avidueira/followers","following_url":"https://api.github.com/users/avidueira/following{/other_user}","gists_url":"https://api.github.com/users/avidueira/gists{/gist_id}","starred_url":"https://api.github.com/users/avidueira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avidueira/subscriptions","organizations_url":"https://api.github.com/users/avidueira/orgs","repos_url":"https://api.github.com/users/avidueira/repos","events_url":"https://api.github.com/users/avidueira/events{/privacy}","received_events_url":"https://api.github.com/users/avidueira/received_events","type":"User","site_admin":false},"body":"","created_at":"2019-01-04T17:25:49Z","updated_at":"2019-01-04T19:44:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9d05199cb8b5deb01f20bdc2b6e2d5719f25160c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/pulls/1/commits","review_comments_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/pulls/1/comments","review_comment_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/pulls/comments{/number}","comments_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/issues/1/comments","statuses_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/statuses/c59f1e9a20fe07188a4d0778440ec47e4ce7346f","head":{"label":"avidueira:feature-fcm","ref":"feature-fcm","sha":"c59f1e9a20fe07188a4d0778440ec47e4ce7346f","user":{"login":"avidueira","id":39281715,"node_id":"MDQ6VXNlcjM5MjgxNzE1","avatar_url":"https://avatars1.githubusercontent.com/u/39281715?v=4","gravatar_id":"","url":"https://api.github.com/users/avidueira","html_url":"https://github.com/avidueira","followers_url":"https://api.github.com/users/avidueira/followers","following_url":"https://api.github.com/users/avidueira/following{/other_user}","gists_url":"https://api.github.com/users/avidueira/gists{/gist_id}","starred_url":"https://api.github.com/users/avidueira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avidueira/subscriptions","organizations_url":"https://api.github.com/users/avidueira/orgs","repos_url":"https://api.github.com/users/avidueira/repos","events_url":"https://api.github.com/users/avidueira/events{/privacy}","received_events_url":"https://api.github.com/users/avidueira/received_events","type":"User","site_admin":false},"repo":{"id":162719536,"node_id":"MDEwOlJlcG9zaXRvcnkxNjI3MTk1MzY=","name":"phonegap-plugin-push","full_name":"avidueira/phonegap-plugin-push","private":false,"owner":{"login":"avidueira","id":39281715,"node_id":"MDQ6VXNlcjM5MjgxNzE1","avatar_url":"https://avatars1.githubusercontent.com/u/39281715?v=4","gravatar_id":"","url":"https://api.github.com/users/avidueira","html_url":"https://github.com/avidueira","followers_url":"https://api.github.com/users/avidueira/followers","following_url":"https://api.github.com/users/avidueira/following{/other_user}","gists_url":"https://api.github.com/users/avidueira/gists{/gist_id}","starred_url":"https://api.github.com/users/avidueira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avidueira/subscriptions","organizations_url":"https://api.github.com/users/avidueira/orgs","repos_url":"https://api.github.com/users/avidueira/repos","events_url":"https://api.github.com/users/avidueira/events{/privacy}","received_events_url":"https://api.github.com/users/avidueira/received_events","type":"User","site_admin":false},"html_url":"https://github.com/avidueira/phonegap-plugin-push","description":"Register and receive push notifications","fork":true,"url":"https://api.github.com/repos/avidueira/phonegap-plugin-push","forks_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/forks","keys_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/keys{/key_id}","collaborators_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/teams","hooks_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/hooks","issue_events_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/issues/events{/number}","events_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/events","assignees_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/assignees{/user}","branches_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/branches{/branch}","tags_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/tags","blobs_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/git/refs{/sha}","trees_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/git/trees{/sha}","statuses_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/statuses/{sha}","languages_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/languages","stargazers_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/stargazers","contributors_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/contributors","subscribers_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/subscribers","subscription_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/subscription","commits_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/commits{/sha}","git_commits_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/git/commits{/sha}","comments_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/comments{/number}","issue_comment_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/issues/comments{/number}","contents_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/contents/{+path}","compare_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/compare/{base}...{head}","merges_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/merges","archive_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/downloads","issues_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/issues{/number}","pulls_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/pulls{/number}","milestones_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/milestones{/number}","notifications_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/labels{/name}","releases_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/releases{/id}","deployments_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/deployments","created_at":"2018-12-21T13:50:44Z","updated_at":"2018-12-21T13:50:46Z","pushed_at":"2019-01-04T17:25:49Z","git_url":"git://github.com/avidueira/phonegap-plugin-push.git","ssh_url":"git@github.com:avidueira/phonegap-plugin-push.git","clone_url":"https://github.com/avidueira/phonegap-plugin-push.git","svn_url":"https://github.com/avidueira/phonegap-plugin-push","homepage":null,"size":23303,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"avidueira:develop-fcm","ref":"develop-fcm","sha":"4b18505a2c30e17564c0e80060f0524968aa0d40","user":{"login":"avidueira","id":39281715,"node_id":"MDQ6VXNlcjM5MjgxNzE1","avatar_url":"https://avatars1.githubusercontent.com/u/39281715?v=4","gravatar_id":"","url":"https://api.github.com/users/avidueira","html_url":"https://github.com/avidueira","followers_url":"https://api.github.com/users/avidueira/followers","following_url":"https://api.github.com/users/avidueira/following{/other_user}","gists_url":"https://api.github.com/users/avidueira/gists{/gist_id}","starred_url":"https://api.github.com/users/avidueira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avidueira/subscriptions","organizations_url":"https://api.github.com/users/avidueira/orgs","repos_url":"https://api.github.com/users/avidueira/repos","events_url":"https://api.github.com/users/avidueira/events{/privacy}","received_events_url":"https://api.github.com/users/avidueira/received_events","type":"User","site_admin":false},"repo":{"id":162719536,"node_id":"MDEwOlJlcG9zaXRvcnkxNjI3MTk1MzY=","name":"phonegap-plugin-push","full_name":"avidueira/phonegap-plugin-push","private":false,"owner":{"login":"avidueira","id":39281715,"node_id":"MDQ6VXNlcjM5MjgxNzE1","avatar_url":"https://avatars1.githubusercontent.com/u/39281715?v=4","gravatar_id":"","url":"https://api.github.com/users/avidueira","html_url":"https://github.com/avidueira","followers_url":"https://api.github.com/users/avidueira/followers","following_url":"https://api.github.com/users/avidueira/following{/other_user}","gists_url":"https://api.github.com/users/avidueira/gists{/gist_id}","starred_url":"https://api.github.com/users/avidueira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avidueira/subscriptions","organizations_url":"https://api.github.com/users/avidueira/orgs","repos_url":"https://api.github.com/users/avidueira/repos","events_url":"https://api.github.com/users/avidueira/events{/privacy}","received_events_url":"https://api.github.com/users/avidueira/received_events","type":"User","site_admin":false},"html_url":"https://github.com/avidueira/phonegap-plugin-push","description":"Register and receive push notifications","fork":true,"url":"https://api.github.com/repos/avidueira/phonegap-plugin-push","forks_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/forks","keys_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/keys{/key_id}","collaborators_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/teams","hooks_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/hooks","issue_events_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/issues/events{/number}","events_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/events","assignees_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/assignees{/user}","branches_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/branches{/branch}","tags_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/tags","blobs_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/git/refs{/sha}","trees_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/git/trees{/sha}","statuses_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/statuses/{sha}","languages_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/languages","stargazers_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/stargazers","contributors_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/contributors","subscribers_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/subscribers","subscription_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/subscription","commits_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/commits{/sha}","git_commits_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/git/commits{/sha}","comments_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/comments{/number}","issue_comment_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/issues/comments{/number}","contents_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/contents/{+path}","compare_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/compare/{base}...{head}","merges_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/merges","archive_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/downloads","issues_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/issues{/number}","pulls_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/pulls{/number}","milestones_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/milestones{/number}","notifications_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/labels{/name}","releases_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/releases{/id}","deployments_url":"https://api.github.com/repos/avidueira/phonegap-plugin-push/deployments","created_at":"2018-12-21T13:50:44Z","updated_at":"2018-12-21T13:50:46Z","pushed_at":"2019-01-04T17:25:49Z","git_url":"git://github.com/avidueira/phonegap-plugin-push.git","ssh_url":"git@github.com:avidueira/phonegap-plugin-push.git","clone_url":"https://github.com/avidueira/phonegap-plugin-push.git","svn_url":"https://github.com/avidueira/phonegap-plugin-push","homepage":null,"size":23303,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/avidueira/phonegap-plugin-push/pulls/1"},"html":{"href":"https://github.com/avidueira/phonegap-plugin-push/pull/1"},"issue":{"href":"https://api.github.com/repos/avidueira/phonegap-plugin-push/issues/1"},"comments":{"href":"https://api.github.com/repos/avidueira/phonegap-plugin-push/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/avidueira/phonegap-plugin-push/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/avidueira/phonegap-plugin-push/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/avidueira/phonegap-plugin-push/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/avidueira/phonegap-plugin-push/statuses/c59f1e9a20fe07188a4d0778440ec47e4ce7346f"}},"author_association":"OWNER"}}
{"actor":{"display_login":"xchopox"}}