i create my TWA app based on this repo: https://github.com/GoogleChromeLabs/svgomg-twa
I would like to extend the code with In-App Review https://developer.android.com/guide/playcore/in-app-review
Is it possible to do this? I am front-end developer. I have no knowledge of android application
Maybe i can listen to url change? For example in html create anhor
Rate app now!
and app listen and check current hash in location.
Nowadays, I'd recommend using #bubblewrap/cli to bootstrap the Trusted Web Activity project, as svgomg-twa has been deprecated and replaced by Bubblewrap.
In short, yes, it is possible to integrate in-app-reviews in a Trusted Web Activity.
The general approach is to use a custom schema, like my-app:// that is handled by an Android Activity. This Activity will, in turn, launch the review flow and then finish itself.
There are some caveats though:
You'll need to check if the all is in "trusted web activity mode" in order to display the link, as it only works when inside a Trusted Web Activity.
This may also not be compatible with Chrome OS, so if you are also deploying the Trusted Web Activity there, I wouldn't recommend integrating in-app reviews.
Here's a blogpost with more details on how to do it.
Related
I am using a SDK (library like we use for payments or ads or some app which opens a webview), which is launching an activity. How Can I get the view instance of this activity which is launched by the SDK.
One method I know is to use ActivityLifeCycleCallbacks. But is there any other simple way to get this??
You can not. Android is a secure system and prohibits access to things you should not access.
In case of another app, it will be started as a separate process with no direct access and no access at all to things like views or Java objects. You should follow the documentation of the app developer, pass all data you need to pass in an Intent and await a response if needed.
In case of a library, you will not have access to Activities opened by it, as they are treated as closed components. It is possible that the developer created some sort of interface which would allow that, but there is no standard way to do this.
There is one workaround:
If the library is open source, you may choose to clone its repository and add the code locally to your app. This way you will be able to edit it and receive access to the components. But this will probably not work with secure things like payments or ads.
Again, just follow the documentation provided by the developer, be a good citizen :-)
We have a case where we want to navigate between apps, case where
triggering a payment will open the payment app
once the payment is complete it should navigate back to the original app.
I have found few theoretical solution for (1), can use Android Intent(I hope I'm right here), or use services like https://deeplink.me. Which navigate to the payment app, I assume here that I can pass some complex data along with the request to navigate to the correct page on my app.
For problem 2, I'm yet identify a solution, Do I have include Intent filter in the source app too? say the source app uses the payment app's sdk and is there a way I could pass back the response an HTTP response which the source app can use to navigate to the right page (payment success or failure).
You are correct: an Android Intent can be used to open another app (documentation). Facebook's Applinks standard can also do this, as can the Branch.io service (amongst many other things). Deeplink.me AppWords is a neat concept, though it appears to be bid-based and I can't see a way to open a specific app on demand.
However, unless there is a need to use an external app for this, why not just integrate something like the Stripe Android SDK, or PayPal's braintree SDK or native SDK directly into your app? That way you don't even have to worry about passing data around externally and you retain end-to-end control of the process. Seems like a far more elegant solution!
Is it possible to use CloudKit Web Service from Android native app? How will that authentication popup window appear in a native app if I want to let user able to modify records?
Can I put a button to the native app, that will open up browser and the redirected content will appear there, and when authentication successfull, specify a callback where token which uniquely identifies users, I guess user record name can be received?
Apple engineer talks about login from web here on this session video: https://developer.apple.com/videos/wwdc/2015/?id=704
CloudKit Web Services is intended "to provide a web interface for users". If you use it to provide a native Android interface, you will probably get your iOS app rejected and lose your CloudKit access entirely.
But if you want to try it, Apple already has documentation for CloudKit Web Services which explains how to authenticate users.
From looking at the session video you mention, and also at the links and comments from Richard, I would say the answer is No to writing full native Android CloudKit apps. The reason is that Apple does not give you the option to enter the userID and password in your own dialog. The user can enter those only in a web window popped up by the apple code. So it seems at least that part of the app (authenticating the user) needs to be done using web code. I am not an Android programmer so perhaps it is possible to put together a hybrid app that addresses this issue.
Having said that, public database access does not require an iCloud account so you may be able to write an app that only uses access to the public part of your container using native Android code.
I am no expert but this is what I read on Apple website.
Use an API Token from a website or an embedded web view in a native app, or when you need to authenticate the user.
Maybe its like Netflix. Because Netflix iOS app looks just like netflix.com. To me it looks like netflix is using embedded web view. Maybe you can do the same with CloudKit.
Recently I built an Android app that consume data through JSON from a back-end. There is no public/front zone, it's only back-end. Moreover I built a showcase-website just to let people know the app exists.
Back-end and Showcase-Webiste reside at two different URLs. In the developer console I enabled the app indexing and the showcase-website is the one I set.
I'd like to add deep linking but I can't figure out how to configure the intent-filter.
For example, suppose my showcase-website URL is this:
http://nolimitsworld.com/
How should I configure the data section of the intent-filter? the host parameter should be?
The question in your subject line is misleading. You do have a public web site, and that's your showcase web site. Use that showcase web site for your intent filter. The backend url only gets called from your android app anyway, so no one needs to know that one but you.
If you still need help figuring it out, please remove the api url from your question, and just show us the url to your showcase web site instead (and only register that one with google).
Now if your other concern is that you wish to index your application without going through any web site at all since most people wouldn't recognize the domain name of your web site anyway, then there is actually no need to do deeping linking and app indexing through google.
You could just get away with indexing the content of your app with a search provider and launching your app with an explicit intent. Google doesn't even need to get involved if you do that.
I want to make a application that has similar function as Android Beam, but the question is how to get the content of those running apps. For example, if the web browser, Youtube and Google Map is running, how do I get the web address, the video link and the location? Thank You.
You will only be able to get information like this if the running application provides it through some sort of global access method, e.g. a service or content provider. It is highly unlikely that any application will do this as it has some serious security/privacy implications.
You will only be able to develop such an application by writing a system application aka you'll need root permissions.
The best approach in my opinion will be that you look through the Android Beam source code, to see how it's done there. The official API will not help you here. Since the functions used in such system applications is not in the API there is no guarantee that it will work with future versions of Android, so be careful.
I doubt that this will be an easy task. If it's really similar to Android Beam, try building your code on top of the official source.
For Android Beam, the app itself is sharing the data. The NFC background service gets the data to be shared via Android Beam delivered to it by the app's Activities. An Activity either calls at the beginning (e.g. in onResume()) the method NfcAdapter.setNdefPushMessage() to share a static piece of data or it calls NfcAdapter.setNdefPushMessageCallback() to register a callback that will create the data to be shared at the moment Android Beam becomes active.
A number of the standard Android and Google apps have been extended to support this in Android 4.0 ICS, for example Browser, Gmail, Maps, People and Youtube. Apps that have no support for this, will by default share a link to the download page of that app in the Google Play store.