Pregunta

I am following the guide here: https://developer.chrome.com/apps/app_identity#copy_key

Unfortunately, there is no listing for my app in the ~/Library/..../Default/Extensions folder, or at least no listing that matches the id I see in the chrome://extensions page. I copied the id from that page and used it to make my Client ID in the Google Developers Console but I can't get the following to work:

chrome.identity.getAuthToken({ 'interactive': true }, function(token) {
  //...
});

It takes me to my chrome settings page and shows me an error asking me to sign in. If it matters, I am calling the above code from inside an AngularJS controller in a cca-built app (a lot of Google in that stack).

What am I doing wrong?

¿Fue útil?

Solución

The bit you're missing is that you have to install your extension at least once in order to generate the key.

This: https://developer.chrome.com/apps/manifest/key documents the process for generating the key you need.

This: https://github.com/GoogleChrome/chrome-app-samples/blob/master/identity/manifest.json is an example of what your manifest.json will look like with a properly generated key.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top