Comments for Corner Software https://csdcorp.com Mon, 13 Feb 2023 11:04:00 +0000 hourly 1 https://wordpress.org/?v=6.9.4 Comment on OAuth2 – Get a Token Via REST Google Sign In by Anonymous https://csdcorp.com/blog/coding/oauth2-get-a-token-via-rest-google-sign-in/#comment-1093 Mon, 13 Feb 2023 11:04:00 +0000 https://csdcorp.com/?p=572#comment-1093 In reply to Rhythm Sharma.

While getting the code, give prompt=consent as the first query parameter followed by the rest, sign in again, get the code and update the code in your request.

]]>
Comment on Compressing POST Requests in Flutter by Zee https://csdcorp.com/blog/coding/compressing-post-requests-in-flutter/#comment-1022 Mon, 05 Dec 2022 11:02:29 +0000 https://csdcorp.com/?p=517#comment-1022 When I follow the above example. The .Net core backend throws an error
“The archive entry was compressed using an unsupported compression method”
It is working in javascript/Angular. I followed following links

https://stackoverflow.com/questions/51942451/compress-outgoing-requests-in-angular-2
https://stackoverflow.com/questions/34251856/compress-requests-from-angular-to-web-api

]]>
Comment on OAuth2 – Get a Token Via REST Google Sign In by Anonymous https://csdcorp.com/blog/coding/oauth2-get-a-token-via-rest-google-sign-in/#comment-1009 Fri, 02 Dec 2022 10:54:29 +0000 https://csdcorp.com/?p=572#comment-1009 great documenation

]]>
Comment on OAuth2 – Get a Token Via REST Google Sign In by Rhythm Sharma https://csdcorp.com/blog/coding/oauth2-get-a-token-via-rest-google-sign-in/#comment-924 Thu, 22 Sep 2022 06:33:49 +0000 https://csdcorp.com/?p=572#comment-924 for getting refresh token I did the same thing but i got this error
{
“error”: “invalid_grant”,
“error_description”: “Bad Request”
}

what can I do now ?

]]>
Comment on Simple HTML Parsing in Swift by Stephen Owens https://csdcorp.com/blog/coding/simple-html-parsing-in-swift/#comment-909 Wed, 14 Sep 2022 18:02:26 +0000 https://csdcorp.com/?p=730#comment-909 In reply to Andrew.

There are restrictions about what code you can put in a SwiftUI view. There are a few conditional or assignment statements you can use but not many. You should declare a function and use it. For example, I use something like this:

func textFromHTML( html: String?, completion:@escaping (String) -> () ) {
guard let htmlContent = html else {
completion(“”)
return
}
#if os(iOS)
guard let data: Data = htmlContent.data(using: .utf8) else {
completion(htmlContent)
return
}
NSAttributedString.loadFromHTML(data: data, options: [.characterEncoding: String.Encoding.utf8.rawValue]) { attributed,attrs,error in
guard nil == error else {
completion(htmlContent)
return
}
if let attributedHtml = attributed {
completion( attributedHtml.string)
}
}
#else
completion(htmlContent)
#endif
}

]]>
Comment on Simple HTML Parsing in Swift by Andrew https://csdcorp.com/blog/coding/simple-html-parsing-in-swift/#comment-907 Mon, 12 Sep 2022 20:28:35 +0000 https://csdcorp.com/?p=730#comment-907 Hello Stephen,

Thank you for your post – and hopefully this will assist me with a project I am working on. I would like to implement this in a SwiftUI view, but when I copy the code you posted I get a series of errors.

Here is my code: (ContentView.swiftui)

import SwiftUI
import WebKit

struct ContentView: View { [error build: Function declares an opaque return type, but has no return statements in its body from which to infer an underlying type]

var body: some View {

htmlContent = “The text I needed” [error build: Cannot find ‘htmlContent’ in scope]

guard let data: Data = htmlContent.data(using: .utf8) [1. error build: Cannot find ‘htmlContent’ in scope
2. error build: Expected ‘else’ after ‘guard’ condition]
// handle the error
return [error build: Non-void function should return a value]

}

[errors for the section below:
1. error build: Expected ‘{‘ in body of function declaration
2. error build: Expected ‘func’ keyword in instance method declaration
3. error build: Expected ‘(‘ in argument list of function declaration
4. error build: Expected ‘(‘ in argument list of function declaration
5. error build: Expected declaration In declaration of ‘ContentView’

NSAttributedString.loadFromHTML(data: data, options: [.characterEncoding: String.Encoding.utf8.rawValue]) { attributed,attrs,error
guard nil == error else {
// handle the error
return
}
if let attributedHtml = attributed {
// do something with the text of the result
print(attributedHtml.string)
}
}
}

struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}

As you can see I literally copied your code straight into my ContentView file. Please will you give me guidance on what I am doing wrong…

What I want to do is extract/parse selected data from an HTML document in my Documents folder on my Mac to either a textfield or textEditor. Is this possible using your code? Can you give me some guidance please?

]]>
Comment on OAuth2 – Get a Token Via REST Google Sign In by NB https://csdcorp.com/blog/coding/oauth2-get-a-token-via-rest-google-sign-in/#comment-658 Sat, 07 May 2022 07:40:51 +0000 https://csdcorp.com/?p=572#comment-658 bro … I feel like I owe you money for this 🙂
Thank you so much !!!

]]>
Comment on GOLANG unexpected directory layout error by Anonymous https://csdcorp.com/blog/coding/golang-unexpected-directory-layout-error/#comment-370 Fri, 28 Jan 2022 11:57:27 +0000 https://csdcorp.com/?p=612#comment-370 Awesome solution. I encountered the same problem.

]]>
Comment on DST Dart and DateTime & How to Unit Test by Michael https://csdcorp.com/blog/coding/dst-dart-and-datetime/#comment-274 Fri, 10 Dec 2021 10:18:15 +0000 https://csdcorp.com/?p=484#comment-274 There’s way more easy way: use DateTime.utc(…) instead.

]]>
Comment on Flutter plugin iOS tests in Swift by Alili https://csdcorp.com/blog/coding/flutter-plugin-ios-tests-in-swift/#comment-241 Mon, 27 Sep 2021 07:34:45 +0000 https://csdcorp.com/?p=192#comment-241 Hi, this post is very helpful, but I have some questions during study. How did you implement findById( id, maxCount, result)? and How did you call flutter method using Swift?

I hope to get your reply.

Thank you!

]]>