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

notification description on android getting cut #1671

Closed
mokingguy opened this issue Apr 5, 2017 · 6 comments
Closed

notification description on android getting cut #1671

mokingguy opened this issue Apr 5, 2017 · 6 comments

Comments

@mokingguy
Copy link

mokingguy commented Apr 5, 2017

Expected Behaviour

Being able to expand notifications of the text is too large to see all the content

I saw this being an issue on #63 but I don't see support on the docs as to how to do this

Actual Behaviour

If you send a large text it gets cut off (depends on the device screen size)

Reproduce Scenario (including but not limited to)

I send this notification using node-gcm

  var message = new gcm.Message({
    contentAvailable: true,
    priority: 'high'
  });
  var color = '#e42112'
  message.addNotification({
    title: 'TEST',
    body: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
    sound: 'default',
    color: color,
    icon: 'ic_noti'
  });
  sender.send(message, {
    registrationTokens: ['cEb9EYpqJ44:APA91bHlT21XbVaNFTdqN9t8d2ehVwymqMbHXtdK02ifLzSYEpNmrOYZ6Goz71uJaia3eddK_ojX_wVjH_56Y7KFtlWA5EKKNg73w0k9ZexwmlNAdFyGRxABGOxlEZHA-AN7f0ZBUWHj']
  }, function(err, response) {
    if (err) {
      console.error(err);
      res.status(500).json(error).end();
    } else {
      console.log("andorid response", response);
      res.status(200).json(response).end();
    }
  });

And I get this on my device image and I'm not able to expand it

Steps to Reproduce

Send a notification as explained above

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

This was tested on android 6.0.1

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

The device was a motorola X play

Cordova CLI version and cordova platform version

cordova --version                                    6.5.0
cordova platform version android                    6.1.2

Plugin version

cordova plugin version | grep phonegap-plugin-push    1.9.2

Sample Push Data Payload

{
    title: 'TEST',
    body: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
    sound: 'default',
    color: color,
    icon: 'ic_noti'
  }

Sample Code that illustrates the problem

  var message = new gcm.Message({
    contentAvailable: true,
    priority: 'high'
  });
  var color = '#e42112'
  message.addNotification({
    title: 'TEST',
    body: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
    sound: 'default',
    color: color,
    icon: 'ic_noti'
  });
  sender.send(message, {
    registrationTokens: ['cEb9EYpqJ44:APA91bHlT21XbVaNFTdqN9t8d2ehVwymqMbHXtdK02ifLzSYEpNmrOYZ6Goz71uJaia3eddK_ojX_wVjH_56Y7KFtlWA5EKKNg73w0k9ZexwmlNAdFyGRxABGOxlEZHA-AN7f0ZBUWHj']
  }, function(err, response) {
    if (err) {
      console.error(err);
      res.status(500).json(error).end();
    } else {
      console.log("andorid response", response);
      res.status(200).json(response).end();
    }
  });
@macdonst
Copy link
Member

macdonst commented Apr 6, 2017

@mokingguy did you try pulling the notification down to expand it?

@mokingguy
Copy link
Author

I tried several ways to pull the notification to expand it, I took a couple of videos one with a comparison with a similar notification (sadly i forgot to turn on visible touches) and other with the visible touches

Comparison with another notification

With visible touches

@macdonst
Copy link
Member

macdonst commented Apr 6, 2017

@mokingguy now that I've got another minute to see what's going on I bet it is because you are using addNotification instead of addData. Please try that change in your script and let me know.

@mokingguy
Copy link
Author

Yup, that fixed it. Wonder why if I send it that way it does not create a BigTextView and if it can be solved.

Anyway that did it thank you, you rock!

@macdonst macdonst closed this as completed Apr 7, 2017
@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

2 participants