Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • Bugs /
avatar image
Question by Xiumo · Dec 12, 2019 at 07:48 AM ·

php SDK not working

Has anyone used php sdk. I can't seem to run through this sdk. I don't know if it's my problem or php sdk has a problem. Has bothered me for a long time.

If i use 9810c as titleID, will get an error:cUrl Error: Could not resolve host: 9810c

test.png (90.2 kB)
test2.png (59.3 kB)
Comment

People who like this

0 Show 7
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image SethDu ♦ · Dec 12, 2019 at 08:21 AM 0
Share

I haven't fully tested it but for login related PlayFab API. The property TitleId is required in the request. Please add it to the request body and give it another try. Feel free to tell us if there are still any other issues.

avatar image Xiumo SethDu ♦ · Dec 12, 2019 at 08:25 AM 0
Share
I just need to be able to log in, but still not. follow the php sdk guide, not get right result.
avatar image SethDu ♦ Xiumo · Dec 12, 2019 at 08:32 AM 0
Share

Also, I believe the TitleId field (the first field) should be filled with an ID instead of an endpoint.

Show more comments
avatar image Xiumo · Dec 17, 2019 at 02:43 PM 0
Share

hello, any update?

2 Replies

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by SethDu · Dec 19, 2019 at 05:43 AM

Here is full fix reported by the team. Please fix the following code:

  • ExampleProject\ajaxPlayFabApi.php:
if($authValue) $result = $methodReflection->invoke(null, $TitleId, $authValue, $JsonRequest); else $result = $methodReflection->invoke(null, $TitleId, $JsonRequest);
  • PlayFabSDK\PlayFabHttp.php
        public static function GetFullUrl($titleId, $apiPath, $getParams)
        {
            if (!isset($titleId) && isset(PlayFabSettings::$titleId))
                $titleId = PlayFabSettings::$titleId;

            $output = "";
            if (!(substr(self::$productionEnvironmentUrl, 0, 4) === "http")) {
                if (isset(self::$verticalName)) {
                    $output = "https://" . self::$verticalName;
                } else {
                    $output = "https://" . $titleId;
                }
            }

            $output .= self::$productionEnvironmentUrl;
            $output .= $apiPath;
Comment

People who like this

0 Show 0 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image

Answer by SethDu · Dec 19, 2019 at 01:44 AM

I have added a reply but it seems to be deleted somehow.

We are trying to reproduce your issue and here is something we have done. Please check the PlayFabHttp.php file in PlayFab SDK folder:

Around line 20:

if (!(substr($productionEnvironmentUrl, 0, 4) === "http"))

Replace it with:

if (!(substr(self::$productionEnvironmentUrl, 0, 4) === "http"))

Another place that refers $productionEnvironmentUrl is around line 32:

$output .= $productionEnvironmentUrl;

Replace it with:

$output .= self::$productionEnvironmentUrl;

Also, please keep the TitleID field filled with ID only, like "9810C", because I have noticed that SDK will concatenate it with other strings to be an endpoint URL. In addition, there is no need to add a "TitleId" property in the request since the SDK will check and add it automatically.

Comment

People who like this

0 Show 1 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image SethDu ♦ · Dec 19, 2019 at 01:44 AM 0
Share

To be honest, I am not expert on php, there is a place that I don't fully understand, which is located at login related function in PlayFabClientApi.php. for example, in line 1090, function LoginWithCustomID:

if (!isset($request->$titleId)) !$request->titleId = $titleId;

I believe what it wants to do is to add TitleID property if the request doesn't contain one. If there is no other issues can be found, you may try to modify this line.

Moreover, Could you please output the $fullUrl in function MakeCurlApiCall of PlayFabHttp class, which is also located in PlayFabHttp.php?

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    3 People are following this question.

    avatar image avatar image avatar image

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges