calonso / rails-push-notifications

Rails iOS, Android and Windows Phone Push Notifications made easy!!
https://rubygems.org/gems/rails-push-notifications
MIT License
138 stars 44 forks source link

No text in the notification #10

Closed errakeshpd closed 7 years ago

errakeshpd commented 7 years ago

Insertion `=> [#<RailsPushNotifications::Notification:0x007f1a15c33878 id: 7, destinations: ["ciJie4Om2aw:APA91bHckWobcMLNzOXxe9eXl0X4FuoDym9IlcBjvWOiwjtq0LptHEdy0ubgUahqb-79TF6X5J9eUUL-TRo3jACQBGmL1vPhP9cSb2TXnVCAU-iIlvQc1Kps-Yg0aUiVhjXZHBAq04Po"], app_id: 7, app_type: "RailsPushNotifications::GCMApp", data: {:text=>"Awesome bags is in Live In near you"}, results:

<RubyPushNotifications::GCM::GCMResponse:0x007f1a15824098

@canonical_ids=0,
@failed=0,
@results=[#<RubyPushNotifications::GCM::GCMResultOK:0x007f1a154037c0>],
@success=1>,

success: 1, failed: 0, sent: true, created_at: Thu, 28 Jul 2016 09:50:22 UTC +00:00, updated_at: Thu, 28 Jul 2016 09:50:22 UTC +00:00>]`

Notification is receiving but no text is showing in the notification.

PFA. screenshot_2016-07-28-15-35-42

calonso commented 7 years ago

Hi @errakeshpd

I think the problem is that you aren't parsing it properly on your device. The sent notification contains the data key and it will contain your { text: "Awesome ..." } following the official documentation.

I'd suggest printing it in the logs to double check what you're getting and then parse it properly.

Hope it helps.

calonso commented 7 years ago

Closing as inactive... Please reopen it if you need further help.