EDIT: the comment below still applies. I started working again in Swift, and here is the result and what I did (on Github) . Hope this saves someone else on the day of work to figure it out.
Here is the unsuccessful answer: Yes, you are using an example from Google iOS Quickstart , the “native SDK” as you call it. This is deprecated, however, since it uses a precisely built-in webview that Google no longer wants to use.
If this worked before, but suddenly stopped (as I experienced myself), you may need to change something related to the client ID. For customer IDs that have existed for some time, it seems that there is a longer grace period until Google blocks the use of the web view (in my opinion, there should only be some kind of warning). The new client identifier that I recently created for unrelated reasons seems to have caused just that, making me stuck in replacing the Google Drive authentication code for the new release in a short time.
As for the options (that so far only another responder has listed your question from a Google blog post), after a little research, GTMAppAuth seems to be the most viable option for me, since I'm not interested in full user login and logout. But I may be wrong.
GTMAppAuth contains sample code for iOS, but only in Objective-C. I have yet to go through this. In general, your code logic will change this way: your current solution makes authentication exclusively in your application. It is asynchronous, but does not leave your application. The new solution requires that you initiate authentication in your application when preparing and remembering callback functions. Initiation of authentication then opens an external browser, which, after execution, calls the URL callback in the application delegate. In your application’s sharelet, you then check your prepared callback and, depending on the state of the result of the external call, notify the user of the success or failure of external authentication.
source share