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

The server does not work in background #57

Open
nokai opened this issue Aug 3, 2015 · 10 comments
Open

The server does not work in background #57

nokai opened this issue Aug 3, 2015 · 10 comments

Comments

@nokai
Copy link

nokai commented Aug 3, 2015

I'm working with xcode and ios. (sample)

Works again when you return from background

Why is this happening?

Thanks

@ktrzeciaknubisa
Copy link
Member

Do you mean the app is restarted?

@nokai
Copy link
Author

nokai commented Aug 3, 2015

No.

I mean, that while the app is running on background, the url (ip addresses 127.0.0.1:3000) does not work (Not found)

@nokai
Copy link
Author

nokai commented Aug 4, 2015

Nobody knows how the application will not pause in background ?

@obastemur
Copy link
Member

iOS doesn't allow any (including native Objective C) thread is running when the app is on background. See https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html

@nokai
Copy link
Author

nokai commented Aug 11, 2015

But in the emulator run in background without problems, but in the device no works in background..

I do not understand . Why?

@obastemur
Copy link
Member

IOS Simulator and real device do not function similarly. iOS does not support backround threads without a particular reason

@nokai
Copy link
Author

nokai commented Aug 11, 2015

Ok, but for example.

If I want the user to exchange files with the iPhone through the browser, I have to force the user to do nothing with your device, such as playing a game.

@obastemur
Copy link
Member

Not exactly. Apple accepts some particular events as long as you set them as your intention. See the link and more I'd previously shared.

@ktrzeciaknubisa
Copy link
Member

@nokai Also please remember, that putting the app into the background gives you no guarantee that the system will not kill it anytime it needs to release the resources etc. This kind of tasks as yours would need to to be explicitly defined as background task as the link above says, but I don't know if this is doable with JXcore at the moment.

Furthermore there are just few modes allowed for background tasks. Below is an excerpt from the link above:

In iOS, only specific app types are allowed to run in the background:

  • Apps that play audible content to the user while in the background, such as a music player app
  • Apps that record audio content while in the background
  • Apps that keep users informed of their location at all times, such as a navigation app
  • Apps that support Voice over Internet Protocol (VoIP)
  • Apps that need to download and process new content regularly
  • Apps that receive regular updates from external accessories

The point is, that your task would not be allowed to do just anything and @obastemur just mentioned that in previous comment.

@nokai
Copy link
Author

nokai commented Aug 12, 2015

Ok, i want "Apps that need to download and process new content regularly"...

Would it be possible do this with jxcore and Cordova? Where I can find a very easy example?

Thanks

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

No branches or pull requests

3 participants