Skip to content

Commit

Permalink
limit the components that Intent will resolve to
Browse files Browse the repository at this point in the history
  • Loading branch information
vstostap committed Mar 23, 2018
1 parent 7f0344b commit 08d5ca3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,12 @@ public void sendToNotificationCentre(Bundle bundle) {
}

Intent actionIntent = new Intent();
actionIntent.setAction(context.getPackageName() + "." + action);
String packageName = context.getPackageName();
actionIntent.setAction(packageName + "." + action);
// Add "action" for later identifying which button gets pressed.
bundle.putString("action", action);
actionIntent.putExtra("notification", bundle);
actionIntent.setPackage(packageName);
PendingIntent pendingActionIntent = PendingIntent.getBroadcast(context, notificationID, actionIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
notification.addAction(icon, action, pendingActionIntent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ protected void onHandleIntent(Intent intent) {
}

private void sendRegistrationToken(String token) {
Intent intent = new Intent(this.getPackageName() + ".RNPushNotificationRegisteredToken");
String packageName = this.getPackageName();
Intent intent = new Intent(packageName + ".RNPushNotificationRegisteredToken");
intent.putExtra("token", token);
intent.setPackage(packageName);
sendBroadcast(intent);
}
}

0 comments on commit 08d5ca3

Please sign in to comment.