I'm trying to get my chrome packaged app to be able to launch a third party chrome app. Unfortunately, I am unable to use chrome.management.launchApp() because the management API is unsupported for packaged apps. I found several other answers on SO that suggest using messaging to launch the app such as the one found here, but they all refer to launching one's own app.
Is it possible to send some message that will automatically launch the app, like this:
chrome.runtime.sendMessage(<appId>,<launchApp>)
Or is there some other way to do this?
Related
I'm thinking to pass to a web app IDE like cloud9 to host my apps currently in development.
The problem with this is that i don't know how to test my code in the way I normally do with a simulator, locally.
I'm trying to develop on a remote server, and building on that remote server, an i want to test the app with my real device, with live reloading absolutely. If it's not possible to use my real device i could use an emulator and it's ok, but I'd prefer to use my phone.
I see you are using metro-bundler, you can achieve this by using the Tunnel option in connection:
This will create a global link to communicate with any of your devices. Then you can easily use the QR code or just the generated link in your own mobile device using expo app.
Now you can debug and test with your actual physical phone or emulator without publish it.
I am creating a PWA using Nuxt and I want to use the Chrome TCP API to communicate with TCP devices directly. The API is detailed here https://developer.chrome.com/apps/sockets_tcp
I have confirmed that clients are downloading it when they access the page.
manifest.json
{
"name":"pwa-demo",
"short_name":"pwa-demo",
"description":"Test App",
"publicPath":"//_nuxt/",
"icons":[
{
"src":"/_nuxt/icons/icon_64.fj_mLYH_Zr_.png",
"sizes":"64x64",
"type":"image/png"
}
],
"start_url":"/?standalone=true",
"display":"standalone",
"background_color":"#ffffff",
"theme_color":false,
"lang":"en",
"sockets":{
"tcp":{
"connect":[
"*:8023"
]
}
}
}
However, when the PWA is run in the browser or after installation (both on desktop and Android) in all cases I get the following error trying to call a chrome.sockets.tcp API: TypeError: Cannot read property 'tcp' of undefined
The Chrome "apps" API (https://developer.chrome.com/apps) does seem to suggest that it is meant to be done using Cordova but I figured that that suggestion was old (there's other content on the page from 2014) and that once a PWA is installed there shouldn't be a functional difference between an installed Cordova app and a new installed PWA. They're both wrappers around a Chrome WebView (except of course Cordova can expose more native APIs).
I am guessing that the chrome.sockets.tcp API is actually exposed through the Cordova wrapper and not Chrome itself, but I have not found anything that confirms this. Google has publicly expressed that they want PWAs to replace Chrome Apps so one would hope that the API was moved into Chrome itself. There seems to be a lot of people confused about whether it can be used by Chrome extensions too.
Is my manifest wrong? Or can someone confirm that this API is not usable by PWAs?
Chrome Apps are specialized apps that are distributed through the Chrome Web Store. Think browser extensions but more app like. Websites do not have access to the privileged APIs available to Chrome Apps.
Also note that Chrome Apps are being retired for everything other than Chrome OS.
I have a cloud web app using asp web api and angular. Both hosted on azure. I need my angular app to be able to communicate to serial port (read/write). How can I do this?
I've read that chrome apps can connect to usb/serial, but i'm still confused of how it works. Should i rebuild my apps to chrome apps, or should i create a seperate apps or can i just write chrome apps that open my actual web and access the serial from my current app?
You don't have to rewrite your app. Just create a chrome app and use webview for your actual cloud app. Basicaly you have to write the serial port communication in the chrome app context and pass the data to your webview context in your chrome app which is actually the app loaded from your cload.
Other approach is to write your whole application in an offline chrome app and communicate with your cloud server trought ajax or websocket.
Another thing might help is nw.js. With this you can create desktop like apps with web technology. Basicaly in your nw.js app you will use a node.js serial modul for serial communication.
Or combinate these methods.
I suggest one of the chrome app way cuz I have good experience with its serial module.
I need to combine functionality available only in a Chrome packaged app (access to syncFileSystem) and functionality available only in a Chrome extension (injecting a script into a 3rd party website).
It seems that neither a packaged app nor an extension can achieve both these things, so I'm now considering trying to achieve what I'm after with a separate packaged app and extension communicating.
I see that Chrome's documentation explains how two extensions can communicate via chrome.runtime.onMessageExternal.addListener and chrome.runtime.sendMessage, but nothing about packaged apps and extensions communicating.
Does anyone know if this is allowed? Is there any documentation, or a working example out there?
Yes, that is possible. The code sample in the documentation you linked works for any combination of app and extension.
The extension documentation for chrome.runtime.sendMessage says:
Sends a single message to onMessage event listeners within the extension (or another extension/app).
Messaging works the same in both extensions and apps, and they seem to be fully compatible; simply use the ID for the destination extension or app. If you look at the docs for the app version of chrome.runtime.sendMessage, you'll see that it is identical to the extension version.
I build a webapp and I have social links in my webapp.
I am facing an issue regarding this. If I am having facebook installed in my device then on click of the share link it should open the native app instead of opening in browser.
And incase if I doesnt have any native app installed then it should automatically redirect to browser.
Here it is the code what I have tried:
Javascript:
if(isAndroid){
fb://profile//www.facebook.com/sharer/sharer.php // to open in native browser
http://wwww.facebook.com // to open in web browser.
}
How do I handle this urls...
Please help me out.
This is not possible, for privacy reasons.
See This answer
You can make Hybrid Application.
What you just need to do is ADD WEB INTERFACE which will make call to native source code through javascript and also get return value.
So you can write native function which will return if application is installed. Once you set this interface you can use it further for open that app and passing intent and all that.
You can do it easily. Start Here:
https://developer.android.com/guide/webapps/webview.html