首页 > 其他分享 >MAUI中如何打开应用商店应用详情页

MAUI中如何打开应用商店应用详情页

时间:2023-02-08 13:11:58浏览次数:42  
标签:elif string OpenStoreAppDetails uri 详情页 应用 appId MAUI id

 
 ​        ​public​ ​Task​<​bool​> ​OpenStoreAppDetails​() 
 ​        { 
 ​            ​return​ ​OpenStoreAppDetails​(​AppInfo​.​PackageName​); 
 ​        } 
  
 ​        ​public​ ​async​ ​Task​<​bool​> ​OpenStoreAppDetails​(​string​ ​appId​) 
 ​        { 
 ​            ​string​ ​uri​ ​=​ ​string​.​Empty​; 
 ​#​if​ ​WINDOWS 
 ​            ​uri​ ​=​ ​$"​ms-windows-store://pdp/?ProductId={​appId​}​"​; 
 ​#​elif​ ​ANDROID 
 ​            ​uri​ ​=​ ​$"​market://details?id={​appId​}​"​; 
 ​#​elif​ ​IOS​ ​||​ ​MACCATALYST 
 ​            ​uri​ ​=​ ​$"​itms-apps://itunes.apple.com/app/id{​appId​}​"​; 
 ​#​endif 
 ​            ​return​ ​await​ ​Launcher​.​Default​.​TryOpenAsync​(​uri​); 
 ​        }

标签:elif,string,OpenStoreAppDetails,uri,详情页,应用,appId,MAUI,id
From: https://www.cnblogs.com/Yu-Core/p/17101354.html

相关文章