How do I handle options in a packaged Chrome App? - google-chrome-app

I want to deploy an existing JS app as a Packaged Crome App to make it distributable in the Chrome Web Store.
In "legacy packaged apps", there is/used to be a way to specify an options_ui page (in old legacy (legacy-legacy?) apps it was options_page) which would be accessible via a special link from your app, or by automatic link from from within chrome://extensions.
There doesn't seem to be any mention about how to migrate the options_* feature, but if the manifest.json of a Chrome App has the options_ui key it generates the following warning on the extensions page:
'options_ui' is only allowed for extensions and legacy packaged apps, but this is a packaged app.
(References)
Chrome Developer: Migrating from a Packaged App to a Chrome App or Extension
Stack Overflow: Difference between a Packaged App and a Legacy Packaged App in Chrome

You can create a context menu item on your icon to open your options.
Add the "contextMenus" permission, then add something like this to your background page:
chrome.runtime.onInstalled.addListener(function() {
chrome.contextMenus.create({ id: "options", title: "Options", contexts: ["launcher"] })
})
chrome.contextMenus.onClicked.addListener(function(info) {
if(info.menuItemId == "options") {
chrome.app.window.create("options.html")
}
})

Related

I want to update the existing logo for my PWA app

When I am updating the logo of the PWA app the icon is not getting updated for the previously installed applications. However for newly installed apps I am getting the correct logo.
Did you try updating the new image icon in manifest.json & then showing a prompt to users to refresh the PWA?
You can try to have a look at the documentation for Android APK (from the question is not clear your target device: web or mobile).
Chrome will periodically compare the locally installed manifest against a copy of the manifest fetched from the network. If any of the properties in the manifest required to add the PWA to the home screen have changed in the network copy, Chrome will request an updated WebAPK, reflecting those new values.
This feature is not yet available for desktop, but planned in a future release.
Do you use any framework (Angular, React) to build your PWA? If you want to read more details about how to install an app on the homescreen or the web manifest properties, you can have a look here.

Worklight Facebook platform selection?

For Facbook integration in Worklight which platform should we select Android or Website
,
right now i am developing for android environment but later i will be doing for iphone and windows as well
Also were do i place the Facebook integration code in index.html(main) or in android project which is separately created ?
i am confused do reply
It looks like you are developing a Worklight-based Hybrid application, so in this case you should actually opt for the Facebook JavaScript SDK.
You can add it to your common\js folder and reference it in the common\index.html (just follow the instructions Facebook probably provides). This way you could easily 'extend' it to whichever additional environments you will add in Worklight Studio in your project setup.
Of course, you can also choose to use Facebook's native SDKs for each environment in your Hybrid application. In this case, you'll need to add the SDK in the iphone-ipad-or-android\native folder and follow Facebook's integration instructions (note that for iPhone the actual integration will be done in Xcode, not Eclipse).
If you choose to create a native application and bundle it with the Worklight SDK, then you should opt for the Facebook SDK dedicated to the specific OS. Here, you will add the SDK, again, by following Facebook's instructions.

Is the launch web_url in the manifest ever used for a Google Apps Marketplace app?

A Google Apps Marketplace app is now published via the Chrome Web Store. You can specify a URL as part of the Marketplace SDK (universal navigation) and as a launch web_url in the Chrome store manifest.
For a Marketplace app with universal navigation URL provided, is the launch web_url (in the manifest) ever used?

chrome.identity in development

I'm confused by how I can develop a Chrome App with chrome.identity.
The instructions say that I need to add the key to my manifest.json, and that I need to put the extension id in the Google API Console.
I have a published version of the app, and I am currently developing a local copy, so I am loading it unpacked from my local file system.
Can I put the key from the published app in the dev manifest.json?
Does the extension id in the Google API Console need to be of the published app, or my local one?
Yes you should do that to debug chrome.identity without pain.
If you place public key of your published app inside manifest.json, your app will have the same ID as the app in Chrome Web Store.

Can we bundle Chrome installer with Packaged App?

We have built Packaged App for our Web Application.
Is it possible to provide Chrome installer in a Packaged App bundle or somehow trigger Chrome installation in the background from Packaged App.
Currently Chrome Browser is separate Dependancy for using Packaged Apps so it is difficult to convince Users to first install Chrome browser.
Also, people can install the App for any location as a complete package.
It's not possible yet, but you can star http://crbug.com/173762 to get notified when it does work.