Developer Forums

RSS for tag

Ask questions about how to use the Apple Developer Forums. Discuss forums bugs and enhancements requests that you’ve filed via Feedback Assistant.

Posts under Developer Forums subtopic

Post

Replies

Boosts

Views

Activity

Can't register for Developer Forum - Unauthorized error
One of our developers cannot seem to Register in the Developer Forum. While the user name is being entered in the registration screen, the following error appears: Unauthorized - Error appears during the process of typing the Username in the field, no other fields are completed & 'Continue' has not been tapped. Developer has full admin access. Any insight into why this might be happening?
3
0
2.3k
Jan ’23
Forums are missing a category for hiring developers
A category connecting Apple developers with companies looking to hire Apple developers would be great. Best make two subforums, similar to Hackernews: •  Freelancer? Seeking freelancer? (where developers can look for job offers) and • Who is hiring? (where companies can look for developers) yeah there are lots of other job boards as well as freelancing platforms but it is hard to find good iOS devs there and practically impossible to find any macOS developers...
1
0
1.6k
Dec ’22
How to remove the "solved" badge from an answer?
I mistakenly marked an answer as "solved" while it actually not solved yet. The question is at https://developer.apple.com/forums/thread/662602 I noticed that I can't remove the "solved" badge. Is there a forum administrator that can do that for me? I don't wish to resubmit the question just in order to get rid of the "solved" badge and loose all responses.
4
0
2.3k
Nov ’22
Why was my post removed?
Hi, I had a post on here regarding App Store Review Guidelines 5.1.1(ix) and if anyone knew what Apple considers a highly-regulated industry to be (only examples are listed in the guideline). My post was removed for some reason. I didn't receive a notification or email saying why. It just says I haven't made any posts yet, which isn't true. There's no identical question/answer on the forums already. I do believe the post was helpful, as it took me a while to get an answer from App Review. I shared the answer I received from them - that the examples listed in 5.1.1(ix) are the only industries Apple considers to be highly regulated - to save other developers the trouble. Did I use the forums incorrectly? Is this a forums bug? Thanks
8
0
1.1k
Nov ’22
Why is iOS Development so Convoluted?
Ok, I'm clearly missing something with iOS development. I've been developer for over 10 years and I'm jumping into iOS development now and absolutely everything seems to be a near impossible task to accomplish, when it is literally 2-3 lines of code to implement something using HTML/CSS/Javascript/Java etc. it seems to be a days worth of time trying to figure out how to actually implement something so unbelievably simple. Let me start with a few examples;- Responsive design: This seems to be focused around Constraints (but not to 'margins' or this breaks everything), yet this then breaks when you try and add something else into the middle and move items around in the storyboard, so you have to reset all the constraints and start again. Time and time again. What am I missing here? - Picker View: This is a simple select/option in HTML. I've yet to find any working code online that can implement this. I'm just looking for a simple Country selector to allow users to choose details - Date View: I haven't event started looking at this yet, I'm anticipating even more problems with this when it comes to date formats / working with dates etc. The offical documentation from Apple is abysmal and every tutorial you find online is out of date or doesn't work. I'm at a loss here. I'm seriously thinking of just giving up on iOS development for a couple of years until the ecosystem grows up a bit and is possible to understand and implement the very basic things. Am I missing something here while tearing my hair out? Or is it really this bad? Tips, guides, pointers, all useful. Any pros out here, please, point me in the right direction to pick this up quickly. This post is out of frustration after reading through all of the official guidelines and many tutorials online too. Another prime example of this.... posting this question - having to figure out what on earth 'enter the name of a place' means, England?
3
0
2.2k
Nov ’22
App Auth: error Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior
I'm using AppAuth pod to handle user login with Azure in my app. I followed this sample : https://github.com/openid/AppAuth-iOS/tree/master/Examples which works fine until my authentication code expires. It works ok for the 1st connection and all the time while the authenticationCode is still valid. Once it expires, I briefly see the alert to "Sign in" and then it disappears and I get the error :"Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior". (It works fine again if I delete the app and re-install it.) I read that I should "Ensure that there is a strong reference to the SFAuthenticationSession instance when the session is in progress.". And I think that's the case with the currentFlow declared in AppDelegate. (see code below) Did anyone ever faced and solved this issue ?import UIKit import AppAuth import AuthenticationServices var isLoginViewOn: Bool = false var isConnectionBtnPressed: Bool = false class ContainerController: UIViewController { // MARKS : Properties private var authState: OIDAuthState? var token: String? var menuController: MenuController! var homeController: HomeController! var panView: UIView! var isExpanded = false var isLoginOut: Bool = false let loginView: UIImageView = { let v = UIImageView() v.image = UIImage(named: "") v.contentMode = .scaleAspectFit return v }() let connexionButton: UIButton = { let b = UIButton(frame: CGRect(x: 100, y: 100, width: 100, height: 50)) return b }() let logoutBtn: UIButton = { let b = UIButton(frame: CGRect(x: 100, y: 100, width: 100, height: 50)) b.setTitle("déconnexion", for: .normal) return b }() override func viewDidLoad() { super.viewDidLoad() chekToken() } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) if isLoginViewOn == true { if isConnectionBtnPressed == false { self.connexionButton.sendActions(for: .touchUpInside) isLoginViewOn = false } } } override func viewWillLayoutSubviews() { super.viewWillLayoutSubviews() view.layoutIfNeeded() view.layoutSubviews() } ///////////////////////////////////////////////////////////////////////////// /// SET UP //// ///////////////////////////////////////////////////////////////////////////// func setupLoginView() { print("setup loginView") isLoginViewOn = true view.addSubview(loginView) view.addSubview(connexionButton) loginView.translatesAutoresizingMaskIntoConstraints = false connexionButton.translatesAutoresizingMaskIntoConstraints = false [ loginView.centerYAnchor.constraint(equalTo: view.centerYAnchor), loginView.centerXAnchor.constraint(equalTo: view.centerXAnchor), loginView.widthAnchor.constraint(equalToConstant: 250), loginView.heightAnchor.constraint(equalToConstant: 128), connexionButton.bottomAnchor.constraint(equalTo: loginView.topAnchor, constant: -50), connexionButton.centerXAnchor.constraint(equalTo: view.centerXAnchor), connexionButton.widthAnchor.constraint(equalToConstant: 200), connexionButton.heightAnchor.constraint(equalToConstant: 50), ].forEach{$0.isActive = true } connexionButton.addTarget(self, action: #selector(buttonAction(_:)), for: .touchUpInside) if isConnectionBtnPressed == false { self.connexionButton.sendActions(for: .touchUpInside) } } func setupHomeController() { homeController = HomeController() homeController.delegate = self addControllerAsChild(forController: homeController) setupPanView(forController: homeController) } }The login part :extension ContainerController { @objc func buttonAction(_ sender: UIButton){ self.login() isConnectionBtnPressed = true } func checkToken() { guard let data = UserDefaults.standard.object(forKey: kAppAuthExampleAuthStateKey) as? Data else { setupLoginView() return } do { let authState = try NSKeyedUnarchiver.unarchivedObject(ofClass: OIDAuthState.self, from: data) self.setAuthState(authState) self.getUserInfo() } catch { print("catch loadState: \(error)") } } func login() { print("Got configuration: \(config)") if let clientId = kClientID { self.doAuthWithAutoCodeExchange(configuration: config, clientID: clientId, clientSecret: nil) } } func doAuthWithAutoCodeExchange(configuration: OIDServiceConfiguration, clientID: String, clientSecret: String?) { guard let redirectURI = URL(string: kRedirectURI) else { print("Error creating URL for : \(kRedirectURI)") return } guard let appDelegate = UIApplication.shared.delegate as? AppDelegate else { print("Error accessing AppDelegate") return } // builds authentication request let request = OIDAuthorizationRequest(configuration: configuration, clientId: clientID, clientSecret: clientSecret, scopes: [OIDScopeOpenID, OIDScopeProfile, "--kclientID--", "offline_access"], redirectURL: redirectURI, responseType: OIDResponseTypeCode, additionalParameters: ["p": "b2c_1_my_app_sign_in_up"]) // performs authentication request print("Initiating authorization request with scope: \(request.scope ?? "DEFAULT_SCOPE")") appDelegate.currentAuthorizationFlow = OIDAuthState.authState(byPresenting: request, presenting: self) { authState, error in if let authState = authState { self.setAuthState(authState) print("Got authorization tokens. Access token") self.getUserInfo() } else { self.setAuthState(nil) print("Authorization error: \(error?.localizedDescription ?? "DEFAULT_ERROR")") } } } func getUserInfo() { let currentAccessToken: String? = self.authState?.lastTokenResponse?.accessToken self.authState?.performAction() { (accessToken, idToken, error) in if error != nil { CoreDataHelper().deleteIDToken("idToken") AuthenticationService().login() print("Error fetching fresh tokens: \(error?.localizedDescription ?? "ERROR")") return } guard let accessToken = accessToken else { print("Error getting accessToken") return } if currentAccessToken != accessToken { print("Access token was refreshed automatically ") self.token = currentAccessToken } else { print("Access token was fresh and not updated ") self.token = accessToken } self.loginView.removeFromSuperview() self.setupHomeController() } } func saveState() { var data: Data? = nil if let authState = self.authState { do { data = try NSKeyedArchiver.archivedData(withRootObject: authState, requiringSecureCoding: false) } catch { print("catch saveState: \(error)") } } UserDefaults.standard.set(data, forKey: kAppAuthExampleAuthStateKey) UserDefaults.standard.synchronize() } func setAuthState(_ authState: OIDAuthState?) { if (self.authState == authState) { return; } self.authState = authState; self.authState?.stateChangeDelegate = self; self.saveState() } } extension ContainerController: ASWebAuthenticationPresentationContextProviding { func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor { return view.window! }And AppDelegate above the class declaration :let kClientID: String? = "my client id"; let kRedirectURI: String = "myapp.test.authent://oauth/redirect"; let kAppAuthExampleAuthStateKey: String = "authState"; let authorizationEndpoint = URL(string: "https://login.microsoftonline.com/myapp.onmicrosoft.com/oauth2/v2.0/authorize?p=b2c_1_myaapp_sign_in_up")! let tokenEndpoint = URL(string: "https://login.microsoftonline.com/myapp.onmicrosoft.com/oauth2/v2.0/token?p=b2c_1_myaapp_sign_in_up")! let config = OIDServiceConfiguration(authorizationEndpoint: authorizationEndpoint, tokenEndpoint: tokenEndpoint)And in the class : var currentAuthorizationFlow: OIDExternalUserAgentSession? func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { // Sends the URL to the current authorization flow (if any) which will // process it if it relates to an authorization response. if let authorizationFlow = self.currentAuthorizationFlow, authorizationFlow.resumeExternalUserAgentFlow(with: url) { self.currentAuthorizationFlow = nil return true } return false }Any suggestion welcomed 🙂
6
0
4.8k
Oct ’22
So @Apple - What're you going to do with the ongoing spam & consumers being able to post here
Access to these forums should be based on paid agreements on file to the Apple Developer Program, and this will prevent these social engineers from trying to game the board and members with junk. Apple, you pride yourself on security & privacy. How about fixing the access to these forums to only developers with a contract on file and approved students only?
7
3
1.7k
Oct ’22
I can't use the word "*****", but adverts for prostitutes are OK?
Dear Apple, I know that content moderation is difficult, but surely you can do better than this. You seem to have a very crude profanity filter that ****s out words with perfectly normal dual uses, but you can't stop the constant stream of adverts for c all girls in D ubai. Come on, sort it out! (And amazingly, this message is rejected as "You have included content that is not permitted" when I wrote "c all girls in D ubai", until I added the spaces!) (The word in the title is a small metal item used to join pieces of wood together, which can also be used as a euphemism for something couples do.)
6
0
1.3k
Sep ’22
This "Developer Forums" site is impossible to search.
I noticed a search for one word produces (for instance) 100 results and a search for two words produces a 1000 results. It seems to be looking for one OR the other and no option to search for both both. Adding quotes around both also does nothing. This is basic search tooling, and it seems to be broken. I found it to be completely impossible to search for, for instance: "ARKit" and "Safari" Perhaps is there a better way to search? Any suggestions? Maybe a Google search for these terms also including "Developer forums" and "Apple"??
3
0
1.1k
Sep ’22
So many spam posts recently
... all talking about customer care numbers. Maybe Apple should make these Dev Forums just for signed-in Developers? If a Developer spams, they can be blocked. But if just anyone can register and post, they can spam, get banned, then start a new account. Or, Apple should implement some way of blocking the spam before it gets posted. I really don't understand what these spammers think they're getting out of doing this? Who is going to look through the forums and think, "Oh, a customer care number for something I've never heard of? I should phone that immediately!" Really does prove that spammers are dumb.
1
2
1k
Sep ’22
Unable to see some replies unless logged in
I can't see certain replies to posts unless I'm logged in. Example #1: In this post - https://developer.apple.com/forums/thread/652207, I can't see the 1 reply unless I'm logged in. Example #2: In this post - https://developer.apple.com/forums/thread/130103, the 4th reply (which I posted) doesn't display unless I'm logged in. If I'm not logged in, I can only see 3 out of 4 replies. Is this a bug or something related to different levels of moderation?
3
0
1.5k
Aug ’22
Let people post external links in answers
Many people post questions on these forums that have detailed answers in articles and blog posts from people who aren't Apple employees. It would be nice to link to these articles when answering questions on these forums. But if you try to link to a non-Apple URL, you get an error message that the domain is invalid. To post the link, you have to remove the https://www part of the link. This forces people to cut and paste the URL into the browser to read the article when they should get a clickable link. If you're worried about spam links, then either require posters to have a minimum reputation score or have a minimum number of posts to submit answers with external links.
8
1
1.9k
Aug ’22
DATA
Hello. I have data I need to add to my new app. Below is a simple example of my plants and the data I am adding to my app Aloe Vera a. Medicinal Properties (skin healer) b. How to harvest (Cut from the middle) c. How much water does it need (once every three days) d. Recipe (cut the leaf, use the gel inside for your rash) Almond a. Medicinal Properties (skin healer) b. How to harvest (cut the young leaves) c. How much water does it need (daily) d. Recipe (soak in water overnight, rinse, blend) Raspberry a. Medicinal Properties (skin healer) b. How to harvest (cut from mid branch) c. How much water does it need (twice a day) d. Recipe (mix raspberry with coconut water and blend.) I understand that the above date (information about the four plants) needs to be organized in a Numbers file. The questions are: Where in the app do you import the Numbers file? What is the code? I mean the code that you write for this. So when you click on the Raspberry button, the app jumps to another page with four other buttons (Medicinal Properties, How to harvest, How much water does it need, recipe? Is there a video that shows this? Thanks so much for your time.
3
0
1.8k
Aug ’22
Can't register for Developer Forum - Unauthorized error
One of our developers cannot seem to Register in the Developer Forum. While the user name is being entered in the registration screen, the following error appears: Unauthorized - Error appears during the process of typing the Username in the field, no other fields are completed & 'Continue' has not been tapped. Developer has full admin access. Any insight into why this might be happening?
Replies
3
Boosts
0
Views
2.3k
Activity
Jan ’23
Forums are missing a category for hiring developers
A category connecting Apple developers with companies looking to hire Apple developers would be great. Best make two subforums, similar to Hackernews: •  Freelancer? Seeking freelancer? (where developers can look for job offers) and • Who is hiring? (where companies can look for developers) yeah there are lots of other job boards as well as freelancing platforms but it is hard to find good iOS devs there and practically impossible to find any macOS developers...
Replies
1
Boosts
0
Views
1.6k
Activity
Dec ’22
"Last Updated" is all wrong
The forum's "Last Updated" screen is all wrong - it shows lots of threads where the most recent post was months or years ago as "last updated 1 hour ago". Is this perhaps because the thread was updated recently to remove spam? Or is there something else going wrong?
Replies
6
Boosts
0
Views
1.6k
Activity
Dec ’22
Forum posts disappearing
I made two forum posts yesterday, and they have both disappeared today.
Replies
2
Boosts
0
Views
1k
Activity
Dec ’22
Bug in forum handling of feedback IDs
If I enter a feedback ID like FB11832484, the last digit does not get highlighted, and is not part of the automatically-generated URL linked to the text. Looks like someone assumed that there will never be more than 7 digits in the feedback ID.
Replies
3
Boosts
2
Views
1.2k
Activity
Nov ’22
Accessing Developer Forums on Google Chrome?
I am having trouble accessing the Developer Forums on Google Chrome. Is there currently a requirement for accessing the forums on Safari? Thanks to anyone who has any information on how to resolve this! The current message that shows on https://forums.developer.apple.com/welcome is: Bad Message 431 reason: Request Header Fields Too Large
Replies
16
Boosts
1
Views
6.4k
Activity
Nov ’22
How to remove the "solved" badge from an answer?
I mistakenly marked an answer as "solved" while it actually not solved yet. The question is at https://developer.apple.com/forums/thread/662602 I noticed that I can't remove the "solved" badge. Is there a forum administrator that can do that for me? I don't wish to resubmit the question just in order to get rid of the "solved" badge and loose all responses.
Replies
4
Boosts
0
Views
2.3k
Activity
Nov ’22
Why was my post removed?
Hi, I had a post on here regarding App Store Review Guidelines 5.1.1(ix) and if anyone knew what Apple considers a highly-regulated industry to be (only examples are listed in the guideline). My post was removed for some reason. I didn't receive a notification or email saying why. It just says I haven't made any posts yet, which isn't true. There's no identical question/answer on the forums already. I do believe the post was helpful, as it took me a while to get an answer from App Review. I shared the answer I received from them - that the examples listed in 5.1.1(ix) are the only industries Apple considers to be highly regulated - to save other developers the trouble. Did I use the forums incorrectly? Is this a forums bug? Thanks
Replies
8
Boosts
0
Views
1.1k
Activity
Nov ’22
2019 sample code
Hellohttps://developer.apple.com/documentation/Documentation ArchiveThere is no 2019 sample codeWhere did you go?
Replies
1
Boosts
0
Views
1.6k
Activity
Nov ’22
Why is iOS Development so Convoluted?
Ok, I'm clearly missing something with iOS development. I've been developer for over 10 years and I'm jumping into iOS development now and absolutely everything seems to be a near impossible task to accomplish, when it is literally 2-3 lines of code to implement something using HTML/CSS/Javascript/Java etc. it seems to be a days worth of time trying to figure out how to actually implement something so unbelievably simple. Let me start with a few examples;- Responsive design: This seems to be focused around Constraints (but not to 'margins' or this breaks everything), yet this then breaks when you try and add something else into the middle and move items around in the storyboard, so you have to reset all the constraints and start again. Time and time again. What am I missing here? - Picker View: This is a simple select/option in HTML. I've yet to find any working code online that can implement this. I'm just looking for a simple Country selector to allow users to choose details - Date View: I haven't event started looking at this yet, I'm anticipating even more problems with this when it comes to date formats / working with dates etc. The offical documentation from Apple is abysmal and every tutorial you find online is out of date or doesn't work. I'm at a loss here. I'm seriously thinking of just giving up on iOS development for a couple of years until the ecosystem grows up a bit and is possible to understand and implement the very basic things. Am I missing something here while tearing my hair out? Or is it really this bad? Tips, guides, pointers, all useful. Any pros out here, please, point me in the right direction to pick this up quickly. This post is out of frustration after reading through all of the official guidelines and many tutorials online too. Another prime example of this.... posting this question - having to figure out what on earth 'enter the name of a place' means, England?
Replies
3
Boosts
0
Views
2.2k
Activity
Nov ’22
App Auth: error Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior
I'm using AppAuth pod to handle user login with Azure in my app. I followed this sample : https://github.com/openid/AppAuth-iOS/tree/master/Examples which works fine until my authentication code expires. It works ok for the 1st connection and all the time while the authenticationCode is still valid. Once it expires, I briefly see the alert to "Sign in" and then it disappears and I get the error :"Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior". (It works fine again if I delete the app and re-install it.) I read that I should "Ensure that there is a strong reference to the SFAuthenticationSession instance when the session is in progress.". And I think that's the case with the currentFlow declared in AppDelegate. (see code below) Did anyone ever faced and solved this issue ?import UIKit import AppAuth import AuthenticationServices var isLoginViewOn: Bool = false var isConnectionBtnPressed: Bool = false class ContainerController: UIViewController { // MARKS : Properties private var authState: OIDAuthState? var token: String? var menuController: MenuController! var homeController: HomeController! var panView: UIView! var isExpanded = false var isLoginOut: Bool = false let loginView: UIImageView = { let v = UIImageView() v.image = UIImage(named: "") v.contentMode = .scaleAspectFit return v }() let connexionButton: UIButton = { let b = UIButton(frame: CGRect(x: 100, y: 100, width: 100, height: 50)) return b }() let logoutBtn: UIButton = { let b = UIButton(frame: CGRect(x: 100, y: 100, width: 100, height: 50)) b.setTitle("déconnexion", for: .normal) return b }() override func viewDidLoad() { super.viewDidLoad() chekToken() } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) if isLoginViewOn == true { if isConnectionBtnPressed == false { self.connexionButton.sendActions(for: .touchUpInside) isLoginViewOn = false } } } override func viewWillLayoutSubviews() { super.viewWillLayoutSubviews() view.layoutIfNeeded() view.layoutSubviews() } ///////////////////////////////////////////////////////////////////////////// /// SET UP //// ///////////////////////////////////////////////////////////////////////////// func setupLoginView() { print("setup loginView") isLoginViewOn = true view.addSubview(loginView) view.addSubview(connexionButton) loginView.translatesAutoresizingMaskIntoConstraints = false connexionButton.translatesAutoresizingMaskIntoConstraints = false [ loginView.centerYAnchor.constraint(equalTo: view.centerYAnchor), loginView.centerXAnchor.constraint(equalTo: view.centerXAnchor), loginView.widthAnchor.constraint(equalToConstant: 250), loginView.heightAnchor.constraint(equalToConstant: 128), connexionButton.bottomAnchor.constraint(equalTo: loginView.topAnchor, constant: -50), connexionButton.centerXAnchor.constraint(equalTo: view.centerXAnchor), connexionButton.widthAnchor.constraint(equalToConstant: 200), connexionButton.heightAnchor.constraint(equalToConstant: 50), ].forEach{$0.isActive = true } connexionButton.addTarget(self, action: #selector(buttonAction(_:)), for: .touchUpInside) if isConnectionBtnPressed == false { self.connexionButton.sendActions(for: .touchUpInside) } } func setupHomeController() { homeController = HomeController() homeController.delegate = self addControllerAsChild(forController: homeController) setupPanView(forController: homeController) } }The login part :extension ContainerController { @objc func buttonAction(_ sender: UIButton){ self.login() isConnectionBtnPressed = true } func checkToken() { guard let data = UserDefaults.standard.object(forKey: kAppAuthExampleAuthStateKey) as? Data else { setupLoginView() return } do { let authState = try NSKeyedUnarchiver.unarchivedObject(ofClass: OIDAuthState.self, from: data) self.setAuthState(authState) self.getUserInfo() } catch { print("catch loadState: \(error)") } } func login() { print("Got configuration: \(config)") if let clientId = kClientID { self.doAuthWithAutoCodeExchange(configuration: config, clientID: clientId, clientSecret: nil) } } func doAuthWithAutoCodeExchange(configuration: OIDServiceConfiguration, clientID: String, clientSecret: String?) { guard let redirectURI = URL(string: kRedirectURI) else { print("Error creating URL for : \(kRedirectURI)") return } guard let appDelegate = UIApplication.shared.delegate as? AppDelegate else { print("Error accessing AppDelegate") return } // builds authentication request let request = OIDAuthorizationRequest(configuration: configuration, clientId: clientID, clientSecret: clientSecret, scopes: [OIDScopeOpenID, OIDScopeProfile, "--kclientID--", "offline_access"], redirectURL: redirectURI, responseType: OIDResponseTypeCode, additionalParameters: ["p": "b2c_1_my_app_sign_in_up"]) // performs authentication request print("Initiating authorization request with scope: \(request.scope ?? "DEFAULT_SCOPE")") appDelegate.currentAuthorizationFlow = OIDAuthState.authState(byPresenting: request, presenting: self) { authState, error in if let authState = authState { self.setAuthState(authState) print("Got authorization tokens. Access token") self.getUserInfo() } else { self.setAuthState(nil) print("Authorization error: \(error?.localizedDescription ?? "DEFAULT_ERROR")") } } } func getUserInfo() { let currentAccessToken: String? = self.authState?.lastTokenResponse?.accessToken self.authState?.performAction() { (accessToken, idToken, error) in if error != nil { CoreDataHelper().deleteIDToken("idToken") AuthenticationService().login() print("Error fetching fresh tokens: \(error?.localizedDescription ?? "ERROR")") return } guard let accessToken = accessToken else { print("Error getting accessToken") return } if currentAccessToken != accessToken { print("Access token was refreshed automatically ") self.token = currentAccessToken } else { print("Access token was fresh and not updated ") self.token = accessToken } self.loginView.removeFromSuperview() self.setupHomeController() } } func saveState() { var data: Data? = nil if let authState = self.authState { do { data = try NSKeyedArchiver.archivedData(withRootObject: authState, requiringSecureCoding: false) } catch { print("catch saveState: \(error)") } } UserDefaults.standard.set(data, forKey: kAppAuthExampleAuthStateKey) UserDefaults.standard.synchronize() } func setAuthState(_ authState: OIDAuthState?) { if (self.authState == authState) { return; } self.authState = authState; self.authState?.stateChangeDelegate = self; self.saveState() } } extension ContainerController: ASWebAuthenticationPresentationContextProviding { func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor { return view.window! }And AppDelegate above the class declaration :let kClientID: String? = "my client id"; let kRedirectURI: String = "myapp.test.authent://oauth/redirect"; let kAppAuthExampleAuthStateKey: String = "authState"; let authorizationEndpoint = URL(string: "https://login.microsoftonline.com/myapp.onmicrosoft.com/oauth2/v2.0/authorize?p=b2c_1_myaapp_sign_in_up")! let tokenEndpoint = URL(string: "https://login.microsoftonline.com/myapp.onmicrosoft.com/oauth2/v2.0/token?p=b2c_1_myaapp_sign_in_up")! let config = OIDServiceConfiguration(authorizationEndpoint: authorizationEndpoint, tokenEndpoint: tokenEndpoint)And in the class : var currentAuthorizationFlow: OIDExternalUserAgentSession? func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { // Sends the URL to the current authorization flow (if any) which will // process it if it relates to an authorization response. if let authorizationFlow = self.currentAuthorizationFlow, authorizationFlow.resumeExternalUserAgentFlow(with: url) { self.currentAuthorizationFlow = nil return true } return false }Any suggestion welcomed 🙂
Replies
6
Boosts
0
Views
4.8k
Activity
Oct ’22
So @Apple - What're you going to do with the ongoing spam & consumers being able to post here
Access to these forums should be based on paid agreements on file to the Apple Developer Program, and this will prevent these social engineers from trying to game the board and members with junk. Apple, you pride yourself on security & privacy. How about fixing the access to these forums to only developers with a contract on file and approved students only?
Replies
7
Boosts
3
Views
1.7k
Activity
Oct ’22
developer forms
helpful way to learn and engage learning!! 😁
Replies
0
Boosts
0
Views
1.1k
Activity
Sep ’22
I can't use the word "*****", but adverts for prostitutes are OK?
Dear Apple, I know that content moderation is difficult, but surely you can do better than this. You seem to have a very crude profanity filter that ****s out words with perfectly normal dual uses, but you can't stop the constant stream of adverts for c all girls in D ubai. Come on, sort it out! (And amazingly, this message is rejected as "You have included content that is not permitted" when I wrote "c all girls in D ubai", until I added the spaces!) (The word in the title is a small metal item used to join pieces of wood together, which can also be used as a euphemism for something couples do.)
Replies
6
Boosts
0
Views
1.3k
Activity
Sep ’22
This "Developer Forums" site is impossible to search.
I noticed a search for one word produces (for instance) 100 results and a search for two words produces a 1000 results. It seems to be looking for one OR the other and no option to search for both both. Adding quotes around both also does nothing. This is basic search tooling, and it seems to be broken. I found it to be completely impossible to search for, for instance: "ARKit" and "Safari" Perhaps is there a better way to search? Any suggestions? Maybe a Google search for these terms also including "Developer forums" and "Apple"??
Replies
3
Boosts
0
Views
1.1k
Activity
Sep ’22
So many spam posts recently
... all talking about customer care numbers. Maybe Apple should make these Dev Forums just for signed-in Developers? If a Developer spams, they can be blocked. But if just anyone can register and post, they can spam, get banned, then start a new account. Or, Apple should implement some way of blocking the spam before it gets posted. I really don't understand what these spammers think they're getting out of doing this? Who is going to look through the forums and think, "Oh, a customer care number for something I've never heard of? I should phone that immediately!" Really does prove that spammers are dumb.
Replies
1
Boosts
2
Views
1k
Activity
Sep ’22
Unable to see some replies unless logged in
I can't see certain replies to posts unless I'm logged in. Example #1: In this post - https://developer.apple.com/forums/thread/652207, I can't see the 1 reply unless I'm logged in. Example #2: In this post - https://developer.apple.com/forums/thread/130103, the 4th reply (which I posted) doesn't display unless I'm logged in. If I'm not logged in, I can only see 3 out of 4 replies. Is this a bug or something related to different levels of moderation?
Replies
3
Boosts
0
Views
1.5k
Activity
Aug ’22
Let people post external links in answers
Many people post questions on these forums that have detailed answers in articles and blog posts from people who aren't Apple employees. It would be nice to link to these articles when answering questions on these forums. But if you try to link to a non-Apple URL, you get an error message that the domain is invalid. To post the link, you have to remove the https://www part of the link. This forces people to cut and paste the URL into the browser to read the article when they should get a clickable link. If you're worried about spam links, then either require posters to have a minimum reputation score or have a minimum number of posts to submit answers with external links.
Replies
8
Boosts
1
Views
1.9k
Activity
Aug ’22
Is reddit is better then Apple developer forms?
Apple should close his developer forms. I seen many time no HELP we getting here, only number of views are increasing day by day on your posts but no reply is coming on most of the posts.
Replies
2
Boosts
1
Views
1.1k
Activity
Aug ’22
DATA
Hello. I have data I need to add to my new app. Below is a simple example of my plants and the data I am adding to my app Aloe Vera a. Medicinal Properties (skin healer) b. How to harvest (Cut from the middle) c. How much water does it need (once every three days) d. Recipe (cut the leaf, use the gel inside for your rash) Almond a. Medicinal Properties (skin healer) b. How to harvest (cut the young leaves) c. How much water does it need (daily) d. Recipe (soak in water overnight, rinse, blend) Raspberry a. Medicinal Properties (skin healer) b. How to harvest (cut from mid branch) c. How much water does it need (twice a day) d. Recipe (mix raspberry with coconut water and blend.) I understand that the above date (information about the four plants) needs to be organized in a Numbers file. The questions are: Where in the app do you import the Numbers file? What is the code? I mean the code that you write for this. So when you click on the Raspberry button, the app jumps to another page with four other buttons (Medicinal Properties, How to harvest, How much water does it need, recipe? Is there a video that shows this? Thanks so much for your time.
Replies
3
Boosts
0
Views
1.8k
Activity
Aug ’22