Comments (3)
Are there any reasons for not supporting Activity Result API except for the lack of dev time?
In short: Nope. Maybe you want to start a Pull Request? I will happily review it 🙂
from android-singlesignon.
@stefan-niedermann I don't have a NC instance at the moment, so it would be hard to test the code. Do you know any reliable hosted services? I tried a couple from the official website, one of them was freezing for hours and another one wasn't able to send me an email confirmation for some reason =)
from android-singlesignon.
Do you know any reliable hosted services?
For testing around just use one of those free hosters.
So, I played a bit around with the idea of ActivityResultContract
s. I think, we need three different ActivityResultContract
s:
CHOOSE_ACCOUNT_SSO
→ChooseAccountContract
REQUEST_AUTH_TOKEN_SSO
→RequestAuthTokenContract
REQUEST_GET_ACCOUNTS_PERMISSION
→RequestGetAccountsPermissionContract
Further thoughts:
- Do 3rd party apps really need to control the import aspect this detailed? Wouldn't it be better to provide just one
ImportSingleSignOnAccountContract
which handles the rest of the stuff under the hood? - While implementing
ActivityResultContract
I stumbled upon the problem, that one needs to overridecreateIntent
andparseResult
- both methods do not throw any exception according their signature. This leads to the problem, that we can't check and throwNextcloudFilesAppNotInstalledException
for example without wrapping it into aRuntimeException
or extendingSSOException
RuntimeException
- I don't like any of those approaches. Another idea is to do the check within a constructor, but this again leads to an ugly static initialization from the 3rd party apps perspective:
private final ActivityResultLauncher<Void> launcher;
{
try {
launcher = registerForActivityResult(
new ImportAccountContract(this),
(ActivityResultCallback<SingleSignOnAccount>) this::onActivityResult
);
} catch (NextcloudFilesAppNotInstalledException e) {
throw new RuntimeException(e);
}
}
from android-singlesignon.
Related Issues (20)
- Provide convenience class for OCS requests HOT 4
- Support .qa package id of the files app
- Convenience features for `NextcloudRequest.Builder`
- Handle `QueryParam` with key "`c`" HOT 4
- SEARCH HTTP method is not supported HOT 7
- Rotation issues
- i18n: `Benötigt keine Übersetzung. Für Android wird nur die formelle Übersetzung verwendet (de_DE).` HOT 7
- If only dev app is installed SSO doesn't work HOT 8
- Break on minified app HOT 12
- Migrate to Material 3 theme HOT 1
- Option to create new token on `TokenMismatchException` HOT 3
- Availablity on Amazon store HOT 1
- Instantiating `Void` does no longer work with AGP 8 HOT 18
- Improve SSO error dialogs shown by 3rd-party-apps HOT 2
- Check `NetworkRequest#mDestroyed` before each network request? HOT 1
- Readme contains bad R8 advice HOT 1
- Reportedly not working when used within Samsung Knox HOT 1
- Possibility to get WebDAV-capable app password/token from SSO HOT 5
- Dependency Dashboard
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-singlesignon.