So this is my code to get my notification event to be fired when the app is in background on the client side but it doesnt work.
n = Rpush::Gcm::Notification.new
n.app = Rpush::Gcm::App.find_by_name("partners")
n.registration_ids = [@user_auth_token.device_token]
n.data = { state: "case_status_single", count: badge_unread.length + 1, notification_id: n.id}
n.content_available = true
n.notification = {
body: @loan_application.name + " Loan Status Changed to: " + AgentAssignmentStatus.find(p.agent_assignment_status_id).assignment_status,
title: Partners',
tag: true
}
n.save!
Rpush.push
I thought with the content_available parameter allows the onNotification event from the mobile app side to be triggered even if the app is in background.
Any thoughts on this?
Thanks