Giter VIP home page Giter VIP logo

Comments (6)

StevenEWright avatar StevenEWright commented on August 15, 2024 9

Nice! That's definitely necessary, but probably not enough on it's own.

Take a look at the iOS example app's README.md here: https://github.com/google/GTMAppAuth/tree/master/Example-iOS

It describes the other things you need to do to get the example app configured for handling Google's OAuth callback (which I assume is a good start for you since your screenshot shows Google in the background?). If you're not using Google you may have to tweak some things. But the general idea is as follows:

At the end of the sequence of events which occurs in the browser, there is one final redirect: a redirect back to the application itself. The URL it's trying to load is something like: YourBundleID://somePath...

The error you're seeing ("... the address is invalid.") is because the browser doesn't know what to do with the "YourBundleID" scheme (notice, it's not "http" or "https", etc). This would occur if your application doesn't register the custom scheme with iOS correctly.

Fortunately it's a simple problem to fix. It's just a small setting in your Info.plist file.

Apple's documentation is here: https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Inter-AppCommunication/Inter-AppCommunication.html#//apple_ref/doc/uid/TP40007072-CH6-SW10

Twitter has a nice page with screenshots of how to do it through XCode: https://dev.twitter.com/cards/mobile/url-schemes

Let me know if that's enough to get you going, or if you're still stuck.

from gtmappauth.

timeflying avatar timeflying commented on August 15, 2024 1

Thank you very much for your great explanation!
After open the Info.plist and fully expand "URL types" then add the reverse DNS notation form of my client id the problem is gone. Thank you!!

from gtmappauth.

StevenEWright avatar StevenEWright commented on August 15, 2024

Is it possible you're getting this because you haven't handled the URL callback scheme?

from gtmappauth.

timeflying avatar timeflying commented on August 15, 2024
- (BOOL)application:(UIApplication *)app
            openURL:(NSURL *)url
            options:(NSDictionary<NSString *, id> *)options {
  // Sends the URL to the current authorization flow (if any) which will
  // process it if it relates to an authorization response.
  if ([_currentAuthorizationFlow resumeAuthorizationFlowWithURL:url]) {
    _currentAuthorizationFlow = nil;
    return YES;
  }

  // Your additional URL handling (if any) goes here.

  return NO;
}

I just paste above code on my delegate . Is that wrong?

from gtmappauth.

StevenEWright avatar StevenEWright commented on August 15, 2024

Glad to hear it! I'll go ahead and close this issue!

from gtmappauth.

vidit011 avatar vidit011 commented on August 15, 2024

The links in my webpage are not opening. They are showing an error that safari cannot open because of invalid address https://vidit011.github.io/CV/

from gtmappauth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.