Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android actions example not working as expected #1330

Closed
NirpE opened this issue Jul 23, 2018 · 9 comments
Closed

Android actions example not working as expected #1330

NirpE opened this issue Jul 23, 2018 · 9 comments
Assignees
Labels
API: Notifications Notifications API - do not use for FCM ( messaging() ) Platform: Android Type: Stale Issue has become stale - automatically added by Stale bot Workflow: Waiting for User Response Blocked waiting for user response.
Milestone

Comments

@NirpE
Copy link

NirpE commented Jul 23, 2018

Issue

Following the tutorial of Android Actions - Adding a custom button will not give proper results when action is clicked. NotificationOpen.action is not test_action, instead it has value android.intent.action.VIEW

Note: onNewIntent() in MainActivity does contain proper action for Intent.

Environment

  1. Application Target Platform:

Both

  1. Development Operating System:

macOS Sierra

  1. Build Tools:

Android Studio 3.1.3

  1. React Native version:

0.54.0

  1. React Native Firebase Version:

^4.3.0

  1. Firebase Module:

Notifications

  1. Are you using typescript?

No

@NirpE NirpE changed the title Android actions example not working as excepted Android actions example not working as expected Jul 23, 2018
@alnsantosh
Copy link

I am facing the same issue.

const action=new Firebase.notifications.Android.Action('like','ic_launcher','like')
action.setShowUserInterface(true);
notification.android.addAction(action);

With the above code, I am able to add an action button to the android push notification but on clicking on a notification when the app is in the background, NotificationOpen.action is not 'like', instead it has value android.intent.action.VIEW

@Ehesp Ehesp added the API: Notifications Notifications API - do not use for FCM ( messaging() ) label Aug 15, 2018
@alnsantosh
Copy link

@Ehesp , Please help me with this issue.

@alnsantosh
Copy link

@NirpE , Did you figure out the solution for the problem

@Salakar
Copy link
Member

Salakar commented Aug 17, 2018

Could either of you give me a reproducible repo - it would help me debug this quicker.

@Salakar Salakar added this to the v5.0.0 Release milestone Aug 17, 2018
@Salakar Salakar self-assigned this Aug 17, 2018
@alnsantosh
Copy link

Unfortunately, I cannot provide any reproducible repo. However I followed the same instructions as per the documentation.

`// Set up your listener
firebase.notifications().onNotificationOpened((notificationOpen) => {
// notificationOpen.action will equal 'test_action'
});

// Build your notification
const notification = new firebase.notifications.Notification()
.setTitle('Android Notification Actions')
.setBody('Action Body')
.setNotificationId('notification-action')
.setSound('default')
.android.setChannelId('notification-action')
.android.setPriority(firebase.notifications.Android.Priority.Max);
// Build an action
const action = new firebase.notifications.Android.Action('test_action', 'ic_launcher', 'My Test Action');
// Add the action to the notification
notification.android.addAction(action);

// Display the notification
firebase.notifications().displayNotification(notification);`

I literally followed the above snippet from the firebase documentation. However, when I click on the button, notificationOpen.action does not give me "test_action". Instead I get "android.intent.action.VIEW" as the action. This is not letting me to differentiate the button click with the notification click.

@stale
Copy link

stale bot commented Sep 14, 2018

Hello 👋, this issue has been automatically marked as stale because it has not had activity for quite some time. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Type: Stale Issue has become stale - automatically added by Stale bot label Sep 14, 2018
@Salakar Salakar modified the milestones: v5.0.0 Release, v6.0.0 Sep 20, 2018
@stale stale bot removed Type: Stale Issue has become stale - automatically added by Stale bot labels Sep 20, 2018
@stale
Copy link

stale bot commented Oct 18, 2018

Hello 👋, this issue has been automatically marked as stale because it has not had activity for quite some time. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Type: Stale Issue has become stale - automatically added by Stale bot label Oct 18, 2018
@stale
Copy link

stale bot commented Nov 2, 2018

Closing this issue after a prolonged period of inactivity. If this is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Nov 2, 2018
@Agoujil2saad
Copy link

Agoujil2saad commented Dec 5, 2018

same problem Any updates ?
ps : I am using react native navigation v1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API: Notifications Notifications API - do not use for FCM ( messaging() ) Platform: Android Type: Stale Issue has become stale - automatically added by Stale bot Workflow: Waiting for User Response Blocked waiting for user response.
Projects
None yet
Development

No branches or pull requests

5 participants