[GH-ISSUE #63] Modify webview #41

Closed
opened 2026-03-03 16:45:06 +03:00 by kerem · 17 comments
Owner

Originally created by @hopye on GitHub (May 11, 2015).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/63

Guys, i know this is probably a lame question, but.. How can i modify de webview ? In my app i have everyrhing under a navigation crontoller, when login in with the oauthswift , i get ro this plain blank uiviewcontroller in blank, it takes the whole screen .. I get instagram textfields and interface almost overlapoing the status bar. I would like to get that webview viewconteoller inside of my navigstion controller etc

Originally created by @hopye on GitHub (May 11, 2015). Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/63 Guys, i know this is probably a lame question, but.. How can i modify de webview ? In my app i have everyrhing under a navigation crontoller, when login in with the oauthswift , i get ro this plain blank uiviewcontroller in blank, it takes the whole screen .. I get instagram textfields and interface almost overlapoing the status bar. I would like to get that webview viewconteoller inside of my navigstion controller etc
kerem closed this issue 2026-03-03 16:45:07 +03:00
Author
Owner

@phimage commented on GitHub (May 12, 2015):

I created a pull request that may fulfill your request.
https://github.com/dongri/OAuthSwift/pull/62
I add a handler instead of affecting web view controller in OAuth object where you can to control the web view displaying

<!-- gh-comment-id:101221339 --> @phimage commented on GitHub (May 12, 2015): I created a pull request that may fulfill your request. https://github.com/dongri/OAuthSwift/pull/62 I add a handler instead of affecting web view controller in OAuth object where you can to control the web view displaying
Author
Owner

@hopye commented on GitHub (May 12, 2015):

Can you please show me some code ??

<!-- gh-comment-id:101288260 --> @hopye commented on GitHub (May 12, 2015): Can you please show me some code ??
Author
Owner

@phimage commented on GitHub (May 12, 2015):

pull request has been merged :)

make your navigation controller(or other object) implement the new interface OAuthSwiftURLHandlerType
in the handle(url) method you can call method of your navigation controller to display the web view and also set the url to it

then assign the object to the oauthswift object

oauthswift.authorize_url_handler = <your object>
<!-- gh-comment-id:101299483 --> @phimage commented on GitHub (May 12, 2015): pull request has been merged :) make your navigation controller(or other object) implement the new interface `OAuthSwiftURLHandlerType` in the handle(url) method you can call method of your navigation controller to display the web view and also set the url to it then assign the object to the oauthswift object ``` swift oauthswift.authorize_url_handler = <your object> ```
Author
Owner

@hopye commented on GitHub (May 19, 2015):

phimage and dondri, im still using swift 1.1 , do you have the latest modified code for swift 1.1 ?

<!-- gh-comment-id:103693985 --> @hopye commented on GitHub (May 19, 2015): phimage and dondri, im still using swift 1.1 , do you have the latest modified code for swift 1.1 ?
Author
Owner

@phimage commented on GitHub (May 20, 2015):

No, why not upgrade Xcode ans Swift?
If you insist to have my commit on swift1.1 you must do some git

Clone the repo, make a branch at specific commit hash you use
Do a cherry pick on my commit hash and the following dondri fix. Fix all the issues and resolve conflits
Two much work for nothing!

I think issue can be closed

<!-- gh-comment-id:103750918 --> @phimage commented on GitHub (May 20, 2015): No, why not upgrade Xcode ans Swift? If you insist to have my commit on swift1.1 you must do some git Clone the repo, make a branch at specific commit hash you use Do a cherry pick on my commit hash and the following dondri fix. Fix all the issues and resolve conflits Two much work for nothing! I think issue can be closed
Author
Owner

@hopye commented on GitHub (May 20, 2015):

i downloaded te repo, basically modified all as! to as , modify the count(variable.utf16) to just variable.utf16Count , it did compiled..

<!-- gh-comment-id:103872018 --> @hopye commented on GitHub (May 20, 2015): i downloaded te repo, basically modified all as! to as , modify the count(variable.utf16) to just variable.utf16Count , it did compiled..
Author
Owner

@hopye commented on GitHub (May 20, 2015):

phimage, can you please modify my example on how to implement with the nav controller ? please..
https://github.com/hopye/OauthTest/tree/master/pruebaOAUTH

<!-- gh-comment-id:103887591 --> @hopye commented on GitHub (May 20, 2015): phimage, can you please modify my example on how to implement with the nav controller ? please.. https://github.com/hopye/OauthTest/tree/master/pruebaOAUTH
Author
Owner

@alexdd55 commented on GitHub (May 23, 2015):

