Skip to content

Commit

Permalink
fix: use NSDocumentDirectory to find start page
Browse files Browse the repository at this point in the history
  • Loading branch information
leo6104 committed Feb 4, 2021
1 parent 726bf2a commit 2d603c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ios/Plugin/CodePush.m
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,8 @@ - (NSString*)getConfigLaunchUrl
- (NSURL *)getStartPageURLForLocalPackage:(NSString*)packageLocation {
if (packageLocation) {
NSString* startPage = [self getConfigLaunchUrl];
NSString* libraryLocation = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSArray* realLocationArray = @[libraryLocation, @"NoCloud", packageLocation, @"www", startPage];
NSString* libraryLocation = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSArray* realLocationArray = @[libraryLocation, packageLocation, @"www", startPage];
NSString* realStartPageLocation = [NSString pathWithComponents:realLocationArray];
if ([[NSFileManager defaultManager] fileExistsAtPath:realStartPageLocation]) {
// Fixes WKWebView unable to load start page from CodePush update directory
Expand Down

0 comments on commit 2d603c6

Please sign in to comment.