sfsafariviewcontroller

ios 9 - xcode 7 - SFSafariViewController - Image Upload - Camera Black Screen

假装没事ソ 提交于 2019-12-21 03:36:34
问题 I'm working with SFSafariViewController, and ran into the following issue: The user is presented with an upload image button, when clicked the device properly displays multiple options, one of which is the camera. When the user selects the camera, it loads the camera but the screen is black, and the action button is greyed out. However if the user selects library, the selected image is properly uploaded. I did verify that the app has camera permissions turned on. I tried implementing the

SafariViewController: How to grab OAuth token from URL?

大城市里の小女人 提交于 2019-12-17 17:57:06
问题 Trying to use Facebook OAuth with the SafariViewController. First I open the authURL with SafariViewController, which if the user is logged in to Facebook on Safari, will redirect them and return an OAuth URL with the token for that specific service, e.g. Instagram RESPONSE: https://www.facebook.com/connect/login_success.html#access_token=BLAHTOKENRESPONSE&expires_in=5114338 When SafariViewController has redirected I want to grab the response URL and store it so I can grab the token. Here is

SFSafariViewController - Interacting with the parent app from a web-page

僤鯓⒐⒋嵵緔 提交于 2019-12-12 13:00:23
问题 I'm trying to research a way to load a web view controller into an iOS app, such that the web page can communicate data back up to the parent. Is this possible with SFSafariViewController ? Is there some mechanism like post-messaging, which will let me send data back up to the native app? Note: it's pretty important that I use SFSafariViewController, since I also need the web view to persist/share cookies with Safari. 回答1: Since SFSafariViewControllers are not sandboxed, like all other

Set Done Button Colour on SFSafariViewController

99封情书 提交于 2019-12-12 12:38:59
问题 I am using the SFSafariViewController to access a website called from a UITableViewController . Because my app has a very light feel attached to it, I have added the following line of code in the AppDelegate : self.window.tintColor = [UIColor whiteColor]; When running the SFSafariViewController , I get the following: Is there anyway I can change the colour of the Done button to Blue (as per default)? I've tried the following when calling the SFSafariViewController but to no effect: [self

iOS 9 - hide toolbar at bottom of web page loaded via SFSafariViewController

回眸只為那壹抹淺笑 提交于 2019-12-10 20:24:48
问题 I am attempting to hide the navigation toolbar(go back and forward, open in safari ...) that appears at the bottom of a page that loads a URL using the SFSafariViewController. I tried setting the following property on the navigation controller but it did not work/ [_safariViewController.navigationController setToolbarHidden:YES]; I am able to get this to hide when using a view controller that uses the UIWebView class. Any suggestions? Thanks 回答1: What you can do is adjust the frame of the

How do I use SFSafariViewController with a dark theme like this user?

安稳与你 提交于 2019-12-10 19:53:50
问题 I saw in a screenshot to a StackOverflow question that a user presented a darkened SafariViewController: https://stackoverflow.com/a/36099965/998117 How is this accomplished? I can't seem to get it to take effect using UIAppearance . 回答1: It depends on the Safari App , if you enable private browsing mode then it will change in your app also 来源: https://stackoverflow.com/questions/36551946/how-do-i-use-sfsafariviewcontroller-with-a-dark-theme-like-this-user

Handle popups/tabs in SFSafariViewController

一个人想着一个人 提交于 2019-12-10 15:57:50
问题 I'm implementing a SoundCloud login flow in my app. The app opens https://soundcloud.com/connect in an SFSafariViewController with a redirect_uri that uses my app's custom URL scheme to receive the response. It works fine for direct SoundCloud logins, but fails when trying to use their "Sign in with Google" button. In Safari, that button opens a new tab (popup on desktop) with a Google sign-in page, which then communicates back to the SoundCloud tab via postMessage . This login flow works

Is it possible to display a SFSafariViewController inside of a UITabBarController?

烈酒焚心 提交于 2019-12-10 02:07:59
问题 I want to load SFSafariViewController inside of a tab, so the tab bar is at the bottom of the entire Safari view. Is this possible? I tried this with no luck: [self.tabBarController presentViewController:sfController animated:YES completion:nil]; Is it required that the Safari view be full screen? 回答1: I was able to achieve this programmatically. They key to not have the UITabBar overlay on top of your UIViewController is to set translucent to NO : In your AppDelegate.m: @import

How to change Done Button Title on SFSafariviewController

与世无争的帅哥 提交于 2019-12-08 13:50:42
问题 I want to change the done button title appearance on SFSafariViewController navigation bar (iOS9.0 greater Versions). 回答1: https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller/dismissbuttonstyle From iOS 11 onwards we have option to choose the button style from below 3 options: case done case close case cancel 回答2: As Per Apple's documentation on SFSafariViewController, there does not appear to be a publicly-accessible way to change the title of the Done button. If

Is it possible to load local pdf file on SFSafariViewController?

假装没事ソ 提交于 2019-12-07 17:20:22
问题 I tried with WKWebViewController, but still not working. url = [[NSBundle mainBundle] URLForResource:@"manual_eos_1d_x" withExtension:@"pdf"]; WKWebViewController * controllerweb = (WKWebViewController *)[segue destinationViewController]; controllerweb.url = url; 回答1: It is not possible to show local pdf in SFSafariViewController, but it is possible to display it in a WKWebView. SFSafariViewController only support http and https schemes. From SFSafariViewController documentation: If your app