0

I am working with rpush (https://github.com/rpush/rpush) for ruby on rails. Using the GCM notification system for android, is it possible to set the notification style via a flag in the payload? I am specifically looking for a flag that would set the style to BigText. My current code looks like this:

def build_gcm_notification(token, message, title)
  n = Rpush::Gcm::Notification.new
  n.app = Rpush::Gcm::App.find_by(name: "android_app")
  n.registration_ids = [token]
  n.data = { body: message, title: title }
  n.priority = "high"

  n
end
sakurashinken
  • 3,940
  • 8
  • 34
  • 67
  • It seems you need set `BigText` on the client side. Check details on [How can I change the style of a GCM Push Notification](https://stackoverflow.com/questions/37820681/how-can-i-change-the-style-of-a-gcm-push-notification) – eux Feb 01 '21 at 02:33
  • So how do you do it when the app is closed? – sakurashinken Feb 01 '21 at 21:24
  • You may check out [Push Notifications when app is closed](https://stackoverflow.com/questions/24313539/push-notifications-when-app-is-closed). – eux Feb 02 '21 at 01:11

0 Answers0