Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-4034

Cordova fails to initialize if loading startPage from non application bundle location

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 2.8.0
    • None
    • cordova-ios
    • None
    • XCode 4.6.3
      iOS, Cordova 2.8, 2.9

    Description

      When loading webview content from outside application bundle (from app Documents folder) Cordova fails to initialize correctly:

      • no deviceready event
      • some plugins are not working (e.g. Contacts plugin)

      There are several other unwanted effects, e.g. when accessign geolocation data user asked for permission twice - first time for the whole app (I assume by the system), second time for loaded page (by webview?).

      To reproduce the effect:

      • create fresh cordova project
      • built/run
      • from XCode Organized download application content bundle
      • create "Documents/www/*" folder with some tests inside (content of original www folder suits well)
      • change AppDelegate:

        // Set your app's start page by setting the <content src='foo.html' /> tag in config.xml.
        // If necessary, uncomment the line below to override it.

        self.viewController.startPage = [[NSURL fileURLWithPath:[[[MainViewController applicationDocumentsDirectory] stringByAppendingPathComponent:@"www"] stringByAppendingPathComponent:@"index.html"]] absoluteString];

        self.viewController.wwwFolderName = [self.viewController.startPage stringByDeletingLastPathComponent];

      Attachments

        Issue Links

          Activity

            People

              agrieve Andrew Grieve
              tuxslayer Aleksey Yashchenko
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: