PushSubscriptionOptions.applicationServerKey
Baseline 2023Newly available
Since March 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
PushSubscriptionOptions
インターフェイスの applicationServerKey
読み取り専用プロパティは、プッシュサーバーが用いる公開鍵です。
値
プッシュサーバーがプッシュサーバーを通じてクライアントアプリケーションにメッセージを送信するのに用いる公開鍵です。この値は、アプリケーションサーバーで生成された署名用鍵ペアの一部であり、P-256 曲線上での楕円曲線デジタル署名 (ECDSA) で利用可能です。
例
この例では、applicationServerKey
の値をコンソールに出力します。
js
navigator.serviceWorker.ready.then((reg) => {
reg.pushManager.getSubscription().then((subscription) => {
const options = subscription.options;
console.log(options.applicationServerKey); // 公開鍵
});
});
仕様書
Specification |
---|
Push API # dom-pushsubscriptionoptions-applicationserverkey |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
applicationServerKey |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- See implementation notes.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.