breautek commented on issue #1346:
URL: https://github.com/apache/cordova-ios/issues/1346#issuecomment-1583330803

   > Regardless, I tried including cordova.js in my webapp and 
navigator.notification is still undefined. Any idea why?
   
   cordova.js is a generated file so it differs by platform (android for 
example has a slightly different version `cordova.js` vs the ios platform).
   
   It's intended to only work inside the cordova webview.
   
   So your webview needs to be loaded the local file. Usually you'd have an 
`index.html` inside your `<cordova-project>/www/` folder and the `config.xml` 
file will have a `<content src="index.html" />` directive.
   
   The `index.html` should be able to find `cordova.js` relative to its current 
directory (assuming it's in the `www` folder):
   
   ```html
   <script src="cordova.js"></script>
   ```
   
   I'd recommend create a sample app (`cordova create testapp`) to see an 
example of a minimal project structure.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to