URI scheme in your app's manifest is not set up correctly - android

I am trying to connect my Dropbox, i do not know where this problem comes from but I have edited the manifest file well! what am I doing wrong can anyone help me please...
this is my manifest file :
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/Theme.JurnalCloudApp">
<activity
android:name=".DropboxActivity"
android:exported="true" />
<activity
android:name=".SyncActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.dropbox.core.android.AuthActivity"
android:configChanges="orientation|keyboard"
android:launchMode="singleTask">
<intent-filter>
<!-- Change this to be db- followed by your app key -->
<data android:scheme="db-is9rikcfjhforcl" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:exported="true"/>
</application>
And the Error is:
Caused by: java.lang.IllegalStateException: URI scheme in your app's manifest is not set up correctly. You should have a com.dropbox.core.android.AuthActivity with the scheme: db-db-is9rstkcfjhlorcl

Your data android:scheme looks correct. Based on the error message, it looks like you're passing in "db-YOURAPPKEY" to the startOAuth2PKCE method to start the app authorization flow, when you should just specify the app key only, that is, "YOURAPPKEY" (no "db-").
If you include that "db-" in your app key in your code, the SDK will expect "db-db-is9rstkcfjhlorcl" (with an extra "db-") in your Manifest, which would be incorrect.

Hmm i deleted the code of that line (db-), this time I encountered this error:
same error without two -db
URI scheme in your app's manifest is not set up correctly. You should have a com.dropbox.core.android.AuthActivity with the scheme: db-is9rikcfjhforcl
manifest file:
<activity
android:name="com.dropbox.core.android.AuthActivity"
android:configChanges="orientation|keyboard"
android:launchMode="singleTask">
<intent-filter>
<!-- Change this to be db- followed by your app key -->
<data android:scheme="is9rikcfjhforcl" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Auth.startOAuth2Authentication(this, this.getString(R.string.app_key));
and string resource:
<string name="app_key">is9rikcfjhforcl</string>

Related

Is it possible for one app to be listed multiple times as an Android share option (YouTube play & queue)

I am wondering if it's possible for my Android app to show 2 different 'share' options under YouTube's "share" (app picker) dialog?
My app is accepting an Android intent to get the shared URLs, but I would like to offer two share options within YouTube's app-picker dialog, one to directly play the URL and another to queue the URL (I don't want to display an additional dialog in my app).
Currently, in the app's manifest file, I specify :
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xxx.XX_Remote"
android:versionCode="202"
android:versionName="2.0.2"
android:installLocation="auto">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="28" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-feature android:glEsVersion="0x00020000" android:required="True"/>
<application android:persistent="False"
android:restoreAnyVersion="False"
android:label="XX Remote"
android:debuggable="True"
android:largeHeap="False"
android:icon="#drawable/ic_launcher"
android:theme="#style/AppTheme"
android:hardwareAccelerated="true"
android:resizeableActivity="false">
<!-- Our activity is a subclass of the built-in NativeActivity framework class.
This will take care of integrating with our NDK code. -->
<activity android:name="com.embarcadero.firemonkey.FMXNativeActivity"
android:label="XX Remote"
android:configChanges="orientation|keyboard|keyboardHidden|screenSize"
android:launchMode="singleTask">
<!-- Tell NativeActivity the name of our .so -->
<meta-data android:name="android.app.lib_name"
android:value="XX_Remote" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:label="Play in XX">
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
<intent-filter android:label="Queue in X">
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>
<receiver android:name="com.embarcadero.rtl.notifications.NotificationAlarm" />
</application>
</manifest>
However, the second (queue) intent doesn't show up at all.
And if it did show up, I'm not sure how to read the intent's label by code so I can distinguish between the two intents.
One <activity> tag cannot match multiple intent filters simultaneously.
For that purpose you can use <activity-alias> in your manifest which presents same activity as a separate entity:
<activity android:name="com.embarcadero.firemonkey.FMXNativeActivity"
android:label="XX Remote"
android:configChanges="orientation|keyboard|keyboardHidden|screenSize"
android:launchMode="singleTask">
<!-- Tell NativeActivity the name of our .so -->
<meta-data android:name="android.app.lib_name"
android:value="XX_Remote" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!-- use only one intent filter for SEND action in activity tag-->
<intent-filter android:label="Play in XX">
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>
<!-- note that we will use android:name for resolving if this alias was used to start activity -->
<activity-alias
android:targetActivity=".com.embarcadero.firemonkey.FMXNativeActivity"
android:name=".com.embarcadero.firemonkey.FMXNativeActivity.Queue">
<!-- Put second SEND action inside activity-alias tag -->
<intent-filter android:label="Queue in X">
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity-alias>
Then inside your activity you can resolve if it was started through alias by checking intents component:
// inside onCreate and/or onNewIntent (after resolving that intent action is SEND):
if (intent.component.className.endsWith(".Queue"){
// putting data in the queue...
} else {
// playing requested data...
}

App icon doesn't appear after implementing deep links to my app

I'm developing an app in Android Studio it works pretty well, but after implementing deep links to my launching activity my app doesn't you the app icon in the menu, I know the app is installed cause in Setting>Applications it appears. I know the problem is in the manifest.xml, so I'll leave a copy down bellow.
I'll love to hear about your solutions, by the way if you are reading this thanks.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dev.misterj.nocherd">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permision.CALL_PHONE"/>
<uses-permission android:name="android.permission.MANAGE_OWN_CALLS"/>
<uses-permission android:name="android.permission.READ_CALL_LOG"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyAiJNpq-********************" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:usesCleartextTraffic="true"
android:networkSecurityConfig="#xml/network_security_config"
android:theme="#style/AppTheme">
<activity android:name=".StartActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "https://myapp.com/place” -->
<data android:scheme="https" android:host="myapp.com" android:pathPrefix="/place" />
<!-- Accepts URIs that begin with "myapp://place” -->
<data android:scheme="myapp" android:host="place" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar">
</activity>
</manifest>
You should separate the intent filters, also your manifest file is not well-formatted. you should close the application tag. you can open it with an external application like google chrome, it will tell you if the XML is not in correct format.
<activity android:name=".StartActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="myapp" android:host="place"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="myapp.com" android:pathPrefix="/place" />
</intent-filter>
</activity>
it's important that you create separate filters when your intention is to declare unique URLs (such as a specific combination of scheme and host) because multiple <data> elements in the same intent filter are actually merged together to account for all variations of their combined attributes. if you combine them it actually supports https://place and also supports myapp://myapp.com/place.
So you should separate them.

How can I open my React Native App from the browser?

I would like to open my app from the browser.
example: I open a browser, type in: https://open.my.app, or app://www.example.com and have my app as an option come up.
I read about Deep Links and I am quite sure I set up my project properly, YET nothing happens when I either try to type and run: https://open.my.app, app://www.example.com
My AndroidManifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.somemobileapp">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<application
android:name=".MainApplication"
android:label="#string/app_name"
android:icon="#mipmap/ic_launcher"
android:allowBackup="false"
android:theme="#style/AppTheme">
<activity
android:name=".MainActivity"
android:launchMode="singleTask"
android:label="#string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Change these two in the future to a proper one -->
<data android:scheme="https" android:host="www.example.com" />
<data android:scheme="app" android:host="open.my.app" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
</manifest>
So even after this, it's not working.
I know it will sound strange but keeping the data tag on first worked for me
<intent-filter>
<!-- data on first -->
<data android:scheme="http" android:host="abc.in"/>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>

Enabling Deep Linking In Android App

I am trying to enable deep linking in my android app using this official guide.I am not able to understand where and how to add URI under data element. What would be the value of URI for my app. Is it referring to package name?Do I have to add intent filter tag for each android name activity? Any one example would be enough to make things clear. Please suggest.
My Manifest file :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myapp.praveen.healthcareit">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name="com.myapp.praveen.healthcareit.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.myapp.praveen.healthcareit.EvlHealthPlans" />
<activity android:name="com.myapp.praveen.healthcareit.ConHealthInsurance" />
<activity android:name="com.myapp.praveen.healthcareit.HealthPlanNetworks" />
<activity android:name="com.myapp.praveen.healthcareit.ProvCompensation" />
<activity android:name="com.myapp.praveen.healthcareit.CdphpPlans" />
<activity android:name="com.myapp.praveen.healthcareit.HmoPlans" />
<activity android:name="com.myapp.praveen.healthcareit.PpoPlans" />
<activity android:name="com.myapp.praveen.healthcareit.ProviderTypes" />
<activity android:name="com.myapp.praveen.healthcareit.UtilizationManagement" />
<activity android:name="com.myapp.praveen.healthcareit.EDIConcept" />
<activity android:name="com.myapp.praveen.healthcareit.ClaimProcessing" />
<activity android:name="com.myapp.praveen.healthcareit.CobraHippa" />
<activity android:name="com.myapp.praveen.healthcareit.GovernmentPrograms"></activity>
</application>
</manifest>
No need filter to all activity need only for the activity which you want to invoke from deep link url. in manifest
<activity
android:name="yourpackagename"
android:screenOrientation="portrait"
android:label="#string/app_name"
android:theme="#style/actioncolor">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="schemename"
android:host="hostname" />
</intent-filter>
</activity>
your URI will be schemename://hostname?hereextraparametersifyouwant
here you get the full example with steps
https://codelabs.developers.google.com/codelabs/android-deep-linking/index.html?index=..%2F..%2Findex
Add following intent filter in the activity tag which you want to launch while deep linking.
<activity android:name="com.myapp.praveen.healthcareit.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="www.example.com"
android:pathPrefix="/appx"
android:scheme="http" />
</intent-filter>
</activity>
where your url is like http://www.example.com?appx=45. So here scheme is http or https. If you want both then add two intent filters, one with http and another with https. Then pathPrefix is the url parameters you want to identify. Not pathprefix can be empty or *. And finally host is your website address to be deep linked.

Registering my React Native App to the ShareAction possibilities in Android

I have found a several of reverse examples: sending from a React App to another one using intents.
I have found a blog post of a guy explaining how to do this with IOS.
But not on android. :(
What I understand from there is I need to add something in the `AndroidManifest.xml' file:
<activity android:name=".ShareLink">
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>
Am I right that this is the APP_ROOT/node_modules/react-native/ReactAndroid/src/main/AndroidManifest.xml file?
Should it look like that then?
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.facebook.react">
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<application />
<activity android:name=".ShareLink">
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>
</manifest>
How do I create the Intent?
Once my app is in the list (wohoo), how do I get back the data in the React App?
Any help would be highly appreciated. I'm a web developper, love React, but completely n00b to Android.
To get my app in the share list, it wasn't so hard at the end:
In <APP_ROOT>/android/app/src/main/AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.appname">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:label="#string/app_name"
android:icon="#mipmap/ic_launcher"
android:theme="#style/AppTheme">
<activity
android:name=".MainActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
</manifest>
But once it is in the list, to make it accessible to the React App, that was complicated. I detailed the steps in the next answer following another subquestion: https://stackoverflow.com/a/33969430/1620081

Categories

Resources