2012-12-08 2 views
0

Windows 8 용 간단한 앱을 개발 중입니다. 내 앱에서 시작 타일이 내 앱과 함께 제공되는 로컬 호스트의 이미지를 표시하도록합니다. 예를 들어 나는 /images/tile1.jpg에 내 이미지를 보관하고 있습니다. 내 XML 코드는 /tile1.xml 마찬가지로로컬 호스트의 Windows 8 타일 알림

에 존재

<tile> 
<visual> 
    <binding template="TileWideImage"> 
     <image id="1" src ="http://localhost/images/tile1.jpg" /> 
    </binding> 
</visual> 

하고 내 default.js 코드는

// For an introduction to the Blank template, see the following documentation: 
// http://go.microsoft.com/fwlink/?LinkId=232509 
(function() { 
    "use strict"; 

    WinJS.Binding.optimizeBindingReferences = true; 

    var app = WinJS.Application; 
    var activation = Windows.ApplicationModel.Activation; 

    app.onactivated = function (args) { 
     if (args.detail.kind === activation.ActivationKind.launch) { 
      if (args.detail.previousExecutionState !== activation.ApplicationExecutionState.terminated) { 
       var notifications = Windows.UI.Notifications; 
       var recurrence = notifications.PeriodicUpdateRecurrence.halfHour; 


       var urls = [ 
        new Windows.Foundation.Uri("http://localhost/tile1.xml"), 
        new Windows.Foundation.Uri("http://localhost/tile2.xml"), 
        new Windows.Foundation.Uri("http://localhost/tile3.xml"), 
        new Windows.Foundation.Uri("http://localhost/tile4.xml") 
       ]; 


       notifications.TileUpdateManager.createTileUpdaterForApplication().enableNotificationQueue(true); 
       notifications.TileUpdateManager.createTileUpdaterForApplication().startPeriodicUpdateBatch(urls, recurrence); 

      } else { 
       // TODO: This application has been reactivated from suspension. 
       // Restore application state here. 
      } 
      args.setPromise(WinJS.UI.processAll()); 
     } 
    }; 

    app.oncheckpoint = function (args) { 
     // TODO: This application is about to be suspended. Save any state 
     // that needs to persist across suspensions here. You might use the 
     // WinJS.Application.sessionState object, which is automatically 
     // saved and restored across suspension. If you need to complete an 
     // asynchronous operation before your application is suspended, call 
     // args.setPromise(). 
    }; 


    app.start(); 
})(); 

내가 뭐가 잘못 알아낼 단지 드릴 수 없습니다입니다 코드와 함께. 도와주세요.

답변

0

음, 할 수 없습니다. 루프백은 허용되지 않으므로 로컬 호스트 서비스를 사용하는 경우 앱에서 인증을 통과하지 못합니다.

앱과 함께 이미지를 전송할 수 있습니까? 또는 이미지와 타일을 호스팅 할 외부 서비스를 설정하십시오. Windows Azure BLOB 저장소와 같은 것이 필요하며 웹 서비스를 호스팅 할 필요도 없습니다.

마지막으로, 정사각형 타일 이미지를 항상 포함시키고 싶을 것입니다. 사용자는 항상 제어권을가집니다. 따라서 앱을 와이드 타일로 표시하지 않도록 선택할 수 있습니다.