Closed hiroshi-shin closed 2 years ago
agreed
is managed on the server side. I don't know your server setting but your account, generated ID for the app, already agreed or the server does not ask for agreement (no agreement setting)
2 can happen if the map data is not correctly downloaded (network, server side setting, etc). It checks if there is a local map file. If not it will try to download it.
It looks like you don't have file sharing option in your info list. UIFileSharingEnabled
Please check all the plist flags.
Update
I forgot to mention that, when I tried to open BlindViewController
or ViewController
, it gives a blank page and asked to open the browser.
I don't know your server setting but your account, generated ID for the app, already agreed or the server does not ask for agreement
Thanks for explaining. This seems not like reason.
After removing the part for agreementConfig, problem 2 was solved.
if let agreeConfig = shared.agreementConfig,
let agreed = agreeConfig["agreed"] as? Bool {
if !agreed {
let vc = board.instantiateViewController(identifier: "agreement_vc") as! AgreementViewController
DispatchQueue.main.async {
self.show(vc, sender: nil)
}
}
} else if let userId = NavDataStore.shared().userID {
shared.checkAgreement(forIdentifier: userId, withCompletion: { [weak self] _ in
guard let _self = self else { return }
_self.checkConfig()
})
}
It looks like you don't have file sharing option in your info list. UIFileSharingEnabled Please check all the plist flags.
Currently, I'm still using the plist of NavCog3, in which UIFileSharingEnabled
is set to YES
.
In the DownloadViewController
, the unwind segue was performed after downloading finished.
Then, for example, here is the destination path for _2dMapDatafin.zip in DownloadViewController
:
destLocation NSURL * @"2dMapData_fin.zip -- file:///var/mobile/Containers/Data/Application/0496460B-861C-4224-A047-6420E28A4C1D/Documents/location/" 0x00000002805a0230
and the path for fm.removeItem()
in my function
NSFilePath=file:///var/mobile/Containers/Data/Application/0496460B-861C-4224-A047-6420E28A4C1D/Documents/2dMapData_fin.zip
Update 2
I also tried another approach:
Original code: https://github.com/hulop/NavCogIOSv3/blob/a25a85834ffb9644025692a69c91c26264a196ac/NavCog3/WelcomViewController.m#L193-L197
My customization:
dispatch_async(dispatch_get_main_queue(), ^{
NSString *hostname = config.selected.hostname;
[[NSUserDefaults standardUserDefaults] setObject:hostname forKey:@"selected_hokoukukan_server"];
// [self performSegueWithIdentifier:@"show_mode_selection" sender:self];
TabController *vc = [[TabController alloc] init];
UIWindow *window = UIApplication.sharedApplication.windows.firstObject;
window.rootViewController = vc;
});
It's ok for the first launch. However, after reopening the app, it gives such an error after BlindViewController#viewDidLoad
function:
I understand it's difficult to figure it out the without the source code. I will ask my team leader if I can show you my implementation.
It looks like you have a lot of issues. Let's take a look one by one.
I forgot to mention that, when I tried to open
BlindViewController
orViewController
, it gives a blank page and asked to open the browser.
What does this mean? The app asked you to open Safari? What is the URL? Could you share the screenshots?
Thanks for explaining. This seems not like reason. After removing the part for agreementConfig, problem 2 was solved.
I believe problems 1 and 2 are independent issues. It looks like somehow you could not write the file.
I understand it's difficult to figure it out the without the source code.
Yes, please consider making the source code public, or inviting me to a private repository.
Also, even if I can see the code, it is difficult to figure out the issues without a stack trace.
Please include the stack trace by typing thread backtrace
in the debug view so that we can see where it happened (see the figure)
Your questions are getting off focus from the original NavCog. I think it would be better to manage your issues in your repository. I'm happy to help you so feel free to invite me to your repo.
Thanks and I will close this issue.
Situation
This is about the first time running the app.
In current app:
My customization:
Source Code
Problem
agreed
is alwaystrue
-> not showing AgreementViewController at the first run.fm
functions gives errorfm.removeItem()
andfm.copyItem()
: "No such a file or directory"fm.createDirectory()
: "permission denied"I also checked about the path in DownloadViewController. In fact, the application id is different from it is in the function I created.