mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-26 12:45:52 +03:00
[GH-ISSUE #632] Retain error -10 only when assigning authorizeURLHandler? #413
Labels
No labels
bug
cocoapod
duplicate
enhancement
feature-request
help wanted
help wanted
invalid
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/OAuthSwift#413
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @serenapascual on GitHub (Nov 9, 2020).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/632
Description:
When I do not set authorizeURLHandler and allow the URL to open in an external browser, the authorization is successful. However, once I try to use SafariURLHandler, I get a retain error:
The operation couldn’t be completed. (OAuthSwiftError error -10.)Here is my code:
I have also tried creating a property for the SafariURLHandler instance and storing that there, but doing so did not help.
OAuth Provider? (Twitter, Github, ..):
Reddit
OAuth Version:
OS (Please fill the version) :
Installation method:
Library version:
Xcode version:
11.4 (Swift 5.2)
11.x (Swift 5.1)
10.x (Swift 5.0)
other: 12.1 (Swift 5.3)
objective c
@phimage commented on GitHub (Nov 10, 2020):
it's seems weird
do you have dismissed AccountViewController ?
if not we will try to force "retain"
could you try to assign to a class variable the return of authorise instead of
let _ =or reference self in callback, for instance by extracting it to afunction
and call
self.log()in callback (yes it is crappy because you must use [weak self] to not retain ad cause memory leak)@serenapascual commented on GitHub (Nov 12, 2020):
Hi Eric, thank you for your prompt and helpful response.
No dismissal.
I tried this and the same error occurs.
It took me a while to figure this out (sorry - new to Swift), and I think it works! At least, that is when I don't use [weak self], which causes self to evaluate to nil during callback. Do you have any tips?
This is what I've added that leads to a successful result.
@phimage commented on GitHub (Apr 29, 2021):
Close Stale Issue