@hopye how did you manage to do this.. for me its always opening safari for auth :(

<!-- gh-comment-id:104881473 --> @alexdd55 commented on GitHub (May 23, 2015): @hopye how did you manage to do this.. for me its always opening safari for auth :(
Author
Owner

@phimage commented on GitHub (May 23, 2015):

@alexdd55 did you open hopye test projet, I update with storyboard segue.
Other way is to watch current project sample, just affect authorize_url_handler

<!-- gh-comment-id:104884042 --> @phimage commented on GitHub (May 23, 2015): @alexdd55 did you open hopye test projet, I update with storyboard segue. Other way is to watch current project sample, just affect authorize_url_handler
Author
Owner

@alexdd55 commented on GitHub (May 23, 2015):

@phimage authorize_url_handler does not has any influence, also it seems it is not available for oauth1swift

<!-- gh-comment-id:104884447 --> @alexdd55 commented on GitHub (May 23, 2015): @phimage authorize_url_handler does not has any influence, also it seems it is not available for oauth1swift
Author
Owner

@phimage commented on GitHub (May 23, 2015):

it is available... maybe you use old code, just watch current code

just affect it with your own handler, not the default one OAuthSwiftOpenURLExternally.sharedInstance which open url with safari

the handler receive the url to open in webview, and is reponsible to display the webview (many way to do it and Demo and hopye project show it)

<!-- gh-comment-id:104923057 --> @phimage commented on GitHub (May 23, 2015): it is available... maybe you use old code, just watch current code just affect it with your own handler, not the default one OAuthSwiftOpenURLExternally.sharedInstance which open url with safari the handler receive the url to open in webview, and is reponsible to display the webview (many way to do it and Demo and hopye project show it)
Author
Owner

@alexdd55 commented on GitHub (May 23, 2015):

i think i made it work, i thought there might be some parameter that i missed

<!-- gh-comment-id:104929033 --> @alexdd55 commented on GitHub (May 23, 2015): i think i made it work, i thought there might be some parameter that i missed
Author
Owner

@hopye commented on GitHub (May 23, 2015):

@alex i will commit the example so you see, @phimage guided my code ;) . I did modify to work under swift 1.1 thought...

Sent from my iPhone

On May 23, 2015, at 6:45 AM, Alex M. notifications@github.com wrote:

@hopye how did you manage to do this.. for me its always opening safari for auth :(


Reply to this email directly or view it on GitHub.

<!-- gh-comment-id:104930974 --> @hopye commented on GitHub (May 23, 2015): @alex i will commit the example so you see, @phimage guided my code ;) . I did modify to work under swift 1.1 thought... Sent from my iPhone > On May 23, 2015, at 6:45 AM, Alex M. notifications@github.com wrote: > > @hopye how did you manage to do this.. for me its always opening safari for auth :( > > — > Reply to this email directly or view it on GitHub.
Author
Owner

@hopye commented on GitHub (May 23, 2015):

Let us know :) ;)

Sent from my iPhone

On May 23, 2015, at 1:39 PM, Alex M. notifications@github.com wrote:

i think i made it work, i thought there might be some parameter that i missed


Reply to this email directly or view it on GitHub.

<!-- gh-comment-id:104931080 --> @hopye commented on GitHub (May 23, 2015): Let us know :) ;) Sent from my iPhone > On May 23, 2015, at 1:39 PM, Alex M. notifications@github.com wrote: > > i think i made it work, i thought there might be some parameter that i missed > > — > Reply to this email directly or view it on GitHub.
Author
Owner

@alexdd55 commented on GitHub (May 25, 2015):

i had to make a couple of changes to make that work with Twitter OAuth1 + swifter, also also customized notitication so my own methods will be called.
no buildin handler worked for me whysoever. Can't update OAuth anymore from now on

<!-- gh-comment-id:105251817 --> @alexdd55 commented on GitHub (May 25, 2015): i had to make a couple of changes to make that work with Twitter OAuth1 + swifter, also also customized notitication so my own methods will be called. no buildin handler worked for me whysoever. Can't update OAuth anymore from now on
Author
Owner

@phimage commented on GitHub (May 25, 2015):

so make your fork, commit change then we can compare and you can merge from upstream if you want (if the change are not big)

notification work well on my project, handleOpenURL method must be called for that

I use two way
1 - normal way: my internal webview don't open url with scheme set in callback url( ex: oauth-swift), I open the callback url externally, and because the application is(must be) registered to open this type of url scheme, in appDelegate, like in the demo, the url is handled and passed to handleOpenURL
2 - my favorite way : in webview delegate when the url scheme of callback url is detected I call directly the handleOpenURL

<!-- gh-comment-id:105307792 --> @phimage commented on GitHub (May 25, 2015): so make your fork, commit change then we can compare and you can merge from upstream if you want (if the change are not big) notification work well on my project, handleOpenURL method must be called for that I use two way 1 - normal way: my internal webview don't open url with scheme set in callback url( ex: oauth-swift), I open the callback url externally, and because the application is(must be) registered to open this type of url scheme, in appDelegate, like in the demo, the url is handled and passed to handleOpenURL 2 - my favorite way : in webview delegate when the url scheme of callback url is detected I call directly the handleOpenURL
Author
Owner

@phimage commented on GitHub (Aug 7, 2015):

@hopye could you close the issue?

<!-- gh-comment-id:128829477 --> @phimage commented on GitHub (Aug 7, 2015): @hopye could you close the issue?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/OAuthSwift#41
No description provided.