开发者

Facebook API: Can I Invite A Test User To My Application?

开发者 https://www.devze.com 2023-03-06 12:43 出处:网络
I\'m trying to create test users (works) and then invite them to my app so I could test whether I could retrieve the tracking data (inside the data field). Unfortunately, when I send an invite to a te

I'm trying to create test users (works) and then invite them to my app so I could test whether I could retrieve the tracking data (inside the data field). Unfortunately, when I send an invite to a test user I get an exception:

API Error Code: 2

API Error Description: Service temporarily unavailable

Error Message: Service temporarily unavailable

Here's my code:

<input type="text" value="@ViewBag.TestId" id="theId" />

<div id="fb-root"></div>
<script type="text/javascript">
    window.fbAsyncInit = function() {
        FB.init({
          appId   : '193005690721590',
          status  : true,
          cookie  : true,
          xfbml   : true
        });
    };
    console.log(@ViewBag.TestId);
  $('#sendReq').click(sendRequest);
    function sendRequest() {
        FB.ui({
            method: 'apprequests',
            message: 'Invitation to the test application!',
            title: 'Send your friends an application request',
            to: $('#theId').val(),
            data: 'someCode'
        },
        function (response) {
            if (response && response.request_ids) {
                var requests = response.request_ids.join(',');
                $.ajax({
                    url: '/Home/Parse',
                    type: 'post',
                    data: response,
                    success: function (data) {
                        if (data.result === 'ok') {
                            alert("Everything went fine");
                            //top.location.href = '/Home/About';
                        }
                    }
                });
            } else {
                alert('canceled');
            }
        });
        return false;
    }

    (function() {
    var e = document.createElement('script');
    e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
    e.async = true;
    document.getElementById('fb-root').appendChild(e);
} ());
</script>

My code is getting the correct ID of the test user and then I'm trying to send the in开发者_开发百科vite but with no success...

Any thoughts?


I think your issue may be due to you trying to invite the test user from your own account. One of their limitations as listed on the Test Users docs is "Test users can interact with other test users only and not with real users on site."

0

精彩评论

暂无评论...
验证码 换一张
取 消