0

我是Windows Phone 8開發新手。我想顯示Toast notifiationit is suggested that I need to change in Package.Appxmanifest file。我使用C#作爲語言。我正在使用VS2012 Express for Windows PhoneWMAppManifest.xmlAppManifest.xml由Visual Studio嚮導創建,但我無法找到Package.Appxmanifest爲什麼在Windows Phone Express的Visual Studio 2012中找不到Package.Appxmanifest?

請建議是否有其他方式顯示吐司通知。

enter image description here

代碼以顯示敬酒:

string toast = "This is toast"; 
ShellToast t = new ShellToast(); 
t.Title = "Non null"; 
t.Content = toast; 
t.Show(); 
+1

值得指出的是鏈接的答案是Windows應用商店的應用程序爲Windows 8/RT(而不是Windows Phone 8);有關於發送[Toast for Windows Phone on MSDN]的良好文檔(http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj662938%28v=vs.105%29.aspx#BKMK_Howtosendatoastnotification) –

+0

+1。謝謝。我會通過建議的鏈接。 –

+0

@rockstartprogrammer我編輯了答案,現在我看到你正在嘗試做什麼。您應該編輯問題的標題,因爲它與問題沒有任何關係。 – anderZubi

回答

1

編輯:

好了,現在我看你要創建和顯示local toast notification。問題是,當應用程序處於前臺時,您無法顯示敬酒通知。當您的應用不在前臺時,它們可以從Background Agent中顯示。你的代碼沒問題,但應該放在Background Agent

如果你仍然想顯示你的應用程序中的Toast通知,你可以這樣做使用從Coding4Fun toolkitToastPrompt控制:

ToastPrompt toast = new ToastPrompt(); 
toast.Title = "Title"; 
toast.Message = "message"; 
toast.ImageSource = new BitmapImage(new Uri("ImageUri", UriKind.RelativeOrAbsolute)); 
toast.Show(); 

你的鏈接文章是關於Windows應用商店的應用。

對於的Windows Phone應用程序你需要檢查ID_CAP_PUSH_NOTIFICATION能力WMAppManifest.xml文件:

enter image description here

+0

經過大量調試之後,我保留了所有功能。問題仍然存在。 –

+0

這是什麼問題? – anderZubi

+0

我第一次嘗試使用'ID_CAP_PUSH_NOTIFICATION',但不起作用。 –

相關問題