You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's a common task for Teller users to run iOS background fetch with Teller repositories so that they can keep repository data always up-to-date.
The current method is hands on and a roadblock for devs. It requires some work:
extensionAppDelegate{func application(_ application:UIApplication, performFetchWithCompletionHandler completionHandler:@escaping(UIBackgroundFetchResult)->Void){letbackgroundFetchResult=Wendy.shared.backgroundFetchRunTasks(application, performFetchWithCompletionHandler: completionHandler)
// ??? What do we do about other SDKs that run background commands and return a UIBackgroundFetchResult?
// ??? What should a Teller repository sync return as a UIBackgroundFetchResult? Currently, it's up to the developer to implement this themselves.
repositorySyncService.sync{(success)incompletionHandler(backgroundFetchResult)}}}
import RxSwift
protocolRepositorySyncService{func sync(onComplete:@escaping(_ success:Bool)->Void)}classTellerRepositorySyncService:RepositorySyncService{privateletreposRepository:ReposRepositoryprivateletgithubUsernameRepository:GitHubUsernameRepositoryprivateletdisposeBag=DisposeBag()init(reposRepository:ReposRepository,
githubUsernameRepository:GitHubUsernameRepository){self.reposRepository = reposRepository
self.githubUsernameRepository = githubUsernameRepository
}func sync(onComplete:@escaping(_ success:Bool)->Void){
if let usernameReposToFetch = githubUsernameRepository.dataSource.value {
reposRepository.requirements =ReposDataSource.GetDataRequirements(githubUsername: usernameReposToFetch)try! reposRepository.refresh(force: false).subscribe(onSuccess:{(result)inonComplete(result.didSucceed())}).disposed(by: disposeBag)}}}
As you can see from the example above, there are some problems currently:
What do developers do when trying to combine 2+ separate UIBackgroundFetchResult?
Teller does not provide a way to create a UIBackgroundFetchResult for you. You must do it yourself. It would be great to do this work for you.
The text was updated successfully, but these errors were encountered:
It's a common task for Teller users to run iOS background fetch with Teller repositories so that they can keep repository data always up-to-date.
The current method is hands on and a roadblock for devs. It requires some work:
As you can see from the example above, there are some problems currently:
The text was updated successfully, but these errors were encountered: