App does not come up with http scheme - android

My manifest file is:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ir.technovaa.offer">
<application
android:name=".OfferApplication"
android:allowBackup="false"
android:icon="#drawable/offer_icon"
android:label="#string/app_name"
android:supportsRtl="false"
android:theme="#style/AppTheme">
<activity
android:name=".activity.MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activity.IntroductionActivity" />
<activity
android:name=".activity.CallbackActivity">
<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="http"
android:host="offer.ir"
android:path="/refer"/>
</intent-filter>
</activity>
</application>
</manifest>
So, problem is in CallbackActivity, with the http scheme, CallbackActivity does not come up with a link, but if I change it to a custom scheme like android:scheme="offer" it works just fine and the activity will come up with the redirect link. So, what should I do for make http scheme works. Thank you.

Related

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>

Trouble with Android apk

I have an app that I uploaded to the Google Play Store. It stops running once downloaded or can't be downloaded at all. I'm pretty sure there's something wrong with my manifest as that's the error. I'm going to add my app release apk and manifest file.
Asking if someone could help me find the issue, it shouldn't be a terrible error, but I can't seem to figure it out.
Thanks.
Manifest file below:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.Houston_Rockets_Team_App">
<uses-permission android:name="android.permission.INTERNET"/>
<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/AppTheme"
android:debuggable="false"
tools:ignore="HardcodedDebugMode">
<activity
android:name="com.Houston_Rockets_Team_App.Houston_Rockets_Team_App.MainActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.Houston_Rockets_Team_App.Houston_Rockets_Team_App.PlayersActivity" android:label="#string/app_name">
<intent-filter android:label="#string/app_name">
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<!-- <data android:mimeType="image/png" /> -->
</intent-filter>
</activity>
<activity android:name="com.Houston_Rockets_Team_App.Houston_Rockets_Team_App.StaffActivity" android:label="#string/app_name">
<intent-filter android:label="#string/app_name">
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<!-- <data android:mimeType="image/png" /> -->
</intent-filter>
</activity>
<activity android:name="com.Houston_Rockets_Team_App.Houston_Rockets_Team_App.Settings" android:label="#string/app_name">
<intent-filter android:label="#string/app_name">
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<!-- <data android:mimeType="image/png" /> -->
</intent-filter>
</activity>
<activity android:name="com.Houston_Rockets_Team_App.Houston_Rockets_Team_App.AboutActivity" android:label="#string/app_name">
<intent-filter android:label="#string/app_name">
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<!-- <data android:mimeType="image/png" /> -->
</intent-filter>
</activity>
<activity android:name="com.Houston_Rockets_Team_App.Houston_Rockets_Team_App.EditPrefs" android:label="#string/app_name">
<intent-filter android:label="#string/app_name">
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<!-- <data android:mimeType="image/png" /> -->
</intent-filter>
</activity>
</application>
Here's the apk, I'm hoping it can be opened.
https://drive.google.com/file/d/18VT9Gl4adwBGuMa_omGWtjf0IM4Rc0RD/view?usp=sharing
-I found your bug and its mainActivity not found error raise.
-Please check your MainActivity path into the manifest and set right classpath into the manifest that will solve your error.

How to launch Android apps using URL link in web browser ?

I have been trying to launch my Android app from a web browser link using the following code.
Please help me to fix/adjust the manifest file and and href code to call my application
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.rose.MoveMobile">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".app.MyApplication"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
tools:replace="android:icon">
<activity
android:name=".Start"
android:configChanges="orientation"
android:label="#string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<data android:scheme=".app.MyApplication" android:host="com.example.rose.MoveMobile"/>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
</intent-filter>
</activity>
</application>
</manifest>
HTML code
Launch Apps
Thanks
Your URL has a scheme of http. Your <intent-filter> has a scheme of .app.MyApplication. These are not the same. Change your <intent-filter> to use http, or change both to something else that the browser will accept (I suspect that .app.MyApplication is not a valid scheme).
Also, please note that browsers are not required to launch apps from links. They may, but they may not. It is up to the browser developer.
<data android:scheme="http"
android:host="example.com"
android:pathPrefix="/myPath" />
This would match everything starting with http://example.com/myPath
So wither you need to change your scheme to http, or you need to change the link in your tag to use a custom scheme like myapp://somehost/somepath
<activity
android:name=".Start"
android:configChanges="orientation"
android:label="#string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<data android:scheme="app" android:host="com.example.rose.MoveMobile"/>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
</intent-filter>
</activity>
Html code:
app://com.example.rose.MoveMobile

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.

Custom scheme doesn't seem to launch in the app intent

I'm trying to create an Android app that needs to use OAuth to authenticate (with the Google Wave data API)
I've specified a custom scheme in my AndroidManifest.xml so that any views to a url beginning "braindump://" should go to my app:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.enigmagen.braindump"
android:versionName="0.1"
android:versionCode="1">
<uses-sdk android:minSdkVersion="7"></uses-sdk>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<application
android:icon="#drawable/icon"
android:label="#string/app_name"
android:debuggable="true">
<activity
android:name=".BrainDump"
android:label="#string/app_name"
android:launchMode="singleInstance">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="braindump" />
</intent-filter>
</activity>
</application>
</manifest>
All that happens though is that after the redirect, the browser address shows the correct URL, but the page content is
You do not have permission to open this page.
braindump://rest_of_address_here
Is there a specific permission that needs to be set to allow this sort of behaviour?
I had the exact same problem (OAuth) and this is how I fixed it.
I've separated my Main from the class that will act on the URI.
Here's how the AndroidManifest.xml should look like:
<?xml version="1.0" encoding="utf-8"?>
[snip]
<activity android:label="#string/app_name" android:name="MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:label="#string/app_name" android:name="OAUTHActivity">
<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="myscheme" android:host="oauth" />
</intent-filter>
</activity>
</application>
[/snip]
And I was able to open URIs like myscheme//oauth?oauth_verifier=xxx&oauth_token=yyy
Actually, it's possible to do it with only one activity, just creating one more intent filter. Like this:
<activity android:name=".MyActivity"
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.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="my_scheme" android:host="my_app_host.com" />
</intent-filter>
</activity>
I don't think this is exactly the cause of your problem, but I got this same error "You do not have permission to open this page" and it was because I was using a scheme with a capital letter. eg "Celly" instead of "celly". This worked fine in the emulator but failed on real devices. Changing it all to lowercase fixed it.
According to the common tasks that should be:
<scheme android:name="braindump" />

Categories

Resources