#@Erick (Unity) hi! Could you explain pls

1 messages · Page 1 of 1 (latest)

rain plover
#

My guess is because of your access control rule where you block all services (deny-all-ugs-access)

If you whitelist the remote config route, I believe it should work

#

you can try deleting the rule just to see if it works fine.

#

There's a reason why it still works on the client and it has to do with the endpoints that the client package is using, it's super specific to remote config.

rain plover
#

From a rest api, it would look like
POST https://services.api.unity.com/access/v1/projects/PROJECTID/environments/ENVIRONMENTID/resource-policy:delete-statements
Content-Type: application/json
Accept: application/problem+json
Authorization: AUTHORIZATION
{"statementIDs":["deny-all-ugs-access"]}

For the CLI, documentation is available here for the delete operation: https://services.docs.unity.com/guides/ugs-cli/latest/access/Access Command Line/Commands/delete-project-policy-statements/

Delete statements for project based policy.

rain plover
#

I misread your initial rule. I see that you are allowing everything and not denying. (the name threw me off)

It would still help to try to reproduce without any rules in effect.

wispy lake
rain plover
#

Okay these policies should be fine.
The problem seemed to be with the command, are you missing a space between the command and the file?

wispy lake
#

oh yes thanks! now it's seems problem with json format

rain plover
#

Looking at your initial code, i'm missing a bit of context but you are only injecting your remote config service in one of the functions.

I don't really see enough of the script to understand what's happening but is that expected?

wispy lake
#

fixed. thanks! don't understand what exactly was wrong but online fixer helped

wispy lake
#

As for script logic I want to get remote config inside cloud code function that trigger when player profile created (trigger)

#

even with default policy, have an error. there seems to be an error somewhere in my logic

rain plover
#

Oh I didn't realize this was done from a trigger.

It probably does not have an access token since the operation is not originating from a player. You could log the value to verify.

Let me verify a few things

#

Triggers would usually use the service token instead but I don't think remote config supports this as this time. I will be able to confirm tomorrow

wispy lake
#

if I can just call GetCommonConfig somewhere in the initialization area and cache it, then that would be a suitable option for me too.

rain plover
#

I will confirm if remote config can be used with service token tomorrow.

wispy lake
#

To remove trigger is it enough to remove configs element or need to delete file from UGS? It seems that method2 continues to be called even after being deleted in the config

rain plover
#

For triggers, you'll need to use RemoteConfigSettings.AssignSettingsAsync with no token.
You need a valid player id however for this call.

Example:
var request = new SettingsDeliveryRequest(
context.ProjectId,
"The player id",
null,
context.EnvironmentId,
"settings",
null,
null,
false,
null,
null,
new RequestAttributes(new UnityAttributes(), new Dictionary<string, string>(), new Dictionary<string, string>()));

        var response = await gameApiClient.RemoteConfigSettings.AssignSettingsAsync(context, null, request);
#

I'm not sure for removing trigggers, @wanton turret may have more information for this

wispy lake
#

thank, will try!