Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Android notification only single line and no sound #724

Closed
jur-clerkx opened this issue Mar 18, 2016 · 11 comments
Closed

Android notification only single line and no sound #724

jur-clerkx opened this issue Mar 18, 2016 · 11 comments

Comments

@jur-clerkx
Copy link

Expected Behaviour

Notification will show full message, if the message is to big the notification will be expendable.

Actual Behaviour

Message show as: "This message is too lo...". Also, there is no sound when receiving the notification.

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

Android 5.1

(Android) What device vendor (e.g. Samsung, HTC, Sony...)

Motorola Moto G (and all other devices I tested with)

Cordova CLI version and cordova platform version

cordova --version 6.0.0
cordova platform version android 4.1.1

Plugin version

1.6.0

Sample Push Data Payload

                         "tokens": tokens,
            "profile": profile,
            "sound": "default",
            "notification": {
                "title": title,
                "message": message,
                "android": {
                    "title": title,
                    "message": message,
                    "icon": "ic_stat_icon",
                    "icon_color": "#FF464E",
                },
                "ios": {
                    "title": title,
                    "message": message,
                    "badge": "1"
                }
            }
@macdonst
Copy link
Member

@jur-clerkx you are using ionic push right?

@jur-clerkx
Copy link
Author

@macdonst Yes I do, but they reffered to this page for more explination. Does ionic push not provide all the functionalities?

@macdonst
Copy link
Member

@jur-clerkx the thing is when you send that push data to Ionic they subtly transform it before sending it onto the device. I need to talk to @ericb about it.

@jur-clerkx
Copy link
Author

@macdonst So atm there is no fix for both of my problems? Could you keep me updated about the matter?

Nevertheless thanks for your quick response :)

@macdonst
Copy link
Member

@jur-clerkx Nothing obvious to me at the moment as I don't use Ionic Push during my testing but I know the Ionic team uses this plugin. @ericb (Ionic) and I just back channeled and we will talk on Tuesday to figure out what is going on and to better support people using Ionic Push.

I'm actually on vacation right now :)

@jur-clerkx
Copy link
Author

@macdonst Thank you very much for your time, I'll check back here after Tuesday. Enjoy your vacation!

@ericb
Copy link
Contributor

ericb commented Mar 18, 2016

@jur-clerkx We have a gitter channel you can hop into if you'd like to try and troubleshoot your problem with us.

@jur-clerkx
Copy link
Author

Turned out that it is probably a bug.

Setting the icon tag in the post request to the ionic io service causes the notification to bug.
When setting the 'icon' tag in the 'pluginConfig' object inside the 'Ionic.Push' init the notification works as expected.

@ghost
Copy link

ghost commented Mar 25, 2016

@macdonst I have this and I'm not using ionic push. It only happens when the app is not running though.

Expected Behaviour

Notification with the full body visible.

Actual Behaviour

Single line text, ended in "...", can not be expanded or read anyway. Only happens when the app is not running. When the app is running, everything is as expected.

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Force close the app and send a notification.

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

Android 6.0.1 CyanogenMod 13

(Android) What device vendor (e.g. Samsung, HTC, Sony...)

Zenfone 2

Cordova CLI version and cordova platform version

cordova 6.0.0
cordova android 5.1.1

Plugin version

phonegap-plugin-push  1.6.1

Sample Push Data Payload

Default, only changing data and notification objects, see code

Sample Code that illustrates the problem


  sender = new gcm.Sender(settings.gcm.API_KEY)
  message = new gcm.Message()

  message.addNotification 'title', 'test app'
  message.addNotification 'body', 'test msg'
  message.addNotification 'icon', 'logo'
  message.addData 'content-available', '1'
  message.addData 'priority', 'high'

Logs taken while reproducing problem

nothing worth mentioning

@azamalvi
Copy link

Try this one. It works for me

       "tokens": tokens,
        "profile": profile,
        "notification": {
            "sound": true,
            "title": title,
            "message": message,
            "android": {
                "title": title,
                "message": message,
                "icon": "ic_stat_icon",
                "icon_color": "#FF464E",
            },
            "ios": {
                "title": title,
                "message": message,
                "badge": "1"
            }
        }

@lock
Copy link

lock bot commented Jun 3, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

4 participants