your app should have some sort of method to recieve a HTTP request, since you are redirect the user out of the app to a web browser to go link.
So that method of recieving a HTTP request should be able to pull the ?code query string parameter.
Apps like these either intercept requests in a web view, or raise a temprorary web server to act as the reciving server.