"No relay set" Error

128 views
Skip to first unread message

G3n3r0

unread,
Apr 24, 2011, 2:07:01 PM4/24/11
to Google Friend Connect Developer Forum
Hello all,
I am attempting to add Friend Connect into one of my applications.
However, I repeatedly get the same error about relays not being set. I
Googled for a while, but I found nothing relevant. The exact error is
as follows:
"No relay set (used as window.postMessage targetOrigin), cannot send
cross-domain message".

My code is:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /
>

<!-- Load the Google AJAX API Loader -->
<script type="text/javascript" src="http://www.google.com/jsapi"></
script>

<!-- Load the Google Friend Connect javascript library. -->
<script type="text/javascript">
google.load('friendconnect', '0.8');
</script>

<!-- Initialize the Google Friend Connect OpenSocial API. -->
<script type="text/javascript">
google.friendconnect.container.setParentUrl('/' /* location of
rpc_relay.html and canvas.html */);
google.friendconnect.container.initOpenSocialApi({
site: '15589038843889558124',
onload: function(securityToken) { /* your callback, which is passed
a security token */ initAllData()}
});
</script>

<script type="text/javascript">
window.onload = function() {
google.friendconnect.renderSignInButton({id:"button"})
}
function setupData(data) {
//google.friendconnect.container.setParentUrl("./");
console.log(data)
/* if (!data.errorMessage) {
var site_friends = data.get("viewer_friends").getData();
var list = document.getElementById("friends-list");
list.innerHTML = "";
site_friends.each(function(friend) {
list.innerHTML += "<li>" + friend.getDisplayName() + "</li>";
});
}*/
};
function initAllData() {
var params = {};

params[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] =
['profileExtensions'];
var req = opensocial.newDataRequest();
req.add(req.newFetchPersonRequest('VIEWER', params), 'viewer');
req.add(req.newFetchPersonRequest('OWNER', params), 'owner');
req.send(setupData);
}
function saveData(key, val) {
var req = opensocial.newDataRequest();
req.add(
req.newUpdatePersonAppDataRequest("VIEWER", key, val),
"set_data");
req.send(saveCallback);
}
function saveCallback(data) {
console.log(data);
}

function readData(key) {
var idspec = opensocial.newIdSpec({ "userId" : "VIEWER", "groupId" :
"SELF" });
var req = opensocial.newDataRequest();
req.add(
req.newFetchPersonAppDataRequest(idspec, key),
"get_data");
req.send(readCallback);
}
function readCallback(data) {
console.log(data);
}
saveData("test1", "Hello, world!");
readData("test1");
</script>
</head>
<body>
<div id="button"></div>
</body>

</html>

Any idea what this could be?

Cheers,
G3n3r0

Bob Aman

unread,
Apr 24, 2011, 3:48:17 PM4/24/11
to google-friend-co...@googlegroups.com
> Any idea what this could be?

Which browser?

G3n3r0

unread,
Apr 24, 2011, 8:17:34 PM4/24/11
to Google Friend Connect Developer Forum
I've tested it in several browsers(Chrome, Firefox, Opera) and gotten
the same result. At first I thought it might have something to do with
rpc_relay.html, but upon further research I found out that that wasn't
required anymore. Any help would be appreciated.
-G3n3r0

G3n3r0

unread,
Apr 24, 2011, 8:23:53 PM4/24/11
to Google Friend Connect Developer Forum
Also of note: I can still access user data fine(after OAuth dialog),
but the Persistence API doesn't work.

Bob Aman

unread,
Apr 25, 2011, 3:22:44 PM4/25/11
to google-friend-co...@googlegroups.com
> Also of note: I can still access user data fine(after OAuth dialog),
> but the Persistence API doesn't work.

Hmmm... Did this used to work, and if so, do you know when this
started happening? Also, can you send me a URL?

Don Rieb

unread,
Apr 24, 2011, 11:37:24 PM4/24/11
to google-friend-co...@googlegroups.com
Thank you for your kind response.

This is the browser and version I am using. I will try some others and see what happens, but seems to me it is wordpress giving the error.

FireFox 3.6.16
 
Don Rieb
AKA: MrSaveware

in god we trust



From: Bob Aman <bob...@google.com>
To: google-friend-co...@googlegroups.com
Sent: Monday, April 25, 2011 3:48 AM
Subject: Re: [friendconnect-developers] "No relay set" Error

> Any idea what this could be?

Which browser?

--
You received this message because you are subscribed to the Google Groups "Google Friend Connect Developer Forum" group.
To post to this group, send email to google-friend-co...@googlegroups.com.
To unsubscribe from this group, send email to google-friend-connect-developers+unsub...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-friend-connect-developers?hl=en.



G3n3r0

unread,
Apr 25, 2011, 5:00:34 PM4/25/11
to Google Friend Connect Developer Forum
The explanation that Wordpress is giving the error would be an
excellent explanation, except that I don't use Wordpress.
The URL: colinatkinson.angryhosting.com/FriendConnectTry1.html
I may have figured out a solution, but I still have to test it.
-G3n3r0

On Apr 24, 11:37 pm, Don Rieb <savew...@yahoo.com> wrote:
> Thank you for your kind response.
>
> This is the browser and version I am using. I will try some others and see what happens, but seems to me it is wordpress giving the error.
>
> FireFox 3.6.16
>
>  
> Don Rieb
> AKA: MrSaveware
>
> in god we trust
>
> ________________________________
>
> Download our toolbar for fast social site and email access to save you lots of time:
> Download Saveware Toolbar
> Saveware Workspace Forum
> Saveware Workspace Blog
> Saveware Workspace
>
> Saveware USA
> Saveware Store
> Saveware Web Hosting
> Saveware Web Hosting Reseller Plans
> Welcome to the official XBox 360 Case Mod Fan Page
>
>
>
> >________________________________
> >From: Bob Aman <boba...@google.com>
> >To: google-friend-co...@googlegroups.com
> >Sent: Monday, April 25, 2011 3:48 AM
> >Subject: Re: [friendconnect-developers] "No relay set" Error
>
> >> Any idea what this could be?
>
> >Which browser?
>
> >--
> >You received this message because you are subscribed to the Google Groups "Google Friend Connect Developer Forum" group.
> >To post to this group, send email to google-friend-co...@googlegroups.com.
> >To unsubscribe from this group, send email to google-friend-connect-...@googlegroups.com.

G3n3r0

unread,
Apr 28, 2011, 9:40:03 PM4/28/11
to Google Friend Connect Developer Forum
Well, I've found a solution! It turns out that my problem was just
that I was trying to load the data from the persistent datastore
before my page had fully loaded. To fix this, I just added a button
that called those functions. Well, thank's for all your help guys!
-G3n3r0

Bob Aman

unread,
Apr 29, 2011, 1:56:22 AM4/29/11
to google-friend-co...@googlegroups.com
> Well, I've found a solution! It turns out that my problem was just
> that I was trying to load the data from the persistent datastore
> before my page had fully loaded. To fix this, I just added a button
> that called those functions. Well, thank's for all your help guys!

Cool, glad you were able to figure it out!

Reply all
Reply to author
Forward
0 new messages