Quantcast
Channel: Developing Apps for SharePoint 2013 forum
Viewing all articles
Browse latest Browse all 8089

Sharepoint Hosted App Gives "There is no trusted URLs configured for the app deployment" error

$
0
0

I am trying to deploy a sharepoint hosted app onto SharePoint Online that uses the cross-domain library to get data out of the host web.  There is nothing in it that is provider hosted so I am completely confused as to why I am getting this error.  Has anyone else seen this?

function getData() {
    //Get the URI decoded URLs. 
    hostweburl =
        decodeURIComponent(
            getQueryStringParameter("SPHostUrl")
    );
    appweburl =
        decodeURIComponent(
            getQueryStringParameter("SPAppWebUrl")
    );

    // resources are in URLs in the form: 
    // web_url/_layouts/15/resource 
    var scriptbase = hostweburl + "/_layouts/15/";

    // Load the js files and continue to the successHandler 
    $.getScript(scriptbase + "SP.RequestExecutor.js", execCrossDomainRequest);
}

// Function to prepare and issue the request to get 
//  SharePoint data 
function execCrossDomainRequest() {
    // executor: The RequestExecutor object 
    // Initialize the RequestExecutor with the app web URL. 
    var executor = new SP.RequestExecutor(appweburl);

    // Issue the call against the app web. 
    // To get the title using REST we can hit the endpoint: 
    //      appweburl/_api/web/lists/getbytitle('listname')/items 
    // The response formats the data in the JSON format. 
    // The functions successHandler and errorHandler attend the 
    //      sucess and error events respectively. 
    executor.executeAsync(
        {
            url:
                appweburl +"/_api/Data/$metadata",
            method: "GET",
            success: successHandler,
            error: errorHandler
        }
    );
}


Viewing all articles
Browse latest Browse all 8089

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>