locked
Windows store app not loading after sign in page

    Question

  • I'm using sencha touch 2.3.1 and cordova 3.4.0 to make an app. I made the app for android, IOS and also windows phone. 

    I'm trying to port it into windows store app and I found out that due to security issues, I cannot use javascript DOM directly. One work around is using MSApp.execUnsafeLocalFunction(function () { });

    Now, My app loads and I can see the login screen. 
    When I enter my login credentials and press sign in button, It says incorrect details and I get the following error in Visual studio,
    Can't load <https:// .../.../.. >. An app can't load remove web content in local context. 
    I tried using ApplicationContentUriRules to add the website it is accessing, but no use. 
    Can somebody please help me resolve this? Thanks

    Wednesday, April 16, 2014 9:58 AM

Answers

  • Hello,

    Unfortunately I don't know anything about the Sencha Touch Framework. Without more specific information about how this framework generates Windows Store code we really can't give you any more advice than we already have. If you understand how the Sencha Tourch Framework is generating the code you should be able to use the information provided by the link that Matt mentions below. If you aren't familiar with how the framework is generating the code then you might want to reach out to the maintainers of the framework and see if they can point you in the right direction.

    I hope this helps,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Monday, April 21, 2014 10:59 PM
    Moderator

All replies

  • How exactly is this content trying to load in the app?

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Wednesday, April 16, 2014 8:26 PM
    Moderator
  • Hello,

    I wasn't able to find the error that you are reporting. Is this the error that you are seeing: "Cannot navigate to a local context from a web context"?

    I also found this:

    "If you wish to create an iframe loaded from locally-packaged content that runs in the web context, you must use a different scheme, "ms-appx-web:". Content referenced via this scheme is loaded from the local package, but runs with the abilities and restrictions of the web context."

    How to reference content (Windows Runtime apps using JavaScript and HTML)

    http://msdn.microsoft.com/en-us/library/windows/apps/Hh781215.aspx

    I hope this helps,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Wednesday, April 16, 2014 11:57 PM
    Moderator
  • Sorry, just realised there's a typing mistake. I wrote remove instead of remote.. 

    The error I'm getting when I try to sign in , is

    Can't load <https:// .../.../.. >. An app can't load remote web content in local context. 

    And I don't want to use any iframe. Is it possible to just use the code I used to build app for windows phone for windows store also?

    If it's really necessary to change some minor things, I will do it.

    Also, I think the content loads by navigating to other page which is in the app itself. But it needs to get data from web to authenticate and also for some other data used in the app. 

    Thursday, April 17, 2014 8:49 AM
  • Hello,

    I apologize but I'm not really sure what you are asking. If you have a Windows Phone 8 app it is going to run very differently as a Windows Store app.

    Your initial page is loaded from your appx package (local context). The new page you are attempting to navigate to is in the web context. To allow this you need to change the scheme from "http://" to "ms-appx-web://".

    I hope this helps,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Friday, April 18, 2014 8:54 PM
    Moderator
  • Hi,

    I'm sorry for asking this question, but I'm new to mobile development. 

    Can you please tell me where exactly I have to change the scheme from "http://" to "ms-appx-web://" ?

    As I mentioned before, I'm using sencha touch framework to build the app. The initial page loaded in my app is index.html which I mentioned in the appx package. From there, my page navigates to the authentication form page where the user has to login. 

    My problem is, I'm unable to login even with correct credentials. I mentioned the error I'm getting in Visual studio. ( Can't load <https:// .../.../.. >. An app can't load remote web content in local context.  ) . 

    My question is, How can I resolve this? I want my app to have access to the site so that it can check for the username and password. Also, my app needs to get data from the website which is displayed in the app. Not sure I'll have problem with that though. 

    Saturday, April 19, 2014 6:43 AM
  • You should read this:
    http://msdn.microsoft.com/en-us/library/windows/apps/Hh781215.aspx


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, April 21, 2014 1:22 PM
    Moderator
  • Hello,

    Unfortunately I don't know anything about the Sencha Touch Framework. Without more specific information about how this framework generates Windows Store code we really can't give you any more advice than we already have. If you understand how the Sencha Tourch Framework is generating the code you should be able to use the information provided by the link that Matt mentions below. If you aren't familiar with how the framework is generating the code then you might want to reach out to the maintainers of the framework and see if they can point you in the right direction.

    I hope this helps,

    James


    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Monday, April 21, 2014 10:59 PM
    Moderator