<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>gurrium</author_name>
  <author_url>https://blog.hatena.ne.jp/gurrium/</author_url>
  <blog_title>ぜのぜ</blog_title>
  <blog_url>https://giarrium.hatenablog.com/</blog_url>
  <categories>
    <anon>Swift</anon>
  </categories>
  <description>iOSアプリでユーザーから通知の許可をもらうにはUNUserNotificationCenter.requestAuthorization()を呼ぶ必要がある。このメソッドはアラートを表示してユーザーに許可/却下を選択させる。 iOS 18以降ではアプリをロックしたり非表示にしたりできる*1。アプリを非表示にすると、アイコンだけでなく通知も非表示になる。 これがrequestAuthorization()の挙動に影響を与えていそうな事例を見つけたので実験する。 環境 Xcode 16.2 (16C5032a) iPhone 12 iOS 18.6.2 コード do { let granted …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fgiarrium.hatenablog.com%2Fentry%2F2025%2F09%2F26%2F005036&quot; title=&quot;アプリのロックと非表示の状態による、通知の許可アラートの挙動の違いを確かめる実験 - ぜのぜ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2025-09-26 00:50:36</published>
  <title>アプリのロックと非表示の状態による、通知の許可アラートの挙動の違いを確かめる実験</title>
  <type>rich</type>
  <url>https://giarrium.hatenablog.com/entry/2025/09/26/005036</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
