How can I get authorization token from browser intent?

你说的曾经没有我的故事 提交于 2019-12-01 12:01:06

You can get the Uri in onNewIntent. Just override it in your Activity. You can get the access token with something like the following:

@Override
protected void onNewIntent (Intent intent){
  Uri uri = intent.getData();
  if (uri!=null){
    String mainPart = uri.toString().split("#")[1];
    String[] arguments = mainPart.split["&"];
    String argument = arguments[0];
    String token = argument.split("=")[1];
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!