UIWebview unable to access camera or photos











up vote
0
down vote

favorite












I have an app with a Storyboard scene. In the storyboard scene I have a UIWebView. In the storyboard scene I have a UIWebView. My code is as follows:



@IBOutlet weak var webView: UIWebView!

override func viewDidLoad() {
super.viewDidLoad()

let url = URL(string: “http://www.somepage.com”)
let urlRquest = URLRequest(url: url!)
webView.loadRequest(urlRquest)
}


The user is able to navigate and click on links in the UIWebView. I run into an issue when that web view requests access to the camera or stored photos.



iOS presents a standard control at the bottom of the view with the following options:
Take Photo or Video
Photo Library
Browse
Cancel



Once the user selects ANY of the options the webview disappears and I get the following error:



<UIImagePickerController: 0x1071ae400> on <MyApp.WebViewVC: 0x10e924ae0> whose view is not in the window hierarchy!




  • I am not able to use WKWebView in this particular app.

  • I have verified that the proper permissions are requested in the plist file and I am able to access photo album and camera within the app and have requested permissions before calling the web view.

  • I did not implement any of the UIImagePickerControllerDelegate functions as this is a UIWebView requesting access.










share|improve this question






















  • Found my answer here after further research: stackoverflow.com/questions/25942676/…
    – xdeleon
    Nov 20 at 23:02










  • suspicious point i am not able to use WKWebview for this app. what issue did you face ? for your problem best solution is wkwebview.
    – Shauket Sheikh
    Nov 21 at 3:36










  • My app needs to support iOS 10-12. I also need to access the cookies of the embedded browser/view. WKWebView did not implement support for cookie access until iOS 11 as noted here: stackoverflow.com/questions/33156567/… . With UIWebView I can access cookies as documented here: stackoverflow.com/questions/771498/… . While I agree it’s preferable to use WKWebViewI noted that I can’t use it “in this particular app” but did not put the particulars as I was trying to keep my question specific.
    – xdeleon
    Nov 21 at 19:16










  • There is way to sync cookies i am using wkwebview and syncing cookies till ios 8
    – Shauket Sheikh
    Nov 22 at 1:26










  • as for your issue, can you read this doc they have fix for this error. pinkstone.co.uk/…
    – Shauket Sheikh
    Nov 22 at 1:59















up vote
0
down vote

favorite












I have an app with a Storyboard scene. In the storyboard scene I have a UIWebView. In the storyboard scene I have a UIWebView. My code is as follows:



@IBOutlet weak var webView: UIWebView!

override func viewDidLoad() {
super.viewDidLoad()

let url = URL(string: “http://www.somepage.com”)
let urlRquest = URLRequest(url: url!)
webView.loadRequest(urlRquest)
}


The user is able to navigate and click on links in the UIWebView. I run into an issue when that web view requests access to the camera or stored photos.



iOS presents a standard control at the bottom of the view with the following options:
Take Photo or Video
Photo Library
Browse
Cancel



Once the user selects ANY of the options the webview disappears and I get the following error:



<UIImagePickerController: 0x1071ae400> on <MyApp.WebViewVC: 0x10e924ae0> whose view is not in the window hierarchy!




  • I am not able to use WKWebView in this particular app.

  • I have verified that the proper permissions are requested in the plist file and I am able to access photo album and camera within the app and have requested permissions before calling the web view.

  • I did not implement any of the UIImagePickerControllerDelegate functions as this is a UIWebView requesting access.










share|improve this question






















  • Found my answer here after further research: stackoverflow.com/questions/25942676/…
    – xdeleon
    Nov 20 at 23:02










  • suspicious point i am not able to use WKWebview for this app. what issue did you face ? for your problem best solution is wkwebview.
    – Shauket Sheikh
    Nov 21 at 3:36










  • My app needs to support iOS 10-12. I also need to access the cookies of the embedded browser/view. WKWebView did not implement support for cookie access until iOS 11 as noted here: stackoverflow.com/questions/33156567/… . With UIWebView I can access cookies as documented here: stackoverflow.com/questions/771498/… . While I agree it’s preferable to use WKWebViewI noted that I can’t use it “in this particular app” but did not put the particulars as I was trying to keep my question specific.
    – xdeleon
    Nov 21 at 19:16










  • There is way to sync cookies i am using wkwebview and syncing cookies till ios 8
    – Shauket Sheikh
    Nov 22 at 1:26










  • as for your issue, can you read this doc they have fix for this error. pinkstone.co.uk/…
    – Shauket Sheikh
    Nov 22 at 1:59













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have an app with a Storyboard scene. In the storyboard scene I have a UIWebView. In the storyboard scene I have a UIWebView. My code is as follows:



@IBOutlet weak var webView: UIWebView!

override func viewDidLoad() {
super.viewDidLoad()

let url = URL(string: “http://www.somepage.com”)
let urlRquest = URLRequest(url: url!)
webView.loadRequest(urlRquest)
}


The user is able to navigate and click on links in the UIWebView. I run into an issue when that web view requests access to the camera or stored photos.



iOS presents a standard control at the bottom of the view with the following options:
Take Photo or Video
Photo Library
Browse
Cancel



Once the user selects ANY of the options the webview disappears and I get the following error:



<UIImagePickerController: 0x1071ae400> on <MyApp.WebViewVC: 0x10e924ae0> whose view is not in the window hierarchy!




  • I am not able to use WKWebView in this particular app.

  • I have verified that the proper permissions are requested in the plist file and I am able to access photo album and camera within the app and have requested permissions before calling the web view.

  • I did not implement any of the UIImagePickerControllerDelegate functions as this is a UIWebView requesting access.










share|improve this question













I have an app with a Storyboard scene. In the storyboard scene I have a UIWebView. In the storyboard scene I have a UIWebView. My code is as follows:



@IBOutlet weak var webView: UIWebView!

override func viewDidLoad() {
super.viewDidLoad()

let url = URL(string: “http://www.somepage.com”)
let urlRquest = URLRequest(url: url!)
webView.loadRequest(urlRquest)
}


The user is able to navigate and click on links in the UIWebView. I run into an issue when that web view requests access to the camera or stored photos.



iOS presents a standard control at the bottom of the view with the following options:
Take Photo or Video
Photo Library
Browse
Cancel



Once the user selects ANY of the options the webview disappears and I get the following error:



<UIImagePickerController: 0x1071ae400> on <MyApp.WebViewVC: 0x10e924ae0> whose view is not in the window hierarchy!




  • I am not able to use WKWebView in this particular app.

  • I have verified that the proper permissions are requested in the plist file and I am able to access photo album and camera within the app and have requested permissions before calling the web view.

  • I did not implement any of the UIImagePickerControllerDelegate functions as this is a UIWebView requesting access.







uiwebview






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 20 at 0:32









xdeleon

513513




513513












  • Found my answer here after further research: stackoverflow.com/questions/25942676/…
    – xdeleon
    Nov 20 at 23:02










  • suspicious point i am not able to use WKWebview for this app. what issue did you face ? for your problem best solution is wkwebview.
    – Shauket Sheikh
    Nov 21 at 3:36










  • My app needs to support iOS 10-12. I also need to access the cookies of the embedded browser/view. WKWebView did not implement support for cookie access until iOS 11 as noted here: stackoverflow.com/questions/33156567/… . With UIWebView I can access cookies as documented here: stackoverflow.com/questions/771498/… . While I agree it’s preferable to use WKWebViewI noted that I can’t use it “in this particular app” but did not put the particulars as I was trying to keep my question specific.
    – xdeleon
    Nov 21 at 19:16










  • There is way to sync cookies i am using wkwebview and syncing cookies till ios 8
    – Shauket Sheikh
    Nov 22 at 1:26










  • as for your issue, can you read this doc they have fix for this error. pinkstone.co.uk/…
    – Shauket Sheikh
    Nov 22 at 1:59


















  • Found my answer here after further research: stackoverflow.com/questions/25942676/…
    – xdeleon
    Nov 20 at 23:02










  • suspicious point i am not able to use WKWebview for this app. what issue did you face ? for your problem best solution is wkwebview.
    – Shauket Sheikh
    Nov 21 at 3:36










  • My app needs to support iOS 10-12. I also need to access the cookies of the embedded browser/view. WKWebView did not implement support for cookie access until iOS 11 as noted here: stackoverflow.com/questions/33156567/… . With UIWebView I can access cookies as documented here: stackoverflow.com/questions/771498/… . While I agree it’s preferable to use WKWebViewI noted that I can’t use it “in this particular app” but did not put the particulars as I was trying to keep my question specific.
    – xdeleon
    Nov 21 at 19:16










  • There is way to sync cookies i am using wkwebview and syncing cookies till ios 8
    – Shauket Sheikh
    Nov 22 at 1:26










  • as for your issue, can you read this doc they have fix for this error. pinkstone.co.uk/…
    – Shauket Sheikh
    Nov 22 at 1:59
















Found my answer here after further research: stackoverflow.com/questions/25942676/…
– xdeleon
Nov 20 at 23:02




Found my answer here after further research: stackoverflow.com/questions/25942676/…
– xdeleon
Nov 20 at 23:02












suspicious point i am not able to use WKWebview for this app. what issue did you face ? for your problem best solution is wkwebview.
– Shauket Sheikh
Nov 21 at 3:36




suspicious point i am not able to use WKWebview for this app. what issue did you face ? for your problem best solution is wkwebview.
– Shauket Sheikh
Nov 21 at 3:36












My app needs to support iOS 10-12. I also need to access the cookies of the embedded browser/view. WKWebView did not implement support for cookie access until iOS 11 as noted here: stackoverflow.com/questions/33156567/… . With UIWebView I can access cookies as documented here: stackoverflow.com/questions/771498/… . While I agree it’s preferable to use WKWebViewI noted that I can’t use it “in this particular app” but did not put the particulars as I was trying to keep my question specific.
– xdeleon
Nov 21 at 19:16




My app needs to support iOS 10-12. I also need to access the cookies of the embedded browser/view. WKWebView did not implement support for cookie access until iOS 11 as noted here: stackoverflow.com/questions/33156567/… . With UIWebView I can access cookies as documented here: stackoverflow.com/questions/771498/… . While I agree it’s preferable to use WKWebViewI noted that I can’t use it “in this particular app” but did not put the particulars as I was trying to keep my question specific.
– xdeleon
Nov 21 at 19:16












There is way to sync cookies i am using wkwebview and syncing cookies till ios 8
– Shauket Sheikh
Nov 22 at 1:26




There is way to sync cookies i am using wkwebview and syncing cookies till ios 8
– Shauket Sheikh
Nov 22 at 1:26












as for your issue, can you read this doc they have fix for this error. pinkstone.co.uk/…
– Shauket Sheikh
Nov 22 at 1:59




as for your issue, can you read this doc they have fix for this error. pinkstone.co.uk/…
– Shauket Sheikh
Nov 22 at 1:59

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53384573%2fuiwebview-unable-to-access-camera-or-photos%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53384573%2fuiwebview-unable-to-access-camera-or-photos%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Feedback on college project

Futebolista

Albești (Vaslui)