Add button to opened app via Linking on React Native App - javascript

I have a case on react native app development :
The app opens an external app (eg. Facebook App)
When Facebook App was opened, I need to add a floating button or whatever to Facebook App, it will be used for back to my application
When that button clicked, it will trigger a function from my react native app
Is it possible ?
What I tried so far is trying to open the app inside a View with WebView and the button that I wanted, but the WebView opens www.facebook.com instead of Facebook App installed.

You can use this module to open other native apps.
https://github.com/FiberJW/react-native-app-link
but as you wanted to place a button that's not possible because if you open other apps then control is no longer available in your app to handle that button in the app which is open now, Webview will always open a web URL, not a native app.

Related

How to pass message from Flutter web app to Native Android/iOS app when the Webapp is Loaded in the Webview

I have built a Web app completely on Flutter and a few pages of this Webapp will be rendered in the Existing Native iOS and Android App through respective Webviews.
In this architecture, the Use case is, There's a button inside the Webapp when clicked on From a Web Browser, should load the Web app's homepage, which works perfectly fine which I'm, achieving through await urlLauncher.launchUrl("$APP_DOMAIN/home).
But in The Native apps, When I click on that Button, It should redirect to Native App's homepage, i.e., when I click on that Button, Some message should be passed from the Webapp to my Webview, using which I'll just call finish() method in My android code which will take the User to the mobile app's Homepage.
In Web app, I'm able to distinguish whether the App is run on a Browser or on a Webview.
Using that condition, I'm calling window.postMessage("$APP_DOMAIN/home", APP_DOMAIN); in Web app using 'dart:html' package.
In my Android app, Inside the Webview I tried these -
val myListener: WebViewCompat.WebMessageListener =
WebViewCompat.WebMessageListener { view, message, sourceOrigin, isMainFrame, replyProxy ->
Timber.d("onWebMessage: ${message.data}")
}
if(WebViewFeature.isFeatureSupported(WebViewFeature.WEB_MESSAGE_LISTENER)) {
WebViewCompat.addWebMessageListener(webView, "window", setOf(), myListener)
} else {
Timber.d("Web_MESSAGE_LISTENER not supported")
}

Adding website action link to android native share widget?

Is there a way to add a website action link to native share widget in Android without developing an app as shown below?
Android Share Action Item:
Simply need user to capture the data (url) from any app on android and post it to my url for processing without needing a new app to do this?

Without opening an app, how to check if an app is installed in ios device or not from website?

I want to check if an app is installed in iphone or not from web page using javascript. If app is installed then i want to show "open" button in website, once if user clicks "open" button in website then i have to open an app in iphone by custom url scheme. If app is not installed then i want to show "Download" button in web page. How to do this?
I had tried javascript with setTimeout function which tries to open an app by custom url scheme, but it directly opens an app. Without opening an app, how to check if app is installed.

Can you communicate to a native mobile app from mobile web browser?

I want to find a way to run native mobile app, from a web app on a browser, and communicate the result back to it.
For example, how does Facebook user authentication work on a mobile device? You go to login with Facebook on a website. If on mobile, it opens the native Facebook app to do the authentication, and redirects the user back to the mobile web browser to open some page, post-authentication. Somehow, web browser and native application are able to communicate? Is there also any security risk to this?
One way to do this is as follows:
Use a custom url to launch the app from the website (see link below)
Pass whatever parameters you need to the app (for example a return web site URL in the case of a login authentication type app)
Once the app launches and does it thing, have the app launch a browser using the return address URL you passed as a parameter to the app.
A good, well maintained, link to using custom URL's and passing partakers to the App:
http://iosdevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html

How to open Android app from Sencha Touch Application and send some data?

I am developing a web app using sencha framework. I need to send some data from my web app to a native android app. Is there any way to do this ?
Can we initiate a broadcast from webapp, so that native android app can listen to it ?
Please let me know.
Thanks.
What you want to do is to start another application and send data to that app this is called deep-linking.
Here is a Cordova/PhoneGap plugin for doing so: https://github.com/code4jhon/LaunchMyApp-PhoneGap-Plugin
So lets say you have ToDoApp and you want to click a button and open lets say another ST app with the list of to-do tasks of ToDoApp this plugin allow you to do this. (This also applies to open native Android App (you actually start an Activity through the plugin (happy researching)))
So if you have not added Cordova or Phonegap to your ST app it is time, look at this:
http://vimeo.com/76568053
Regards

Categories

Resources