I've been trying for a week to solve this issue with no luck!
Google play is still not convinced that I have linked my website properly!, whenever I upload my instant app I get the usual:
Your site 'www.servstore.co' has not been linked through the Digital Asset Links protocol to your app. Please link your site through the Digital Asset Links protocol to your app.
Noting that both my instant app and installed app have the same code base (single module), and are actually 9.4 MB after minification.
I know this has been asked multiple times, and I've seen mutiple SO posts about this, however none of the resolutions I've read seem to work for me, I actually tried all of them so far with no luck, What I've done so far to debug this issue:
Website Side:
Made sure assetlinks.json is uploaded to my website and administered with appropriate Content-Type header.
Made sure the file is available with public permission (777)
Made sure robots.txt allows crawling for the file, I actually only have the below in it:
User-Agent: *
Allow: /.well-known*
Verified asset link https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=https://www.servstore.co&relation=delegate_permission/common.handle_all_urls
made sure the asset link is using the right SHA-256 (private key in Google Play), I also never use an upload key, I directly sign my app with the same key and have opted in to Google play signing using that key.
App Side:
added asset_statements to my strings.xml and meta-data under application tag in AndroidManifest.xml
Made sure the first intent-filter containing app link has auto-verify = true in my manifest, also tried to mark all 3 activities that have intent-filter URLs with auto-verify
Added default-url in the manifest to all 3 activities and tried with only the main activity.
Added networkSecurityConfig to xml resources and reference it in the manfiest:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="false">
<domain includeSubdomains="true">www.servstore.co</domain>
</domain-config>
</network-security-config>
In Google Play:
Enabled instant-app release type in new Google Play console.
published the same code to standard release type in Google Play with version code higher than the one I use for my instant app.
I am ready to try anything ..
here is my manfiest file, removing unrelated activities:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:dist="http://schemas.android.com/apk/distribution"
xmlns:tools="http://schemas.android.com/tools"
package="co.servstore.client"
android:targetSandboxVersion="2">
<dist:module dist:instant="true" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<application
android:name=".ServStoreApp"
android:allowBackup="false"
android:icon="${appIcon}"
android:label="#string/app_name"
android:roundIcon="${appIconRound}"
android:supportsRtl="true"
android:theme="#style/Theme.ServeStore.NoActionBar"
android:usesCleartextTraffic="true"
tools:ignore="GoogleAppIndexingWarning"
tools:replace="android:allowBackup,android:theme"
android:networkSecurityConfig="#xml/network_security_config">
<service
android:name=".services.notifications.NotificationService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="***" />
<meta-data
android:name="asset_statements"
android:resource="#string/asset_statements" />
<activity
android:name=".ui.main.MainActivity"
android:screenOrientation="nosensor"
android:windowSoftInputMode="adjustResize|stateHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:autoVerify="true">
<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.servstore.co"
android:scheme="https" />
<data android:scheme="http" />
</intent-filter>
<meta-data
android:name="default-url"
android:value="https://www.servstore.co" />
</activity>
<activity
android:name=".ui.orders.OrderDetailsActivity"
android:screenOrientation="nosensor">
<intent-filter android:autoVerify="true">
<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.servstore.co"
android:path="/businessOrders"
android:scheme="https" />
<data android:scheme="http" />
</intent-filter>
<meta-data
android:name="default-url"
android:value="https://www.servstore.co" />
</activity>
<activity
android:name=".ui.orders.CustOrderDetailsActivity"
android:screenOrientation="nosensor">
<intent-filter android:autoVerify="true">
<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.servstore.co"
android:path="/userOrders"
android:scheme="https" />
<data android:scheme="http" />
</intent-filter>
<meta-data
android:name="default-url"
android:value="https://www.servstore.co" />
</activity>
</application>
</manifest>
To resolve to a particular host url, you should provide the host.
Can you try to remove:
<data android:scheme="http" />
Or add host for the http scheme like below
<data
android:host="www.servstore.co"
android:scheme="http" />
I have had similar difficulties and am trying some things that might help you. Your problem might be a missing intermediary SSL certificate.
When you run the App Link Tester you probably are getting an error response "URL resolving conflicts, please link and verify your digital asset links"
If you then run Postman to connect to your domain (by https) you get an "SSL error: Unable to verify the first certificate". But you will find an HTTPS browser connection to a page on your server works fine.
In my case I understand from Sectigo that one intermediary certificate is installed with the SSL, but the second one is not. I would suggest that you call Sectigo tech support (888.391.4357). You may need guidance to get the missing intermediary certificate.
You didn't include your build.gradle(app) so you might check your SDK versions. They may be tied up with the problems with the READ_PHONE_STATUS permission which you do require as reported in Google play not accepting instant app due to digital asset link
If you have simply accepted the addition implicitly, you might try removing it:
<uses-permission
android:name="android.permission.READ_PHONE_STATE"
tools:node="remove" />
That post also indicates problems with certain versions of play-services. Try:
implementation 'com.google.android.gms:play-services-base:17.6.0'
implementation 'com.google.android.gms:play-services-instantapps:17.0.0'
Related
I've created what I think is an android instant app. When ever I test the instant app functionality via Android Studio it works as expected. I've followed the instructions to generate the associated files for linking the instant app to a URL and placed them accordingly on my site. I've uploaded a signed bundle to a alpha closed testing track. The URL I'm using will work to launch the app. However, when I goto Settings-> Google-> Apps & Notifications and remove the instant app, the link no longer works it takes me directly to the website. I dont understand what I've done wrong as its my understanding that instant apps dont need to be preinstalled the URL should trigger I assume the play store to send over a bundle to load into memory (of some sorts). Am I correct in thinking I should be able to run an instant app with out installing it first? Any help would be appreciated. Below is my manifest file. Which I believe to be correct.
Almost identical problem to: InstantApp not being launched when clicking on link
I've tried the solution mentioned in that post. To no success.
If this description/question sucks please let me know I will try to make it better. Second post ever first got deleted I presume because it sucked? No idea. Thanks community ahead of time for your help.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:dist="http://schemas.android.com/apk/distribution"
xmlns:tools="http://schemas.android.com/tools"
package="learn.instantapps">
<!-- The following declaration enables this module to be served instantly -->
<dist:module dist:instant="true"></dist:module>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:targetSandboxVersion="2"
android:theme="#style/AppTheme">
<activity android:name="learn.instantapps.MainActivity">
<meta-data
android:name="default-url"
android:value="https://mysite/main" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:order="1">
<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="my site"
android:path="/main" />
</intent-filter>
<intent-filter android:order="1">
<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="my site"
android:path="/main" />
</intent-filter>
</activity>
</application>
</manifest>
I have setup react native firebase on my android react-native app to track app hits on analytics. But the hits are not reaching from android emulator. So, I checked the log with adb logcat and found out the below warnings and suspect that this might be causing the issue.
AnalyticsReceiver is not registered or is disabled. Register the receiver for reliable dispatching on non-Google Play devices. See link for instructions.
CampaignTrackingReceiver is not registered, not exported or is disabled. Installation campaign tracking is not possible. See link for instructions.
AnalyticsService not registered in the app manifest. Hits might not be delivered reliably. See link for instructions.
I followed this post and did some changes to the manifest file.
Modified AndroidManifest.xml file:
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.truuue.truuuerental">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:name=".MainApplication"
android:label="#string/app_name"
android:icon="#mipmap/ic_launcher"
android:allowBackup="false"
android:theme="#style/AppTheme">
<meta-data android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id"/>
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="#string/app_name" />
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true">
<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="#string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.DOWNLOAD_COMPLETE"/>
</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="truuuetenant" android:host="*" />
</intent-filter>
</activity>
<receiver android:name="com.appsflyer.SingleInstallBroadcastReceiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<!-- Optionally, register AnalyticsReceiver and AnalyticsService to support background dispatching on non-Google Play devices -->
<receiver android:name="com.google.android.gms.analytics.AnalyticsReceiver"
android:enabled="true">
<intent-filter>
<action android:name="com.google.android.gms.analytics.ANALYTICS_DISPATCH" />
</intent-filter>
</receiver>
<service android:name="com.google.android.gms.analytics.AnalyticsService"
android:enabled="true"
android:exported="false"/>
<!-- Optionally, register CampaignTrackingReceiver and CampaignTrackingService to enable
installation campaign reporting -->
<receiver android:name="com.google.android.gms.analytics.CampaignTrackingReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<service android:name="com.google.android.gms.analytics.CampaignTrackingService" />
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<!-- You will only need to add this meta-data tag, but make sure it's a child of application -->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyB3stzerjTZEubg4WqkF1mJeqAB7TcnXj0"/>
<uses-library
android:name="org.apache.http.legacy"
android:required="false" />
</application>
</manifest>
But still the error is appearing. Any idea on how to solve this issue?
According to the mail that I recently received from Google Analytics team,
What does “stopped processing” mean?
New data you send to the Google Analytics properties listed above will
not be serviced and will therefore, not appear on your reports. This
will appear as though you are no longer sending app data to Google
Analytics.
What will happen to my Google Analytics properties listed above?
Reporting access through our UI and API access will remain available for these properties’ historical data until January 31,
2020.
After our service is fully turned down in February 2020, these legacy properties will no longer be accessible via our Google
Analytics UI or API, and the associated data will be deleted from
Google Analytics servers. In advance of this turndown, we recommend
that you retrieve this historical data through report exports.
NOTE: Bottomline, it is advised to follow and use the Firebase Analytics for reports.
My goals is to have Android automatically open any link that starts with test.touchwonders.com in my app. I have place the required file on my server: https://test.touchwonders.com/.well-known/assetlinks.json
This is the relevant part of my manifest:
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:name="com.justbrands.highstreet.pmelegend.PmeApplication">
<activity
android:name="com.highstreet.core.activity.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 android:autoVerify="true">
<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" />
<data android:scheme="https" />
<data android:host="test.touchwonders.com" />
<data android:host="www.test.touchwonders.com" />
</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="pme-legend"/>
</intent-filter>
</activity>
</application>
When installing the app, however, this is the output I see in logcat:
06-27 09:48:43.267 6488-6488/? D/IntentFilterVerRcvr: Received ACTION_INTENT_FILTER_NEEDS_VERIFICATION.
06-27 09:48:43.276 6488-8080/? I/IntentFilterIntentSvc: Verifying IntentFilter. verificationId:14 scheme:"https" hosts:"test.touchwonders.com www.test.touchwonders.com" package:"com.justbrands.highstreet.pmelegend.acceptance".
06-27 09:48:43.531 6488-8080/? I/IntentFilterIntentSvc: Verification 14 complete. Success:false. Failed hosts:test.touchwonders.com,www.test.touchwonders.com.
My device uses the Charles proxy which allows you to see requests. I see no requests going out to test.touchwonders.com tough. I used adb shell pm clear com.android.statementservice beffore installing, which should have cleared the cache and forced a re-fetch of the json.
It turned out the problem was not in my app, but in the assetlinks.json file on the website's server. In my case the problem was that the MIME type oft he server's response was not application/json My real problem was that I did not have a method of testing my assetlinks file. I have found one in the meantime:
Refer to https://developer.android.com/training/app-links/index.html#testing
and use the testing url
https://digitalassetlinks.googleapis.com/v1/statements:list?
source.web.site=https://<domain1>:<port>&
relation=delegate_permission/common.handle_all_urls
I had the same problem and the problem was not related to assetlinks.json file. I had 3 different domains and one of them was failing to due some misconfiguration. Even if only one domain was failing, applink was not working for other domains either. You may want to check if all the domains are working as expected.
I'm currently working on a libproject (Android) that should be included inside a few other applications.
Everything is working fine now that I've been struggling a bit with Activities and Manifests, exept for the C2DM bit.
I can invoke my different classes fine, but I can't seem to catch the registration ID (or of course actual messages, but that must be the same problem...)
I think the problem is coming from the filtering in my manifest(s), so if anyone has any advice for me, that would be really helpful.
Here is a copy of receiver part of my manifest (from the apps, not the library, but it's actually just a copy), but it's pretty straighforward. I just want to know how I should adapt it in order to invoke the right class in the lib...
<!--
Only C2DM servers can send messages for the app. If permission is
not set - any other app can generate it
-->
<receiver
android:name="com.google.android.c2dm.C2DMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<!-- Receive the actual message -->
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.myapp.lib" />
</intent-filter>
<!-- Receive the registration id -->
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.myapp.lib" />
</intent-filter>
</receiver>
Where com.myapp.lib is my lib package name, and the receiver is in a package named the same (in the lib project, of course).
Thanks in advance for the help, and don't hesitate to ask for furthers details :)
Edit :
I tried with only the lib registered on google C2DM, and also with both app and lib. Same problem
There is a better way of using your C2DM from a library project by using the intent-filter.
The manifest file is the one from the app.
The package for the lib is com.mylib and the one for the app is com.myapp.
There is 2 things to change from the lib manifest.
The classpath used in permissions.
The intent-filter package.
Both should be you app package and not your lib package.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myapp"
android:versionCode="1"
android:versionName="1.0" >
<permission android:name="com.myapp.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.myapp.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<application
android:icon="#drawable/icon"
android:label="#string/app_name" >
<uses-library android:name="com.google.android.maps" android:required="true"/>
<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>
</activity>
<receiver
android:name="com.mylib.C2DMRegistrationReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" >
</action>
<category android:name="com.myapp" />
</intent-filter>
</receiver>
<receiver
android:name="com.mylib.C2DMMessageReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" >
</action>
<category android:name="com.myapp" />
</intent-filter>
</receiver>
</application>
</manifest>
Answer, is anyone stumble upon the same problem...
In the google.android.c2dm package, class C2DMBaseReceiver, method runIntentInService, change
String receiver = context.getPackageName() + ".C2DMReceiver"
with the fully qualified name.. and there you go :)
The manifest looks fine. In your package you should have a class called C2DMReceiver and it should extend C2DMBaseReceiver. This class and the overridden methods it contains are then called upon successful registration and when a message is received. I have written a very basic example of this that may be helpful for you to refer to here
I've been recently exploring the device administration APIs, and i've found that neither my code, nor the sample code on the android developing website have been able to enable the device administration.
The error i get on launching is:
12-28 17:24:49.596: WARN/PackageManager(60): Not granting permission android.permission.BIND_DEVICE_ADMIN to package com.example (protectionLevel=2 flags=0x8446)
and then this when i try to enable the administrator:
12-28 17:27:22.426: WARN/DeviceAdminAdd(396): Unable to retrieve device policy ComponentInfo{com.example/com.example.Receiver}
org.xmlpull.v1.XmlPullParserException: No android.app.device_admin meta-data
I set all the permissions exactly the same as per the requirements for the manifest:
<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>
</activity>
<receiver android:name=".Receiver"
android:label="device_admin"
android:permission="android.permission.BIND_DEVICE_ADMIN"/>
<meta-data android:name="android.app.device_admin"
android:resource="#xml/device_admin" />
<intent-filter>
<action android:name="android.app.action.DEVICE_ADMIN_ENABLED"/>
</intent-filter>
and the device policies are also set exactly as per the requirements stated by the APIs.
<device-admin xmlns:android="http://schemas.android.com/apk/res/android">
<uses-policies>
<limit-password />
<watch-login />
<reset-password />
<force-lock />
<wipe-data />
</uses-policies>
Did i make a mistake in getting the permission or is device administration not available without extra code signing?
You have badly formatted XML as you have closed your <receiver /> tag before the specifying the meta-data element. Here's what it should be:
<receiver android:name=".Receiver"
android:label="device_admin"
android:permission="android.permission.BIND_DEVICE_ADMIN">
<meta-data android:name="android.app.device_admin"
android:resource="#xml/device_admin" />
<intent-filter>
<action android:name="android.app.action.DEVICE_ADMIN_ENABLED"/>
</intent-filter>
</receiver>
Other thoughts that came to mind:
In my project the device_admin.xml file is in the \res\xml directory. Maybe make sure your XML file is there?
Do you need #string on the android:label for the receiver? e.g.
android:label="#string/device_admin"
I'm not sure about this, but do you also need to add a uses-permission XML element to your Manifest.xml too?
according to the http://developer.android.com/guide/publishing/app-signing.html
the debugger signs it just for compiling + running purposes. Wouldn't it still be able to run in the debugger?