Skip to content

Most visited

Recently visited

navigation

在執行階段妥善要求權限 (Android 6.0 以上版本)

應用程式應於正確時機提出權限要求,並且向使用者說明對於該權限的需求為何。

為何有效

如果應用程式在提出權限要求時並未向使用者充分說明權限用途 (即不當權限要求),使用者可能就不會同意授權,造成應用程式無法提供使用者預期的功能。在最糟的情況下,使用者可能會因為權限要求過於突兀而對應用程式失去信任,甚至解除安裝應用程式。

只要依照下列最佳做法提出權限要求,使用者就會知道應用程式要求授權具有正當理由,而且會審慎處理授權資料或使用授權功能。如此一來,使用者就會比較願意授予應用程式所需的權限,並且在順利使用預期的應用程式功能後持續使用應用程式。

最佳做法

  • 向使用者說明要求授權的原因 (特別是在權限用途不明顯的情況下):對於需要授權才能執行的功能,您應清楚說明該權限將用於提供什麼服務。
  • 應用程式在使用任何權限前,一律應檢查是否已獲得使用者授權,因為使用者隨時可能透過系統設定撤銷權限。
  • 告訴使用者立即授權可獲得的服務,讓他們能夠信任應用程式,並告知權限要求的正當性和必要性。
  • 引導使用者撤銷拒絕授權設定。如果使用者已點選 [不要再詢問] 選項,您可以告訴他們如果日後決定授權,該如何前往應用程式設定

踏出第一步

要求權限
This site uses cookies to store your preferences for site-specific language and display options.

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.