Coder Social home page Coder Social logo

Comments (4)

mirceanis avatar mirceanis commented on June 21, 2024

You are right, the documentation could be improved a lot there.
You don't need a webapp to catch the token.

The callback URL you set there should be a URL that your app declares in the manifest.

The easiest way to do things is to use the Transports.sendExpectingResult() along with the manifest declaration of IntentForwardingActivity (like so:

<!--when using deeplinks as callbacks, you need to set the intent filters on this activity and merge-->
)

This will allow you to get the callback as a simple onActivityResult() which can be parsed using a ResponseParser.parseActivityResult()
Check out

override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
to get an idea.

Of course, the actual callback URL you use should be specific to your app. and it doesn't need to use https as scheme. It can be app specific too.

The names of these methods or their location will probably change in a future release to increase discoverability.

from uport-android-sdk.

obernardovieira avatar obernardovieira commented on June 21, 2024

Thank you, it worked. Although, I was expecting it to just send me back and in fact, I have to select the app. Is it supposed to be like that or did I forgot anything?
Sorry about my ignorance, I'm a blockchain developer but I have little knowledge when it comes to android development.

So now, since the demoapp didn't work for me, I'll fix it and open a PR. then, if possible I would like to help with documentation. Maybe using the riot chat could help, right?

from uport-android-sdk.

mirceanis avatar mirceanis commented on June 21, 2024

You have to select the app because you are probably using a http(s) scheme in the callback URL.
That will prompt the user to select between the browser and your app when the callback is launched.
To get around this there are 2 options.

  1. use an app specific scheme in the callback URL (for example: myscheme:mydomain.com/callbacks)
  2. verify that you own the domain name by posting an assetlinks.json with the app signature by following the instructions here: https://developer.android.com/training/app-links/verify-site-associations

Remember to set the same URL in the AndroidManifest.xml as well.
It's easier to use option 1. at first but if you plan to publish the app it's worth going through the second step too.

It's probably easier to keep the conversation here if the issue is easy to describe.
What exactly did not work for you in the demoapp?

from uport-android-sdk.

obernardovieira avatar obernardovieira commented on June 21, 2024

Hello, sorry for that. It eventually worked, I was just missing some steps. I'm not familiar with Android and kotlin, so I guess it was only my problem. Let's close it.
Thank you so much for your time.

from uport-android-sdk.

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.