Dropbox AuthActivity from Android. Fails with "User may have restricted profile" - android

I'm trying to modify an existing app (that uses Gdrive) to work with Dropbox. To that effect, I'm adapting code from https://github.com/dropbox/dropbox-sdk-java/tree/master/examples/android.
Unfortunately, I'm stuck at the first step: Auth.startOAuth2Authentication
Android Studio's log shows the following:
08-02 13:13:30.338 7994-7994/rudy.android.stdb E/com.dropbox.core.android.AuthActivity: Could not launch intent. User may have restricted profile
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=https://www.dropbox.com/... }
Any ideas?

This error seems to be indicating that there is no app available to handle this intent to view the supplied URL, i.e., there is no browser installed. It sounds like this may be due to the use of a Restricted Profile.
If there isn't a browser or the Dropbox app available, the SDK won't be able to process the authorization flow. If this is the issue, you should enable a browser or switch off of the Restricted Profile.
[Cross-linking for reference: https://www.dropboxforum.com/t5/API-Support-Feedback/Auth-startOAuth2Authentication-Android-returns-quot-User-may/m-p/288600 ]

Related

Callback for programatically install .apk

I update my app using a local downloaded .apk, via DownloadManager, using this code:
val installIntent = Intent(Intent.ACTION_VIEW)
installIntent.setDataAndType(localUri, "application/vnd.android.package-archive")
installIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION)
this.startActivity(installIntent)
Although most of the time it works, sometimes, only some of the users get the "There was a problem parsing the package error" popup.
I'm interested if there is any callback that we can get in our app, whenever this happens, or user press 'OK' in the popoup . I found here for instance, a callback that checks if the package exists (meaning that it was installed) but I'm more interested for updates, in this case I already know that the app was previously installed.
Is there a callback (maybe startActivityForResults) for this specific intent, so we know that it was successfully installed or it failed?
ACTION_VIEW is not designed to return a result. On Android 5.0 and higher, PackageInstaller gives you a direct API for installing apps, where you can provide a callback (in the form of an IntentSender) to find out about how the installation proceeds.
This sample project shows the basics of using PackageInstaller, and you should be able to find open source apps that use it in a more sophisticated fashion. For example, the F-Droid client probably uses PackageInstaller.

Flutter Huawei App Linking get info from link

i have implemented AppLinkin in my flutter app, and it works good, but i want to avoid the behaviour to open a new app instace
In android i'm using singleTask in launchMode
Also using this package app_links to handle the link each time the user tap the link. but I only get the link, without the info, like this: https://myApp.drcn.agconnect.link/linkId
I want to know if exist a way to get the info from the link, knowing that the api is already released
As confirmed by the team, the getAppLinking function is not supported in the singleTask launch mode. Currently, only the standard launch mode is supported.
For details, you could refer to this Docs :

How to test Deferred Deep Linking with AppsFlyer?

I'm integrating AppsFlyer with Android Native Application. And I want to use Deferred Deep Linking, when user click landing page ads and download the app and upon first app open the user lands directly on the activity I want.
Link docs: https://support.appsflyer.com/hc/en-us/articles/207032096-Deferred-Deep-Linking-Getting-the-Conversion-Data
But I have not found a way to check that my code is running correctly.
Please help me with this problem
What was working for me is:
Add physical device as a test device in AppsFlyer (here's how to do it)
Enable Debug Mode in AppDelegate.swift in didFinishLaunchingWithOptions
AppsFlyerTracker.shared().isDebug = true
Add AppsFlyer methods in your AppDelegate.swift (as per article)
Remove app (or test build) from physical device
Open Deep Link from physical device, you will be redirected to App Store. Don't install app from the App Store!!! (just close it)
Install app via XCode
After it, on a first install it will call onConversionDataReceived method and the rest staff.
You're going to have to implement the onInstallConversionDataLoaded listener:
public interface AppsFlyerConversionListener {
void onInstallConversionDataLoaded(Map<String,String> conversionData);
void onInstallConversionFailure(String errorMessage);
}
This will return a map of all the parameters on the link that you clicked.
The parameter you need to pay attention to is the af_dp parameter.
This parameter should contain the URI scheme of the activity you want to route your users to. Make sure that you have set up this URI scheme properly in the manifest.
To create a tracking link you can use Link Management. It doesn't matter if it's a single platform link or a OneLink, as long as you have the af_dp parameter on the link, that parameter (along with all other parameters on the link) will be part of the response.
If you're still facing issues, feel free to reach out to support#appsflyer.com.

MS Graph can't open a new browser activity when Chrome is disabled/deleted of device

I have developed a xamarin form app that it uses MS Graph in order to user sign in. I have used samples of GitHub that open a new browser activity where user sign in and then the app goes to home activity. It works correctly. But some users have blocked or deleted Chrome app in order to use MS Edge as default browser, and then when app tries to start the browser activity, it launches an error because it can’t find chrome activity. I have asked on MS Graph GitHub (https://github.com/microsoftgraph/msgraph-sdk-dotnet/issues/242 ) but they and I are thinking that it isn’t problem of SDK but I don’t know how I could fix it. How should I fix it in order to work with any installed browser?
Thank you
It is done by design. The Microsoft Identity Client library uses Custom Chrome tabs and does not have any fallback strategy to run using a WebView.
You are probably encountering this exception thrown when it doesn't find Chrome installed: https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/blob/dev/src/Microsoft.Identity.Client/Platforms/Android/AuthenticationActivity.cs#L131
string chromePackageWithCustomTabSupport = GetChromePackageWithCustomTabSupport(ApplicationContext);
if (string.IsNullOrEmpty(chromePackageWithCustomTabSupport))
{
string chromePackage = GetChromePackage();
if (string.IsNullOrEmpty(chromePackage))
{
throw new MsalClientException(MsalClientException.ChromeNotInstalledError,
"Chrome is not installed on the device, cannot proceed with authentication");
}
#Cheesebaron is correct, this is by design. Currently, Xamarin Android in MSAL can only launch chrome or chrome custom tabs. If the device doesn't have them, it will cause an exception, as you noted above.
#cansado2930 This part of the error message pkg=com.android.chrome means Chrome is not installed on the device.
Embedded webview support in MSAL will be an option in near future.
Here's a link to the issue in the MSAL repo.

Dropbox on Android, onResume() fail

I tried to implement dropbox on android, but even "example" from dropbox page won't work. In code below i changed only my Key (to "MY_KEY"). It shows this error during "log in" process because session.authenticationSuccessful() is false. and thats because mApi.getSession().startAuthentication(DBRoulette.this) and/or mApi.getSession().startOAuth2Authentication(DBRoulette.this) propably failed. But in my opinion everything should be ok - i have correct my Key and Secret, permisions and key in manifest and also configuration of libraries should be fine. I also tried implement this example but still with the same error. I can post more info if needed, but basically i didn't changed code at all - only tried to change some methods that i found, but without success.
Error during "log in" proces.
12-02 16:11:34.014: E/AndroidRuntime(1501): java.lang.RuntimeException: Unable to resume activity {com.dropbox.android.sample/com.dropbox.client2.android.AuthActivity}: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=https://www.dropbox.com:443/1/connect?locale=en_US&k=MY_KEY&s=&state=oauth2:d953b22cfa534a73ba088fc6fd03e47a }
Well, I didn't know Dropbox on phone needs internet browser (even when someone use all keys, secret, persmissions and so) - In video tutorials i watched they simply skip this part because of private information. I also didn't know, that even when i used AVD from latest API it won't have internet browser. And no internet browser is mentioned in examples and it was only thing missing.
So changing AVD fixed problem.

Categories

Resources