2014-09-16 2 views
1

Windows 용 Windows Universal 응용 프로그램 8.1을 개발했습니다. 이 앱은 Windows 스토어에서 예상대로 작동합니다 (앱 구매 포함)windows phone 8.1 inapp purchase

Windows Phone Store에서 문제가 발생했습니다. 장치 (Windows Phone 8.1 실행)에서이 메시지는 카탈로그에서 항목을 찾을 수 없습니다. 우리는 보았지만 사고 싶은 물건을 찾을 수 없습니다.은 인앱 구매가 시도 될 때 표시됩니다.

public sealed partial class MainPage : Page 
{ 
    public event EventHandler<MainPageSizeChangedEventArgs> MainPageResized; 

    private String ProductId = "focusmedica.ud.cabg"; 
    private String[] video = { "Video1", 
           "Video2", 
           "Video3", 
           "Video4", 
           "Video5" 

          }; 

    LicenseChangedEventHandler licenseChangeHandler = null; 

    public MainPage() 
    { 
     this.InitializeComponent(); 
     this.NavigationCacheMode = NavigationCacheMode.Enabled; 
     SizeChanged += MainPage_SizeChanged; 
    } 


    protected override void OnNavigatedTo(NavigationEventArgs e) 
    { 
     //await LoadInAppPurchaseProxyFileAsync(); 

    } 

    protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) 
    { 

     if (licenseChangeHandler != null) 
     { 
      CurrentApp.LicenseInformation.LicenseChanged -= licenseChangeHandler; 
     } 
     base.OnNavigatingFrom(e); 
    }  

    public void NotifyUser(string strMessage, NotifyType type) 
    { 

    } 

    private async void BuyProduct2_Click(object sender, RoutedEventArgs e) 
    { 

     LicenseInformation licenseInformation = CurrentApp.LicenseInformation; 
     if (!licenseInformation.ProductLicenses[ProductId].IsActive) 
     { 
      NotifyUser("Buying Product 2...", NotifyType.StatusMessage); 
      try 
      { 
       await CurrentApp.RequestProductPurchaseAsync(ProductId); 
       if (licenseInformation.ProductLicenses[ProductId].IsActive) 
       { 
        NotifyUser("You bought Product 2.", NotifyType.StatusMessage); 
        foreach (String s in video) 
        { 
         Button button = (Button)FindControl<Button>(masterHub, s); 
         button.Visibility = Visibility.Collapsed; 

        } 
       } 
       else 
       { 

        NotifyUser("Product 2 was not purchased.", NotifyType.StatusMessage); 
       } 
      } 
      catch (Exception) 
      { 

       NotifyUser("Unable to buy Product 2.", NotifyType.ErrorMessage); 
      } 
     } 
     else 
     { 
      NotifyUser("You already own Product 2.", NotifyType.ErrorMessage); 

      foreach (String s in video) 
      { 
       Button button = (Button)FindControl<Button>(masterHub, s); 
       button.Visibility = Visibility.Collapsed; 

      } 
     } 
    } 

저는 Windows Store 앱 개발에 상당히 익숙하며 Windows Phone 개발에 새로운 버전입니다. 어떤 도움을 주시면 감사하겠습니다.

+0

오류 메시지는 어디에 표시됩니까? –

+0

기기에서 버튼을 통해 구매를 선택한 후 앱에서 바로 마우스 오른쪽 버튼을 클릭합니다. – siddu

+0

코드에서 어디에서 오류가 발생했는지 알 수있었습니다. –

답변

0

Windows Phone Store에서 인앱 제품이 올바르게 생성되었는지 확인하고 productId가 올바른지 확인해야합니다.