Forum ActionScript 3.0 Can't use YahooRelations on dev environment

Problems and discussions relating to ActionScript 3.0 here.

Can't use YahooRelations on dev environment

Postby sergejs.pogorelovs » May 6th, 2014, 2:15 pm

Hello all,

We are working on a Canvas application which is not yet on the Yahoo Games Channel (so - currently it's only accessible via "Test Canvas") and using Flash for integration with Yahoo Games API.

So far it looks that login and payments are more or less working for us but we cannot get Friend functionality to work:

Code: Select all
client.yahoo.relations.showRequestFriendshipDialog(userId, onInviteFriend);
client.yahoo.relations.showFriendsManager(onInviteFriend);

(client is playerio.Client and is obtained successfully)

We get an error "When using yahoologin:auto, the containing page must include the yahoo.js script"

Error log in the application settings is empty.

Does this error occur because this functionality is only available on live applications? How would it be possible to test it? Does the friend functionality work for any other applications? I've seen a few other applications load yahoo.js but I don't think I've seen any application use the list of friends provided by Yahoo Games (those application which have friends, maintain their own separate lists of friends). Is it possible to see examples of how these methods work?
Attachments
test canvas yahoo.js error 2.jpg
Second error we get
test canvas yahoo.js error 2.jpg (26.35 KiB) Viewed 15678 times
sergejs.pogorelovs
 
Posts: 4
Joined: May 6th, 2014, 8:59 am

Re: Can't use YahooRelations on dev environment

Postby sergejs.pogorelovs » May 6th, 2014, 2:17 pm

This is the first screenshot, it doesn't get displayed in the original post for me.
Attachments
test canvas yahoo.js error.jpg
First error we get
test canvas yahoo.js error.jpg (21.13 KiB) Viewed 15676 times
sergejs.pogorelovs
 
Posts: 4
Joined: May 6th, 2014, 8:59 am

Re: Can't use YahooRelations on dev environment

Postby Oliver » May 7th, 2014, 5:29 pm

Are you running the game from a file:// path?

If so, try changing the url for the yahoogames.js script from src="//content.." to src="https://content.."

Best,
Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: Can't use YahooRelations on dev environment

Postby sergejs.pogorelovs » May 8th, 2014, 9:00 am

We are hosting Flash, html page and server-side on our own server and accessing our application by going to App settings and clicking "Test canvas". We then get redirected to our app's html page (a request from Yahoo for frame contents is being simulated this way, as I understand). On that page, the app functions properly and we can use some of Yahoo functionality - for example, call payment dialog - and it gets a clientside callback normally (payment dialog is called from JavaScript):
Code: Select all
YahooGames.dialog('buy', {
       name: '150 Spacebucks',
       description: 'Get more Spacebucks in your game!',
       icon: 'https://mygame.com/spacebucks.png',
       currency: 'usd',
       amount: '499',
       transactionid: 'abc123',
       foo: 'bar',
   }, function (data) { ...


or call a requests dialog, which at first shows the same popup "When using yahoologin:auto, the containing page must include the yahoo.js script" but then provides a link to copy and send to someone (requests dialog is called from Flash):
Code: Select all
client.gameRequests.showSendDialog("freespinsslothen", new Object(), onGiftSent);

(freespinsslothen is a request code configured on app's admin page)

Friend manager and friend request dialogs which we try to open (as shown in the first post) are also called from Flash and fail.

We've tried changing the url for yahoogames.js to https as you suggested but nothing changed. The thing is, this script is probably loaded successfully as we're able to call functions in general. We have tried manually loading yahoo.js - as mentioned in the error message - but it doesn't help. Perhaps yahoo.js needs to be loaded by Yahoo itself and so we would only be able to test our page if it was live on Yahoo Channel? And so, the question is whether it is possible to have this friend functionality be accessible before the app is put on Yahoo Channel and whether there are working examples of friend requests.
sergejs.pogorelovs
 
Posts: 4
Joined: May 6th, 2014, 8:59 am

Re: Can't use YahooRelations on dev environment

Postby Yahoo » May 8th, 2014, 5:54 pm

The actionscript looks for a <script> tag with id="yahooscript" -- does yours have that?
Yahoo
 
Posts: 1
Joined: November 17th, 2013, 1:33 am

Re: Can't use YahooRelations on dev environment

Postby sergejs.pogorelovs » May 9th, 2014, 9:49 am

We indeed didn't provide the id on <script> when loading yahoogames.js! When we added that, the first error popup ("When using yahoologin:auto, the containing page must include the yahoo.js script") stopped appearing.

However, the Relations methods are still not working for us.

Code: Select all
client.yahoo.relations.showRequestFriendshipDialog(userId, onInviteFriend);

- this now produces an error popup "Unknown User" - "Could not locate the profile information for the given user id"
We are supplying a different user's userId (that user is app's developer as well) which we obtain either as client.connectUserId or client.yahoo.profiles.myProfile.userId (they have the same userId). userId: YRH48ZER7fwWHpv6NOvYdHV-9LArLLd3sFnwvC87zGtA1

Code: Select all
client.yahoo.relations.showFriendsManager(onInviteFriend);

- this still produces an error popup "Unexpected Error" - "An unexpected error occured in backend. An error has been logged to be investigated. Please try again later."
Application logs are empty and there are no errors in JS console, Flash log, and nothing is being supplied to onInviteFriend callback which is being called (an empty string).

If it helps, our app name is ctedev_a_yahoo, game id: ctedev-a-kont-zb7j64vx0ksnfpivgt1jaa and numerical id in Test Canvas - 15705.
sergejs.pogorelovs
 
Posts: 4
Joined: May 6th, 2014, 8:59 am


Return to ActionScript 3.0



cron