dfmuir / kinwebbrowser Goto Github PK
View Code? Open in Web Editor NEWA web browser module for your iOS apps.
License: Other
A web browser module for your iOS apps.
License: Other
Could you write a version by swift? Manys thanks.
Steps to reproduce:
when I tried to load an url from itunes such "https://itunes.apple.com/us/album/mobius-pink/id383268386" . it seems the browser refuse to load the url .
this is my code
@IBAction func Buy(sender: AnyObject) {
let con = KINWebBrowserViewController()
let url = NSURL(string: "https://itunes.apple.com/us/album/mobius-pink/id383268386")
println(url)
con.loadURL(url)
self.navigationController?.pushViewController(con, animated: true)
}
It looks like a few API rules have changed with iOS 9, which leads to a crash when users press the share button.
I'll try to find some time to submit a PR next week
transform-only layer, will have no effect
2015-08-13 15:52:54.393 itooch-awsome-project[66203:13062248] -canOpenURL: failed for URL: "about:blank" - error: "This app is not allowed to query for scheme about"
2015-08-13 15:53:03.061 itooch-awsome-project[66203:13062248] -canOpenURL: failed for URL: "googlechrome-x-callback://" - error: "This app is not allowed to query for scheme googlechrome-x-callback"
2015-08-13 15:53:03.133itooch-awsome-project[66203:13062248] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSBundle initWithURL:]: nil URL argument'
*** First throw call stack:
(
0 CoreFoundation 0x0000000106aeb9b5 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000106173deb objc_exception_throw + 48
2 CoreFoundation 0x0000000106aeb8ed +[NSException raise:format:] + 205
3 Foundation 0x0000000105dade0f -[NSBundle initWithURL:] + 87
4 Foundation 0x0000000105dadebe +[NSBundle bundleWithURL:] + 45
5 TUSafariActivity 0x0000000105c684e3 -[TUSafariActivity activityTitle] + 147
6 UIKit 0x00000001081393d6 -[UIActivityGroupViewController _titleTextForActivity:] + 125
7 UIKit 0x000000010813a570 -[UIActivityGroupViewController collectionView:layout:preferredSizeForItemAtIndexPath:] + 65
8 UIKit 0x000000010847bbd3 __81-[_UIActivityGroupViewFlowLayout _evaluatePreferredItemSizeForItemsAtIndexPaths:]_block_invoke + 40
9 CoreFoundation 0x0000000106a1a552 __53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 114
10 CoreFoundation 0x0000000106a19c6f -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 239
11 UIKit 0x000000010847bb1c -[_UIActivityGroupViewFlowLayout _evaluatePreferredItemSizeForItemsAtIndexPaths:] + 291
12 UIKit 0x000000010847a8d1 -[_UIActivityGroupViewFlowLayout prepareLayout] + 130
13 UIKit 0x000000010841c31d -[UICollectionViewData _prepareToLoadData] + 67
14 UIKit 0x000000010841caa6 -[UICollectionViewData validateLayoutInRect:] + 53
15 UIKit 0x00000001083ce1a9 -[UICollectionView layoutSubviews] + 196
16 UIKit 0x0000000107c94a3b -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 710
17 QuartzCore 0x0000000107aa236a -[CALayer layoutSublayers] + 146
18 QuartzCore 0x0000000107a96bd0 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
19 UIKit 0x0000000107c853d8 -[UIView(Hierarchy) layoutBelowIfNeeded] + 1083
20 UIKit 0x0000000108492968 __45-[_UIAnimationCoordinator animateTransition:]_block_invoke + 32
21 UIKit 0x0000000107c8b700 +[UIView(UIViewAnimationWithBlocks) _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:] + 582
22 UIKit 0x0000000107c8b9d0 +[UIView(UIViewAnimationWithBlocks) animateWithDuration:delay:usingSpringWithDamping:initialSpringVelocity:options:animations:completion:] + 187
23 UIKit 0x0000000108492911 -[_UIAnimationCoordinator animateTransition:] + 471
24 UIKit 0x000000010849225e -[_UIAnimationCoordinator animate] + 165
25 UIKit 0x0000000107ee4c4c -[UIAlertController _contentViewControllerWillTransitionToSize:withAnimations:] + 1071
26 UIKit 0x00000001085247a2 -[_UIAlertControllerView _sizeOfContentViewControllerChanged] + 1009
27 UIKit 0x0000000107ee1792 -[UIAlertController viewDidLoad] + 659
28 UIKit 0x0000000107d6dd05 -[UIViewController loadViewIfRequired] + 877
29 UIKit 0x0000000107d6e054 -[UIViewController view] + 27
30 UIKit 0x0000000108485885 -[UIActivityViewController viewDidLoad] + 1266
31 UIKit 0x0000000107d6dd05 -[UIViewController loadViewIfRequired] + 877
32 UIKit 0x0000000107d6e054 -[UIViewController view] + 27
33 UIKit 0x0000000107d878b2 -[UIViewController _setPresentationController:] + 100
34 UIKit 0x0000000107d7edfc -[UIViewController _presentViewController:modalSourceViewController:presentationController:animationController:interactionController:completion:] + 1437
35 UIKit 0x0000000107d8097c -[UIViewController _presentViewController:withAnimationController:completion:] + 4682
36 UIKit 0x0000000107d834b3 -[UIViewController presentViewController:animated:completion:] + 343
37 UIKit 0x000000010836b54f -[UIPopoverController presentPopoverFromBarButtonItem:permittedArrowDirections:animated:] + 271
38 KINWebBrowser 0x0000000105955bfa __51-[KINWebBrowserViewController actionButtonPressed:]_block_invoke + 954
39 libdispatch.dylib 0x00000001096dffad _dispatch_call_block_and_release + 12
40 libdispatch.dylib 0x00000001097004bb _dispatch_client_callout + 8
41 libdispatch.dylib 0x00000001096e83ff _dispatch_main_queue_callback_4CF + 1738
42 CoreFoundation 0x0000000106a4be69 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
43 CoreFoundation 0x0000000106a0d3b9 __CFRunLoopRun + 2073
44 CoreFoundation 0x0000000106a0c918 CFRunLoopRunSpecific + 488
45 GraphicsServices 0x000000010b167ad2 GSEventRunModal + 161
46 UIKit 0x0000000107be799e UIApplicationMain + 171
47 itooch-messenger 0x000000010469d19d main + 109
48 libdyld.dylib 0x000000010973592d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Hi;
I just want to use toolbar. Is there are way to hide it? I looked a bit but couldn't find it.
Thnx already.
I create a simple html file like the photo below
I use the KINWebBrowser to open the above html file, but i can't get result from "Send Email", "Call me" and "Link to App Store". The error logs shown
error Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo=0x7a981220 {NSErrorFailingURLStringKey=itms://itunes.apple.com/us/app/apple-store/id375380948?mt=8, NSErrorFailingURLKey=itms://itunes.apple.com/us/app/apple-store/id375380948?mt=8, NSLocalizedDescription=unsupported URL, _WKRecoveryAttempterErrorKey=<WKReloadFrameErrorRecoveryAttempter: 0x7a978ba0>}
The code for open KINWebBrowser:
let webBrowserNavigationController = KINWebBrowserViewController.navigationControllerWithWebBrowser() var webViewController = KINWebBrowserViewController() webViewController = webBrowserNavigationController!.rootWebBrowser() webViewController.showsURLInNavigationBar = true webViewController.showsPageTitleInNavigationBar = true webViewController.loadURLString(urlString) viewController.present(webBrowserNavigationController!, animated: true, completion: nil)
How to solve that?
Thank you very much
I am using this lib. App crash when we open a YouTube link and tap on YouTube play button.
When subclassing the web browser view controller in Swift, the library seems to not access the resources anymore, making back / forward bar button images disappear.
When we load new instance of KINWebBrowser it shows white color, but I need to change it to black and tried following but no success.
webBrowser.view.backgroundColor = [UIColor darkTextColor]; webBrowser.wkWebView.backgroundColor = [UIColor darkTextColor]; webBrowser.uiWebView.backgroundColor = [UIColor darkTextColor];
Regards
In example, when calling modally:
Replace navigationControllerWithRootWebBrowserViewController with navigationControllerWithWebBrowser
...
Hi @dfmuir
I'm gonna use KINWebBrowser in my app, but one thing is interesting.
Does it uses any private APIs or another 'dirty' tricks that may cause app rejection during AppStore submission?
Best
Hello, I use the KINWebBrowser to load my web page, when using web log in, add the cookies, web pages, there is no response. Here is my code, the current class inherited KINWebBrowserViewController
NSURL *url=[NSURL URLWithString:@"http://My server login address"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
NSString *cookieStr = [NSString stringWithFormat:@"JSESSIONID=%@;Path=/JBIZ",ShareManager.cooks];
[request addValue:cookieStr forHTTPHeaderField:@"Cookie"];
[self LoadRequst:request];
This is a web page and load cookies to complete the function of the land, but if only load Google, there is no problem
Hey, more like a feature request
wouldnt it be neat if we integrate handoff?
kickstart here
https://github.com/splinesoft/SPLUserActivity
The app is crashing in KINWebBrowserViewController.m
at line #373
(in method progressBarStopLoading
) if the modal view controller is dismissed before the web content has finished loading.
Actually, the UIWebView
still sends callbacks to its delegate even father the latter has been destroyed. This is because the delegate
property of a UIWebView
is in assign
mode instead of weak
, which does not nullify the delegate
property automatically.
You should therefore set the delegate
property to nil
in the dealloc
method of the KINWebBrowserViewController
class.
Please post a Cocoapods update as soon as you can.
Cheers.
when i load any URL with URL scheme "http://" it works fine but when I load anything with out URL scheme like "www.google.in" it goes to fail to load delegate method.
Hi;
I could not get it work with iOS 9. HTTP links doesn't work.
I've added the property below to my plist file it also didn't help.
<key>NSAllowArbitraryLoads</key>
<true/>
Do you have any idea about this problem?
Hi.
Today, I install pods but cannot install this module.
because maybe [davbeck/TUSafariActivity] require iOS8.
But in this project's readme written support iOS7.
Can I use this module in iOS7 project?
Hi,
Im trying to change the back text color as well as the back button arrow color. I've trying the following, but i has no effect.
let webBrowser = KINWebBrowserViewController()
webBrowser.tintColor = UIColor.redColor()
webBrowser.barTintColor = UIColor.redColor()
webBrowser.showsPageTitleInNavigationBar = false
webBrowser.loadURL(url)
self.navigationController?.pushViewController(webBrowser, animated: true)
if theres no internet connection it should throw up some kind of error
To reproduce it - just try to load web page under iOS 9.
UIProgressView instance is hidden, so UX is bad while user waiting for the web content.
I guess this is because of something weird issue with KVO-ing 'estimatedProgress' property on WKWebView. Note that fake progress view also doesn't work with UIWebView.
Instead of
+ (UINavigationController *)navigationControllerWithWebBrowser {
KINWebBrowserViewController *webBrowserViewController = [[KINWebBrowserViewController alloc] initWithConfiguration:nil];
return [self navigationControllerWithBrowser:webBrowserViewController];
}
If this was, instead:
+ (UINavigationController *)navigationControllerWithWebBrowser {
KINWebBrowserViewController *webBrowserViewController = [[self alloc] initWithConfiguration:nil];
return [self navigationControllerWithBrowser:webBrowserViewController];
}
Then subclasses of KINWebBrowserViewController
would be returned from these methods.
I'm having a problem with two links that seem to be related to the WKWebView change in the latest pod version.
Specifically, the "location/map" button and the "phone" button both have stopped responding:
http://appviews.gatewaypeople.com/campus-locations
Any help would be appreciated. Thx!
Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior
It would be very useful if you can add initializer with chance to select what to use UIWebView or WKWebView. WKWebView know doesn't use apps cookies and useless in many situations.
I have custom navigation bar but when i use KINweb browser it initialise the navigation controller which over ride my custom NAVBAR
how to change "Done" bar button Item from right to left?
When you select a link in the rss feed it goes to the page just fine. The stop, refresh, back and forward buttons work as they should. However, when you select the share button in the bottom right it crashes the app. Any solution or ideas why?
use cocoapods install version error
Using KINWebBrowser (0.2.5)
but the newest verson is 1.3.2
Hi, really like where you are going with this project, but I'm having issues with navigation and toolbar.
first, in a storyboard with auto layout. Push web browser from a tableViewController inside of a NavigationBar stack. Using top navigation bar, not using bottom toolbar.
Looks great and loads. When I go back the navigation bar is hidden and the tool bar is still present, although the bar buttons are gone.
Since the navigation bar is gone, go back into web browser, then back again. Now when I comeback and every subsequent time, the navigation bar is back working like it should. However, the tool bar continues to be present and stays present even when I dismiss the original tableView.
Hello,
when we're deploying a new app using the KINWebBrowser, we get this message:
https://developer.apple.com/news/?id=12232019b
If your app still embeds web content using the deprecated UIWebView API, we strongly encourage you to update to WKWebView as soon as possible for improved security and reliability. WKWebView ensures that compromised web content doesn’t affect the rest of an app by limiting web processing to the app’s web view. And it’s supported in iOS and macOS, and by Mac Catalyst.
The App Store will no longer accept new apps using UIWebView as of April 2020 and app updates using UIWebView as of December 2020.
We see that in the WKWebView Library you check if WKWebView is enabled and do not use the UIWebView in this case, but for the automatic review I think it's enough for Apple that the UIWebView class has any reference in the code.
- (id)initWithConfiguration:(WKWebViewConfiguration *)configuration {
self = [super init];
if(self) {
if([WKWebView class]) {
if(configuration) {
self.wkWebView = [[WKWebView alloc] initWithFrame:CGRectZero configuration:configuration];
}
else {
self.wkWebView = [[WKWebView alloc] init];
}
}
else {
self.uiWebView = [[UIWebView alloc] init];
}
self.actionButtonHidden = NO;
self.showsURLInNavigationBar = NO;
self.showsPageTitleInNavigationBar = YES;
self.externalAppPermissionAlertView = [[UIAlertView alloc] initWithTitle:@"Leave this app?" message:@"This web page is trying to open an outside app. Are you sure you want to open it?" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Open App", nil];
}
return self;
}
so I think the best would be if you drop the UIWebView integration and release a new version without?
Does KINWebBrowser
's webkit implementation allow access to web preferences so that one can disable SOP across iframes that have different origins? Or is it just a view controller built over the standard iOS Webkit library?
I was looking for a way to set specify the URL that would be shared by the action button. I found the customActivityItems array instead.
customActivityItems suggests an array that will be used as the activity view controller's activity items, while this array will be used as the activity view controller's application activities.
if(self.customActivityItems != nil) {
[activities addObjectsFromArray:self.customActivityItems];
}
UIActivityViewController *controller = [[UIActivityViewController alloc] initWithActivityItems:@[URLForActivityItem] applicationActivities:activities];
Suggestion: Rename customActivityItems to customApplicationActivities
or at least warn about this confusing in a comment.
* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[**NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]'
* First throw call stack:
(
0 CoreFoundation 0x000000010fd9f3f5 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010fa38bb7 objc_exception_throw + 45
2 CoreFoundation 0x000000010fc658b8 -[__NSPlaceholderArray initWithObjects:count:] + 360
3 CoreFoundation 0x000000010fcc4a24 +[NSArray arrayWithObjects:count:] + 52
4 islami 0x000000010bc7c866 __51-[KINWebBrowserViewController actionButtonPressed:]_block_invoke + 230
5 libdispatch.dylib 0x0000000110d5fcc6 _dispatch_call_block_and_release + 12
6 libdispatch.dylib 0x0000000110d7d7f4 _dispatch_client_callout + 8
7 libdispatch.dylib 0x0000000110d66991 _dispatch_main_queue_callback_4CF + 956
8 CoreFoundation 0x000000010fd07569 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9
9 CoreFoundation 0x000000010fcca46b __CFRunLoopRun + 2043
10 CoreFoundation 0x000000010fcc9a06 CFRunLoopRunSpecific + 470
11 GraphicsServices 0x0000000111f549f0 GSEventRunModal + 161
12 UIKit 0x000000010e131550 UIApplicationMain + 1282
13 islami 0x000000010bb7b8d3 main + 115
14 libdyld.dylib 0x0000000110db2145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
To the default KINWebBrowser with the action button shown:
This is what you will get on iPad when running KINWebBrowser in a UISplitViewController with a UINavigationController:
Interestingly, the same code works on iPhone, no issues:
I just downloaded this project in Xcode 6 and when I try to compile this these are the errors that I get. How do I fix it?
diff: /../Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
I am using this and I'm presenting as shown in example app
It's working fine
however at some places in my app it's opening external app/browser just immediately after presenting this.
Anyone have any idea what could be the issue ?
Fatal Exception: NSRangeException
*** -[__NSCFConstantString substringToIndex:]: Index 18446744073709551615 out of bounds; string length 0
Fatal Exception: NSRangeException
0 CoreFoundation 0x18fb42fe0 __exceptionPreprocess
1 libobjc.A.dylib 0x18e5a4538 objc_exception_throw
2 CoreFoundation 0x18fb42f28 -[NSException initWithCoder:]
3 Foundation 0x190549968 -[NSString substringToIndex:]
4 KINWebBrowser 0x100a85670 -[KINWebBrowserViewController updateToolbarState] (KINWebBrowserViewController.m:376)
5 KINWebBrowser 0x100a8490c -[KINWebBrowserViewController webView:didStartProvisionalNavigation:] (KINWebBrowserViewController.m:283)
6 WebKit 0x1992164c0 WebKit::NavigationState::NavigationClient::didStartProvisionalNavigation(WebKit::WebPageProxy&, API::Navigation*, API::Object*)
7 WebKit 0x199356478 WebKit::WebPageProxy::didStartProvisionalLoadForFrame(unsigned long long, unsigned long long, WTF::String const&, WTF::String const&, WebKit::UserData const&)
8 WebKit 0x199371918 void IPC::handleMessage<Messages::WebPageProxy::DidStartProvisionalLoadForFrame, WebKit::WebPageProxy, void (WebKit::WebPageProxy::*)(unsigned long long, unsigned long long, WTF::String const&, WTF::String const&, WebKit::UserData const&)>(IPC::Decoder&, WebKit::WebPageProxy*, void (WebKit::WebPageProxy::*)(unsigned long long, unsigned long long, WTF::String const&, WTF::String const&, WebKit::UserData const&))
9 WebKit 0x1992137a8 IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&, IPC::Decoder&)
10 WebKit 0x1993bc324 WebKit::WebProcessProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&)
11 WebKit 0x1991d965c IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >)
12 WebKit 0x1991dbe54 IPC::Connection::dispatchOneMessage()
13 JavaScriptCore 0x1943bbf44 WTF::RunLoop::performWork()
14 JavaScriptCore 0x1943bc21c WTF::RunLoop::performWork(void*)
15 CoreFoundation 0x18faf142c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
16 CoreFoundation 0x18faf0d9c __CFRunLoopDoSources0
17 CoreFoundation 0x18faee9a8 __CFRunLoopRun
18 CoreFoundation 0x18fa1eda4 CFRunLoopRunSpecific
19 GraphicsServices 0x191489074 GSEventRunModal
20 UIKit 0x195cd9c9c UIApplicationMain
21 ForceFieldParent 0x100108aec main (main.m:16)
22 libdyld.dylib 0x18ea2d59c start
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.