OneSignal / react-native-onesignal

React Native Library for OneSignal Push Notifications Service
Other
1.56k stars 371 forks source link

Notification Action Buttons Callback #34

Closed andreibarabas closed 8 years ago

andreibarabas commented 8 years ago

Hi,

When sending a push notification from One Signal, there is the option to include "Action Buttons" to it.

Even if doing so, the notification appears as regular (not with Action Buttons).

What do we need to do so the notification appears with buttons and each button's action is a callback in react native?

Thanks

jkasten2 commented 8 years ago

Hello,

Can you confirm your testing on Android 4.1+ or later required for this feature? Also try swiping down on the notification, if there isn't enough room due to other notifications in the notification shade it will not be expanded by default.

Thanks.

andreibarabas commented 8 years ago

Hi,

Sure. Here are the specs:

Android 4.4.2

the app is built using

As for the notification, here is the PREVIEW in OneSignal

screen shot 2016-06-02 at 09 27 19

and then, the result in the app. As you can see, there are no other notifications, AND I event tried pulling down, but no luck. Nothing happened.

screenshot_2016-06-02-09-32-52

P.S: other apps, like Whatsapp, Facebook, Gmail have similar buttons.

jkasten2 commented 8 years ago

Can you also check thetargetSdkVersion? It should be API Level 16 or higher.

andreibarabas commented 8 years ago

Sure. Here are the settings found in

android/app/build.gradle

    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        ...
        minSdkVersion 16
        targetSdkVersion 22
        ...
    }

Do you want me to try increasing the minSdkVersion to 17? but as long as the targetSdkVersion is 22, it shouldn't be a problem, no?

andreibarabas commented 8 years ago

I also tried bumping up the targetSdkVersion to 23, to match your build.gradle, but the same result. No action buttons :(

avishayil commented 8 years ago

Issue happens for me as well. We'll investigate it further.

avishayil commented 8 years ago

I updated the repo to the latest SDK and Google libraries but the issue still persist. @jkasten2

andreibarabas commented 8 years ago

I see. any luck with debugging the issue? Is there any way I can help?

jkasten2 commented 8 years ago

@avishayil @andreibarabas I haven't been able to reproduce an issue with our Android native SDK, I'll try out react-native to see if I can reproduce this.

andreibarabas commented 8 years ago

any luck replicating the issue? do you need some logs from my side?

avishayil commented 8 years ago

@jkasten2 can you guys help here?

jkasten2 commented 8 years ago

@andreibarabas @avishayil Can you send a link to a project and APK reproducing the issue? This will help me out as I work continue to work through some of the open issues on our Native Java SDK.

Thanks.

andreibarabas commented 8 years ago

@jkasten2 , I've sent you a repo invite. see branch push-notifications

jkasten2 commented 8 years ago

@andreibarabas Is there a pre-built APK in the repo? Can you send a link to one?

jkasten2 commented 8 years ago

@avishayil @andreibarabas Never mind, it seems the buttons only show up when a NotificationExtenderService is setup. I just created an issue to track this bug on the Native SDK side. https://github.com/OneSignal/OneSignal-Android-SDK/issues/61

Thanks.

mizterp commented 8 years ago

@jkasten2 Yep, took me hours to figure that bug out today

jkasten2 commented 8 years ago

@mizterp Thanks for reporting it!

I'll create a fix and get a release out for the issue this week yet.

jkasten2 commented 8 years ago

Just fixed this in release 2.4.3 along with another bug fix. It should be showing up in maven central in few hours and will be used as the default version.

avishayil commented 8 years ago

Thanks! will test it and report.

andreibarabas commented 8 years ago

Awesome! Will try it out

avishayil commented 8 years ago

I can confirm it's working. Issue closed for now.

andreibarabas commented 8 years ago

@avishayil, @jkasten2 I even tried 1.1.8 ... the buttons do not appear :( i must be doing something wrong

avishayil commented 8 years ago

Can I see your server-side request?

andreibarabas commented 8 years ago

sure. I'm doing it from the Onesignal UI, and it's just like the screenshot

https://cloud.githubusercontent.com/assets/2101405/15735954/24976650-28a5-11e6-9764-6d3b6bd06a46.png

Or did you mean something else?

andreibarabas commented 8 years ago

I tried to CURL directly the API, and it works. This means that you have a bug in your OneSignal UI (unrelated to this repo).

Thanks!

avishayil commented 8 years ago

@jkasten2

jkasten2 commented 8 years ago

@andreibarabas Can you share the notification id? I can check it out on our server.

andreibarabas commented 8 years ago

76fc3ce6-e456-4f8d-bc65-ea3fed5ff7ae

P.S: I think you invoked some other user in your prev message

jkasten2 commented 8 years ago

@andreibarabas I am not able to reproduce an issue either. Can you try it again? Maybe the app wasn't rebuilt when you tested it at first? I can confirm your running the 2.4.3 native Android SDK code base now on your test device.

andreibarabas commented 8 years ago

@jkasten2 - I can confirm that if I'm using the API to send a push notification. it works (which is what I need). If I fire a notification from your UI, it does not :( (but that doesn't really matter, as I need the API). thanks

mostafiz93 commented 7 years ago

@andreibarabas could you solve your issue? I'm also trying to send notifications with buttons, but buttons are not appearing though notifications are being sent

andreibarabas commented 7 years ago

@mostafiz93 - yes. just make sure to use the latest SDK