Skip to content

Conversation

@loc9493
Copy link

@loc9493 loc9493 commented Aug 11, 2023

  • When app enter background mode, url request will be terminated.
  • When notifications received, using background task to poll for new notifications and display it.

func backgroundPoll(_ subscription: Subscription, completionHandler: @escaping ([Message]) -> Void) {
let user = store.getUser(baseUrl: subscription.baseUrl!)?.toBasicUser()
Log.d(tag, "Polling from \(subscription.urlString()) with user \(user?.username ?? "anonymous")")
let backgroundConfig = URLSessionConfiguration.background(withIdentifier: "com.example.myapp.background")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this identifier correct? (Or important?)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be any String, no need to be the same with app identifier

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

Successfully merging this pull request may close these issues.

2 participants