On my server build, I can't access the server API because ENABLE_PLAYFABSERVER_API is not true, and I'm not sure where to set it to true. Where do I set this to true so I can use the server API?
On my server build, I can't access the server API because ENABLE_PLAYFABSERVER_API is not true, and I'm not sure where to set it to true. Where do I set this to true so I can use the server API?
For this question, please indicate which SDK and platform you are using.
Based on your question, I assume you're using Unity or Windows-VisualStudio.
If you are using Unity, are you also using our Editor Extensions package?
I need to know which of these options are relevant to you to give you the best answer.
entelicon, you already found this, but I'm going to re-share it for posterity:
In Unity Editor extensions, there is a checkbox to enable/disable all APIs.
If it's not already visible, you can open the PlayFab EdEx panel with [dropdowns]->Window->PlayFab->Editor Extensions
From this window, you can choose [panel-tabs]->SETTINGS->API
This gives you some checkboxes to enable and disable APIs and features.
Without Editor extensions: The EdEx panel provides a convenient GUI which wraps the "Scripting Define Symbols" in Unity, specifically adding and removing our custom defines. The Unity documentation describing the Unity portion of this feature is here. The options (at time of writing) are as follows: ENABLE_PLAYFABSERVER_API, ENABLE_PLAYFABADMIN_API, DISABLE_PLAYFABCLIENT_API, and another debug option that most people should leave disabled. Adding these to your Unity Scripting Define Symbols will activate (or deactivate) that portion of the PlayFab UnitySdk code.
Please note that these define symbols are defined separately per-platform, and so you may need to set/reset them when you change between iOS and Android (for example).
In Unity you can adjust the Scripting Define Symbols in your Project Settings > Player > Other Settings
This is simply a string of 'defines' seperated by ';'
So for example
MYCUSTOMDEFIN;MIRROR_1726_OR_NEWER;ENABLE_PLAYFABSERVER_API
that is 3 defines
my custom define
mirror 1726 or newer
and
enable playfab server api
You can set these on your local machine or if you use Unity cloud build you can set your build up to use specific defines (which is what we recomend)
So for example in Unity Cloud Build we configure a server build which is set up to build headless and uses the following defines
<some mirror ones>;ENABLE_PLAYFABSERVER_API;DISABLE_PLAYFABCLIENT_API
for our client builds we use
<some mirror ones>
note that for a client we dont need to define any PlayFab options since disbale server API and enable client API is by default apparently
2 People are following this question.