Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
yernandus authored and Salakar committed Nov 19, 2018
1 parent f2bf9c3 commit 9486cdc
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.RemoteInput;

import com.facebook.react.HeadlessJsTaskService;
import com.facebook.react.ReactApplication;
Expand All @@ -24,6 +25,13 @@ static WritableMap toNotificationOpenMap(Intent intent) {
WritableMap notificationOpenMap = Arguments.createMap();
notificationOpenMap.putString("action", extras.getString("action"));
notificationOpenMap.putMap("notification", notificationMap);

Bundle extrasBundle = extras.getBundle("results");
if (extrasBundle != null) {
WritableMap results = Arguments.makeNativeMap(extrasBundle);
notificationOpenMap.putMap("results", results);
}

return notificationOpenMap;
}

Expand All @@ -49,6 +57,11 @@ public void onReceive(Context context, Intent intent) {
RNFirebaseBackgroundNotificationActionsService.class
);
serviceIntent.putExtras(intent.getExtras());

Bundle remoteInput = RemoteInput.getResultsFromIntent(intent);
if (remoteInput != null) {
serviceIntent.putExtra("results", remoteInput);
}
context.startService(serviceIntent);
HeadlessJsTaskService.acquireWakeLockNow(context);
}
Expand Down

0 comments on commit 9486cdc

Please sign in to comment.