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!
Related
When I launch the firebase dynamic link, it keeps relaunching my app. Is there a way to not relaunch it? For iOS and Android. Android I read you have to put the intent filter but I do not know how to do it for iOS. Because of certain functions, i require the app to maintain its state, because I am waiting for a webhook from the other app that I have launched to.
And the other app, doesnt append the data back to me... so I lose all my data. <<< this happens IF I provide the dynamic link to the other app and it calls the dynamic link.
Currently, what I am doing is just relaunching the app and relying on a callback url that the other app offers which also currently not working out, firebase dynamic link gives me useless information, instead of keeping the original link, it gives me the fallback url, which unable to append parameters as the other app appends a & without url encoding, so all i get is a url with 0 information.... and even with the information I have to jump through hoops to navigate to the right page... seriously... why?
Please help. I have no idea what to do.
PS:
So ultimately removing all my intent-filter with host and scheme of my Firebase dynamic link. Removing my associated domains app links. Ultimately, I am unverifying myself to the app link. But it gives me the most ideal result which allows an external app to call my app, and continue where I left off.
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.
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 :-)
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.
If I am building an Android app that uses the Facebook SDK and also has a web app that has most of the same functionality, how should the Android app handle social actions? Should it directly make requests to the Facebook API through the SDK or should it post to the web app server through my own API and allow the web-app to make the request to Facebook on behalf of the Android app? Most of the Facebook for Android examples use the former approach however none explicitly discuss the best practice when there is a web backend that will have the same social functionality as the Android app.
I've been putting my mind into a similar problem before. It was a PHP app, but essentially the design choice was to either put the FB-interaction into the frontend (JS-SDK) or into the backend and proxy it (PHP-SDK). Sadly haven't found much guidance either, so I had to make up my own mind.
As so often there seems no per-se answer, it depends on what you are doing with FB and how deep it is integrated into whatever your app/webapp/backend are doing. Is your Android otherwise more a client-side app or does it rely on other features delivered by the web-app via web-service? Is it somehow integrated with users actions that are dispatched to the backend, or does it just offer some additional gimmicks (e.g. 'Like' button, anything in the lines) Are you using the SDK to authenticate and pull user related data from FB (email, name) and does that information play a role in your backend?
As I see it, it boils down to the following:
Direct communication with FB is a lot simpler to implement as you won't have an additional layer between your app and FB, i.e. proxy code, etc. So if FB is just loosely coupled it's likely the 'good-enough' option.
Patching FB from frontend to backend can get nasty - especially if you want to authenticate via FB it's kinda complex at first. However, you'll have all FB logic in a single place, shared by Android-App and Webapp, so it's obviously easier to maintain later and better to integrate with other interactions your backend might be offering.
Hope that provides some value, would be eager to see other opinions too.
Well I think both approaches are correct but the choice depends on mostly what you already have in place on the server side and if you are planing to use the same functionality from different apps like (Android,iOS, Windows Phone apps). In that case it makes sense to just get user token with permissions you require on the front end and let the web server talk to facebook using that token. You could even save this token for the user so they don't have to give permissions again if for example you have web registration and app registration. In our app we are using this approach since there are basically five front ends (Android,iOS, Desktop,Mobile Web,Full Web) this way application developers just get token using sdk on there platform (you have to use tokens and not user name, password because of facebook rules for security). On the other hand if all Facebook communication is used only inside your app and the server doesn't need to know much about it put api calls in the app.
In my opinion, it is best to use the available SDKs/APIs for each given platform instead of trying to write your own centralization and use a single library. Since you are specifically interested in how the Android app should handle social interactions, I suggest using the Facebook SDK for Android.
While it does increase the size of the code you must maintain and the SDKs/APIs you must learn as your list of platforms increases, the most important factor for this approach is the user experience. By sticking with the native libraries, and growing your app as those libraries evolve, you will be providing your users with an experience that they are most likely to be used to. They won't have to learn how to use your app, but will be able to make posts, update their status, and look at their friend list using controls that they are accustomed to using. Additionally, you will be able to take advantage of specific platform functionality (in the mobile case, such as having your app post to a users feed in a way that promotes your app: https://developers.facebook.com/docs/tutorials/androidsdk/3.0/games/feed/)