I am using local notifications in my Expo app and request permission at run-time using Permissions.askAsync(Permissions.NOTIFICATIONS). What is the Android permission name to set this in app.json?
You don't need to set anything in app.json for notifications to work.
Here is the list of other permissions, that do require an app.json update: https://docs.expo.io/versions/latest/sdk/permissions/#android-permissions-equivalents-inside-appjson
Related
I want to us gsutil to list files in a google cloud bucket.
I installed the google cloud sdk, my problem is that i have a credential file client_secrets.json that is for a installed application, it looks something like this
{
"installed": {
"client_id": "837647042410-75ifg...usercontent.com",
"client_secret":"asdlkfjaskd",
"redirect_uris": ["http://localhost", "urn:ietf:wg:oauth:2.0:oob"],
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://accounts.google.com/o/oauth2/token"
}
}
I know you can authenticate using
gcloud auth activate-service-account --key-file=credentials.json
but that only works for service accounts and mine is an installed application credential and it didn't work.
Instead of using gcloud auth I've tried to switch to do authentication using boto by running
gcloud config set pass_credentials_to_gsutil false
and updating the .boto config file to update the client_id and client_secret manually from my file but when i run gsutil config to run the new credentials it keeps asking me to login through the browser to provide a code after a manual login:
Please navigate your browser to the following URL:
https://accounts.google.com/o/oauth2/auth?client_id=20487....
Enter the authorization code:
but this is an app that should not need a user to login since i already have a credential file.
What am i missing? how can i authenticate using an install app client_secrets.json using gsutil.
You don't have a credential. Your file is a OAuth2 Client Id (of type Desktop). The tools use it to initiate a OAuth 2 authentication, and yes you need to log in because there isn't any credential in this file.
The clientID and client secret are used to authenticate your log in request with your login and your password, it's not a credential of you, just for the OAuth2 protocol!
This Documentation provides a complete workflow to use an installed application credentials, you need to configure your application and save your credentials in a client_secrets.json file and after the whole configuration and authentication process you will be able to use the gcloud/ gsutil command. You can refer to this Public Google Documentation for managing your secret key to create and authenticate your service account key.
You can also refer to the stackoverflow Question where a googler has explained how to pass key.json file to gsutil by using .boto configuration for your json file.
I have appengine application protected by IAP/GCIP using email as external provider.
Using sample angular project for firebase authentication as provided in iap-gcip-web-toolkit github project, I want to use this authentication UI for the appengine application
When I try to access the firebase authentication UI, getting following error
Client specified an invalid argument
I have ensured that firebase uses the gcp project linked to it and also the API Key associated with firebase/gcp project is used.
Why is this error getting thrown?
Looks like a bad reference of my firebase app associated with gcp project. Uploaded auth ui app to the firebase account associated with gcp project once again and it worked fine
I'm using Expo to build 2 android app, and using 1 Firebase Project.
For Notification I'm using expo-notifications.
I had uploaded Firebase Server Key to Expo expo push:android:upload --api-key XXX-XXX-XXX.
I had configured android app credential in firebase Project Settings with SHA-1 from Google Play Console, then downloaded the latest google-services.json, then placed in app.json and set path android.googleServicesFile : "./google-services.json".
I had configured package name API Google Cloud Platform same as app.json android.package, same as Android App Firebase Project Setting Package Name.
I had configured SHA-1 Certificate Fingerprint API Google Cloud Platform and Android App Firebase Project Settings same as SHA-1 Certificate Fingerprint from Google Play Console.
I had enabled Firebase Installation API, Firebase Cloud Messaging, FCM Registration API, Cloud Messaging in Google Cloud Platform.
I set single user login within my app, so When user did new login, the past of usertoken will be reset to a new token, and another login will be logout.
The problem is, one of my app works perfectly, and another one came out with error, it said, Fetching the token Failed, message : FIS_AUTH_ERROR.
And Notification is not delivered to broken app.
Help me please...
I'm trying to get the list of the intents in my Dialogflow agent using Dialogflow's V2 APIs but have been getting the following error:
PermissionDenied: 403 IAM permission 'dialogflow.intents.list' on 'projects/xxxx/agent' denied.
I adopted the following steps:
I created a new agent(with V2 APIs enabled) and a new service account for it.
I downloaded the JSON key and set my GOOGLE_APPLICATION_CREDENTIALS variable to its path.
Following is my code:
import dialogflow_v2 as dialogflow
os.environ["GOOGLE_APPLICATION_CREDENTIALS"]="/home/user/folder/service-account-key.json"
client=dialogflow.IntentsClient()
parent = client.project_agent_path('[PROJECT_ID]')
for element in client.list_intents(parent):
pass
I have made various agents and service accounts and even changed the role from Admin to Client but can't figure out any solution. I tried the following solution but didnt' work
Tried Solution: DialogFlow PermissionDenied: 403 IAM permission 'dialogflow.sessions.detectIntent'
There is no need for creating a new Agent. You can edit the existing agents IAM.
In Dialogflow's console, go to settings ⚙ > under the general tab, you'll see the project ID section with a Google Cloud link to open the Google Cloud console > Open Google Cloud.
In google cloud, go to IAM Admin > IAM under tab Members. Find the name of your agents and then click on edit.
Give admin permissions to the agent to give permissions to list intent.
The problem lies in the IAM section of GCP. Probably you are making a POST request with a role that does not have the necessary authorizations.
Look into your key.json file that contains the field "client_email"
Proceed to the IAM page and set the relevant role with that email to
a role that has posting capabilities. (e.g. Admin)
This solved my problem.
In Dialogflow's console, go to settings ⚙ > under the general tab, you'll see the project ID section with a Google Cloud link to open the Google Cloud console > Open Google Cloud.
(Optional) In the Cloud console, go to the menu icon > APIs & Services > Library. Select any APIs (if any) > Enable.
In Cloud Console > under the menu icon ☰ > APIs & Services > Credentials > Create Credentials > Service Account Key.
Under Create service account key, select New Service Account from the dropdown and enter a project name and for role choose Owner > Create.
JSON private key file will be downloaded to your local machine that you will need.
For Javascript:
In the index.js file you can do service account auth with JWT:
const serviceAccount = {}; // Starts with {"type": "service_account",...
// Set up Google Calendar Service account credentials
const serviceAccountAuth = new google.auth.JWT({
email: serviceAccount.client_email,
key: serviceAccount.private_key,
scopes: 'https://www.googleapis.com/auth/xxxxxxx'
});
For Python:
There's a Google Auth Python Library available via pip install google-auth and you can check out more here.
When you create the intentClient, use following:
key_file_path = "/home/user/folder/service-account-key.json";
client=dialogflow.IntentsClient({
keyFilename: key_file_path
})
Intents list
This error message is usually thrown when the application is not being authenticated correctly due to several reasons such as missing files, invalid credential paths, incorrect environment variables assignations, among other causes. Keep in mind that when you set an environment variable value in a session, it is reset every time the session is dropped.
Based on this, I recommend you to validate that the credential file and file path are being correctly assigned, as well as follow the Obtaining and providing service account credentials manually guide, in order to explicitly specify your service account file directly into your code; In this way, you will be able to set it permanently and verify if you are passing the service credentials correctly.
Passing the path to the service account key in code example:
def explicit():
from google.cloud import storage
# Explicitly use service account credentials by specifying the private key
# file.
storage_client = storage.Client.from_service_account_json('service_account.json')
# Make an authenticated API request
buckets = list(storage_client.list_buckets())
print(buckets)
Try also to create project in DialogFlow Console
https://dialogflow.cloud.google.com/
You need to create the following as environment variable
googleProjectID: "",
dialogFlowSessionID: "anything",
dialogFlowSessionLanguageCode: "en-US",
googleClientEmail: "",
googlePrivateKey:
I think you might have missed the Enable the API section in the documentation setup.
Here is that link:
https://cloud.google.com/dialogflow/cx/docs/quick/setup#api
After clicking the link, select the chatbot project you created and fill the necessary instructions given there.
The permissions that I have given for that project are Owner, and editor.
After this, try the code in this link:
https://cloud.google.com/dialogflow/es/docs/quick/api#detect_intent
You should get a response from your chatbot
Hope this helps!
I would like to deploy a Logic App from VS 2017 into another tenants subscription. I am the owner of the target resource group but I am still getting the LinkedAuthorizationFailed error when using the deploy functionally within VS2017.
10:40:41 - "error": {
10:40:41 - "code": "LinkedAuthorizationFailed",
10:40:41 - "message": "The client has permission to perform action 'Microsoft.Web/sites/functions/listSecrets/action' on scope '/subscriptions/XXXX/resourcegroups/XXXX/providers/Microsoft.Logic/workflows/LogicappName', however the current tenant 'XXXX' is not authorized to access linked subscription 'XXXX'."
10:40:41 - }
I can create and manage logic apps via the web portal. But it should also be somehow possible to deploy via VS or?
I was a co admin before and I thing it worked than, but I can't expect the client to make me a co admin just to deploy Logic Apps.
This error is not related to the permissions to deploy a Logic App , but to get the keys of an Azure Function that is being called within the Logic App. You need to check that you have the correct permissions not only to deploy onto the resource group you want to, but also to get the keys from the Azure Function you are calling from the Logic App.
HTH
In my case I had a wrong azure function linked within the logic app.
After fixing the wrong subscription i linked there the error went away.