question

taylornoodlecake avatar image
taylornoodlecake asked

Unable to load friends in Unity game after initial launch

I am adding GameCircle to an Android game we are preparing to launch on the Amazon app store. I am having difficulty reliably retrieving the friend IDs of the currently logged in player. On first launch after installing the game to a device, the test account that I am using properly has a single friend ID retrieved after requesting all friend IDs. On all subsequent launches, the friend ID request returns without error, but contains no friend IDs at all. The path through our game's code is identical. Is there any reason why the friend ID request would continually return zero friends on all launches past the initial launch? I am using: Amazon GameCircle Android SDK Version 2.4.2 Amazon GameCircle Unity Plugin Version 2.5.2 Amazon GameCircle Javascript 2.4.3 Unity 5.0.2
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

justin avatar image
justin answered
Hi taylornoodlecake, Sorry for the delay! Could you please share any code snippets you're currently using to initialize and load your friends list? Thanks,
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

taylornoodlecake avatar image
taylornoodlecake answered
Here is the initialization code: SetAmazonServiceCallbacks(); AGSClient.Init (false, true, false); ... private void SetAmazonServiceCallbacks() { AGSClient.ServiceReadyEvent += () => { Debug.Log("AGS is ready"); AGSPlayerClient.RequestFriendIdsCompleted += OnGetFriendIDsCompleted; AGSPlayerClient.RequestFriendIds(); }; AGSClient.ServiceNotReadyEvent += (error) => { Debug.Log("AGS is not ready: " + error); }; } private void OnGetFriendIDsCompleted(AGSRequestFriendIdsResponse response) { if (response.IsError ()) { Debug.Log("[Noodlecake] Friends request Failed: " + response.error); } else { Debug.Log("[Noodlecake] Got some friends: "); foreach (string friendID in response.friendIds) { Debug.Log("\t[Noodlecake] friend: " + friendID); } } }
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

justin avatar image
justin answered
Hi taylornoodlecake, Are you sure you have friends on the GameCircle account that also have your app installed? This changed back in October last year, so if your previous examples were succeeding it may be due to the changes in the API. The API getFriendIds, which previously returned the entire set of GameCircle friends for a player, has been fixed to return only those friends who also play your game. This fix improves efficiency of the API call and your game's need to handle irrelevant data. The change is automatic and does not affect any games already using the API. https://developer.amazon.com/public/apis/engage/gamecircle/docs/friends-api
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.