Skip to content
This repository has been archived by the owner on Mar 25, 2019. It is now read-only.

Problem with iOS notifications when the app is in the background #27

Open
aozbayra opened this issue Oct 25, 2015 · 2 comments
Open

Problem with iOS notifications when the app is in the background #27

aozbayra opened this issue Oct 25, 2015 · 2 comments

Comments

@aozbayra
Copy link

I am using this gem to set up my iOS app receive notifications from GCM. My app does indeed receive notifications when its active(on the foreground), however when its not active, it does not receive anything unless I make it active again. From what I read through multiple sources, I must send a this key value pair within my JSON post request: "content_available" : "true" but when I do so I receive an internal server error although I have the APNs certificate. Any thought on why this gem is not working when my app is on background and its indeed working when its active?

@kashif
Copy link
Contributor

kashif commented Oct 25, 2015

great question @aozbayra i'll investigate

@aried3r
Copy link

aried3r commented Jan 27, 2016

I'm not using this gem specifically, but we recently did this at work (using the PushKit Framework, if that's useful to you).

First of all, content_available has to be a boolean, as in

{
  "content_available": true
}

and not

{
  "content_available": "true"
}

which would result in an error message from the GCM servers.

Also, if you want your app to be woken up, even if the app was force quitted or after a device restart, the priority of the GCM notification has to be "high" (which corresponds to iOS' 10 priority). I'm not sure what you have to do on the app side to make this possible, I'd have to ask the developer who implemented this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants