uiwebview

Image with data uri src not loading in UIWebView

时光总嘲笑我的痴心妄想 提交于 2020-01-23 17:59:09
问题 I have a simple image populated from a data uri that loads fine in MobileSafari, but when I load the same webpage in a UIWebView, it shows as a broken image: <img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxQSEhQUEhQUFBUUFBQUFBcVGBUUFhUVFRUWFhQUFBQYHSggGBolHBQUITEhJSkrLi4uFx8zODMsNygtLisBCgoKDg0OGhAQGiwkHx8sLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCw3NyssLC4rLP/AABEIAMEBBQMBIgACEQEDEQH/xAAcAAABBQEBAQAAAAAAAAAAAAABAAIDBAUGBwj

Crash when use UIWebview on iPad and iPhone running iOS 10.0 on Wi-Fi connected to an IPv6 network

北战南征 提交于 2020-01-23 17:43:44
问题 Iphone app rejected because of the the reason that “We discovered one or more bugs in your app when reviewed on iPad and iPhone running iOS 10.0 on Wi-Fi connected to an IPv6 network.” Anyone can help to solve it? First time when my application load. It need to push notification to server: - (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken{ NSString *token = [[deviceToken description] stringByTrimmingCharactersInSet:

iOS Open Document with External App from UIWebVIew

隐身守侯 提交于 2020-01-23 01:38:09
问题 I have a UIWebView . When a link which contains a document is clicked, I want to open that document in a external app (office, openoffice, etc) but not inside the UIWebView . I know how to do it for emails: - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { if ([[[request URL] scheme] isEqual:@"mailto"]) { [[UIApplication sharedApplication] openURL:[request URL]]; return NO; } return YES; } Is there

Get the http response code from every UIWebView request

烈酒焚心 提交于 2020-01-22 15:03:47
问题 I need to check the response status code while loading any of the url in the webview fo. For now we can consider any of the web application I am loading inside the web view.So I need to track down every request withing that webview and check out the response code accordingly. For finding the response code, I need to use NSUrlConnection inside the uiwebview's delegate method "shouldStartLoadWithrequest". Some thing like this - - (BOOL) webView:(UIWebView *)webView shouldStartLoadWithRequest:

Embedded vimeo video in iPhone app using iOS 6 not playing

蓝咒 提交于 2020-01-22 10:30:18
问题 I can't seem to get any videos playing in iOS 6. Both on the device (iP4) and simulator. What I have is a UIWebView setup in IB. Then in my viewDidLoad I have the following code: NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://domain.com/app/player.php?vid=%@", [videoDetails objectForKey:@"vid"]]]; NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; [videoWebView loadRequest:requestObj]; Just to explain, the video settings on vimeo are that it is only allowed

Listening for events in a UIWebView (iOS)

﹥>﹥吖頭↗ 提交于 2020-01-22 09:38:31
问题 I'm trying to listen for an event (specifically a button click) from a webpage I have opened in a UIWebView in my iOS app. I know that in other languages there are ways to attach event listeners to certain web calls, but I haven't yet found a way to do it in Objective-C. I also haven't found anyone online who says it can't be done, so I decided I should ask. I saw in the documentation that you can make Objective-C calls from Javascript, but I do not have control of the webpage I am wanting to

Listening for events in a UIWebView (iOS)

笑着哭i 提交于 2020-01-22 09:38:06
问题 I'm trying to listen for an event (specifically a button click) from a webpage I have opened in a UIWebView in my iOS app. I know that in other languages there are ways to attach event listeners to certain web calls, but I haven't yet found a way to do it in Objective-C. I also haven't found anyone online who says it can't be done, so I decided I should ask. I saw in the documentation that you can make Objective-C calls from Javascript, but I do not have control of the webpage I am wanting to

Avoid main thread freezes when UIWebView tries to blockingly lock the web thread

戏子无情 提交于 2020-01-22 07:43:12
问题 All UIWebViews share a single web thread. When one of them is init -ed, removed from superview etc., they will attempt to lock the web thread from the main thread in a blocking fashion, thus temporarily freezing the run loop of the main thread. If the web thread is busy, e.g. while doing a long synchronous XMLHttpRequest , this may block the main thread for a long time. Is there a way to avoid this? If I could modify UIWebView, I'd just make the lock attempt non-blocking, but obviously that's

How to load a PDF from a Base64 string in a UIWebView

对着背影说爱祢 提交于 2020-01-22 01:10:24
问题 I'm using an API that is returning a Base64 string, something like this: data:application/pdf;base64,**BASE64STRING** Where BASE64STRING is what I need to display the PDF. So far I only created a Data object that gets the Base64 string: let data = Data(base64Encoded: BASE64STRING) And I tried to load it in the webview: webView.load(data!, mimeType: "application/pdf", textEncodingName: "", baseURL: URL(string: "")!) The problem is that I don't have a local PDF file, so I don't know what I

Set Cookie for UIWebView requests

寵の児 提交于 2020-01-21 05:03:04
问题 I want to embed an UIWebView into my MonoTouch application for an area that is not yet implemented natively. In order to authenticate with the website I want to set a cookie containing a key for the current session. I tried creating a NSDictionary with the properties for the Cookie and then create a new NSHttpCookie and add it to the NSHttpCookieStorage.SharedStorage . Sadly the cookie seems to be empty and not used for the request. An example of how to build be cookie with properties and a