Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example of polling request to the server while in background. #1068

Closed
Natanael1234 opened this issue Aug 8, 2016 · 2 comments
Closed

Example of polling request to the server while in background. #1068

Natanael1234 opened this issue Aug 8, 2016 · 2 comments

Comments

@Natanael1234
Copy link

Natanael1234 commented Aug 8, 2016

The documentation says:

Examples of Notification Usage

Local notifications are ideally suited for applications with time-based behaviors, such as calendar and to-do list applications. Applications that run in the background for the limited period allowed by iOS might also find local notifications useful.
For example, applications that depend on servers for messages or data can poll their servers for incoming items while running in the background; if a message is ready to view or an update is ready to download, they can then present a local notification immediately to inform their users.

Source.

I need to get data from the server to devide if I will show or not a message to the user in the notifications. Perhaps I would just download data in background periodically.

The problem is, when I close, by pressing back key or via side menu, the notification icon appears in notification area but data is not immediately delivered and processed to my app, so I cannot to decide if I will show or not the notification until the user clicks on it.

When the app is just minimized, by pressing home key, the notification is delivered directly to the app.

Could someone show me a example on this?

@Natanael1234 Natanael1234 changed the title Example of pulling request to the server while in background. Example of polling request to the server while in background. Aug 8, 2016
@rwillett
Copy link
Collaborator

You cannot poll the server whilst an IOS app is in the background. Your JavaScript HTTP connection will not work, neither will timers.

If this is still a problem, please update with the template in #1188.

@rwillett
Copy link
Collaborator

Closed as no response from original poster.

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

No branches or pull requests

2 participants