<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
		<id>https://wiki.nonip.net/index.php?action=history&amp;feed=atom&amp;title=Unity%2FNative%E9%80%A3%E6%90%BA%2FSwift%E3%83%90%E3%83%83%E3%82%AF%E3%82%B0%E3%83%A9%E3%83%B3%E3%83%89%E9%80%9A%E7%9F%A5</id>
		<title>Unity/Native連携/Swiftバックグランド通知 - 変更履歴</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.nonip.net/index.php?action=history&amp;feed=atom&amp;title=Unity%2FNative%E9%80%A3%E6%90%BA%2FSwift%E3%83%90%E3%83%83%E3%82%AF%E3%82%B0%E3%83%A9%E3%83%B3%E3%83%89%E9%80%9A%E7%9F%A5"/>
		<link rel="alternate" type="text/html" href="https://wiki.nonip.net/index.php?title=Unity/Native%E9%80%A3%E6%90%BA/Swift%E3%83%90%E3%83%83%E3%82%AF%E3%82%B0%E3%83%A9%E3%83%B3%E3%83%89%E9%80%9A%E7%9F%A5&amp;action=history"/>
		<updated>2026-04-19T08:04:48Z</updated>
		<subtitle>このウィキのこのページに関する変更履歴</subtitle>
		<generator>MediaWiki 1.24.2</generator>

	<entry>
		<id>https://wiki.nonip.net/index.php?title=Unity/Native%E9%80%A3%E6%90%BA/Swift%E3%83%90%E3%83%83%E3%82%AF%E3%82%B0%E3%83%A9%E3%83%B3%E3%83%89%E9%80%9A%E7%9F%A5&amp;diff=18954&amp;oldid=prev</id>
		<title>2024年9月10日 (火) 13:46にAdminによる</title>
		<link rel="alternate" type="text/html" href="https://wiki.nonip.net/index.php?title=Unity/Native%E9%80%A3%E6%90%BA/Swift%E3%83%90%E3%83%83%E3%82%AF%E3%82%B0%E3%83%A9%E3%83%B3%E3%83%89%E9%80%9A%E7%9F%A5&amp;diff=18954&amp;oldid=prev"/>
				<updated>2024-09-10T13:46:18Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;←前の版&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;2024年9月10日 (火) 13:46時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;行1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;行1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ボタンを押して、10秒後に、バックグラウンドに移動してたら、通知が入る。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Unity側==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Unity側==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>https://wiki.nonip.net/index.php?title=Unity/Native%E9%80%A3%E6%90%BA/Swift%E3%83%90%E3%83%83%E3%82%AF%E3%82%B0%E3%83%A9%E3%83%B3%E3%83%89%E9%80%9A%E7%9F%A5&amp;diff=18953&amp;oldid=prev</id>
		<title>2024年9月10日 (火) 13:45にAdminによる</title>
		<link rel="alternate" type="text/html" href="https://wiki.nonip.net/index.php?title=Unity/Native%E9%80%A3%E6%90%BA/Swift%E3%83%90%E3%83%83%E3%82%AF%E3%82%B0%E3%83%A9%E3%83%B3%E3%83%89%E9%80%9A%E7%9F%A5&amp;diff=18953&amp;oldid=prev"/>
				<updated>2024-09-10T13:45:36Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;←前の版&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;2024年9月10日 (火) 13:45時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;行94:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;行94:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;extern &amp;quot;C&amp;quot; {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;extern &amp;quot;C&amp;quot; {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; // Unityから呼び出せるSwiftメソッドのラッパー&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; bool _testStaticMethod(bool flag) {&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; bool result = [UnityRenkei teststatic:flag];&amp;#160; // Swiftのstaticメソッドを呼び出す&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; NSLog(@&amp;quot;result: %d&amp;quot;, result);&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; return result;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; }&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; bool _testMethod(bool flag) {&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; UnityRenkei *renkei = [[UnityRenkei alloc] init];&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; bool result = [renkei test:flag];&amp;#160; // Swiftのインスタンスメソッドを呼び出す&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; NSLog(@&amp;quot;result: %d&amp;quot;, result);&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; return result;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; }&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; void _testExecMethod() {&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; UnityRenkei *renkei = [[UnityRenkei alloc] init];&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; [renkei testexec];&amp;#160; // Swiftのインスタンスメソッドを呼び出す&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; }&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; void _scheduleNotification(int second) {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; void _scheduleNotification(int second) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; // Swift の NotificationManager クラスのメソッドを呼び出す&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; // Swift の NotificationManager クラスのメソッドを呼び出す&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>https://wiki.nonip.net/index.php?title=Unity/Native%E9%80%A3%E6%90%BA/Swift%E3%83%90%E3%83%83%E3%82%AF%E3%82%B0%E3%83%A9%E3%83%B3%E3%83%89%E9%80%9A%E7%9F%A5&amp;diff=18952&amp;oldid=prev</id>
		<title>Admin: ページの作成:「==Unity側== &lt;pre&gt; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using System;  #if UNITY_IPHONE using System.Runti...」</title>
		<link rel="alternate" type="text/html" href="https://wiki.nonip.net/index.php?title=Unity/Native%E9%80%A3%E6%90%BA/Swift%E3%83%90%E3%83%83%E3%82%AF%E3%82%B0%E3%83%A9%E3%83%B3%E3%83%89%E9%80%9A%E7%9F%A5&amp;diff=18952&amp;oldid=prev"/>
				<updated>2024-09-10T13:45:16Z</updated>
		
		<summary type="html">&lt;p&gt;ページの作成:「==Unity側== &amp;lt;pre&amp;gt; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using System;  #if UNITY_IPHONE using System.Runti...」&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Unity側==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using UnityEngine;&lt;br /&gt;
using UnityEngine.UI;&lt;br /&gt;
using System;&lt;br /&gt;
&lt;br /&gt;
#if UNITY_IPHONE&lt;br /&gt;
using System.Runtime.InteropServices;&lt;br /&gt;
#endif&lt;br /&gt;
public class RenkeiScene : MonoBehaviour&lt;br /&gt;
{&lt;br /&gt;
#if UNITY_IPHONE&lt;br /&gt;
    // Swift の関数を宣言 (Objective-C のブリッジとして)&lt;br /&gt;
    [DllImport(&amp;quot;__Internal&amp;quot;)]&lt;br /&gt;
    private static extern void _scheduleNotification(int second);&lt;br /&gt;
    &lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
    [SerializeField] Button alermButton;&lt;br /&gt;
    void Start()&lt;br /&gt;
    {&lt;br /&gt;
        alermButton.onClick.AddListener(CallMethodAlarm);&lt;br /&gt;
        alermCancelButton.onClick.AddListener(CallMethodAlarmCancel);&lt;br /&gt;
    }&lt;br /&gt;
    void CallMethodAlarm()&lt;br /&gt;
    {&lt;br /&gt;
#if UNITY_IOS &amp;amp;&amp;amp; !UNITY_EDITOR&lt;br /&gt;
        ScheduleNotification(10);&lt;br /&gt;
#endif&lt;br /&gt;
    }&lt;br /&gt;
#if UNITY_IOS &amp;amp;&amp;amp; !UNITY_EDITOR&lt;br /&gt;
    // 通知をスケジュールするメソッド&lt;br /&gt;
    public void ScheduleNotification(int second)&lt;br /&gt;
    {&lt;br /&gt;
        _scheduleNotification(second);&lt;br /&gt;
    }&lt;br /&gt;
#endif&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Swift,Objective-C側==&lt;br /&gt;
NotificationManager.swift&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import Foundation&lt;br /&gt;
import UserNotifications&lt;br /&gt;
&lt;br /&gt;
@objc public class NotificationManager: NSObject {&lt;br /&gt;
    &lt;br /&gt;
    // 通知を設定するメソッド&lt;br /&gt;
    // @objc public static func scheduleNotification(_ hour: Int, _ minute: Int, _ second: Int) {&lt;br /&gt;
    @objc public static func scheduleNotification(_ second: Int) {&lt;br /&gt;
        &lt;br /&gt;
        let center = UNUserNotificationCenter.current()&lt;br /&gt;
        &lt;br /&gt;
        print(&amp;quot;scheduleNotification: \(second)秒後に通知をスケジュールします&amp;quot;)&lt;br /&gt;
        &lt;br /&gt;
        // 通知の権限をリクエスト&lt;br /&gt;
        center.requestAuthorization(options: [.alert, .sound]) { granted, error in&lt;br /&gt;
            if granted {&lt;br /&gt;
                print(&amp;quot;通知の権限が許可されました&amp;quot;)&lt;br /&gt;
                // 通知のコンテンツを作成&lt;br /&gt;
                let content = UNMutableNotificationContent()&lt;br /&gt;
                content.title = &amp;quot;アラーム通知&amp;quot;&lt;br /&gt;
                content.body = &amp;quot;指定した時間が経過しました！&amp;quot;&lt;br /&gt;
                content.sound = UNNotificationSound.default&lt;br /&gt;
                &lt;br /&gt;
                // x 秒後に通知するトリガーを作成&lt;br /&gt;
                let triggerTime = TimeInterval(second)&lt;br /&gt;
                let trigger = UNTimeIntervalNotificationTrigger(timeInterval: triggerTime, repeats: false)&lt;br /&gt;
                &lt;br /&gt;
                // 通知リクエストを作成&lt;br /&gt;
                let request = UNNotificationRequest(identifier: &amp;quot;AlarmNotification&amp;quot;, content: content, trigger: trigger)&lt;br /&gt;
                &lt;br /&gt;
                // 通知を登録&lt;br /&gt;
                center.add(request) { error in&lt;br /&gt;
                    if let error = error {&lt;br /&gt;
                        print(&amp;quot;通知の登録に失敗しました: \(error)&amp;quot;)&lt;br /&gt;
                    } else {&lt;br /&gt;
                        print(&amp;quot;通知が正常に登録されました&amp;quot;)&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            } else {&lt;br /&gt;
                print(&amp;quot;通知の権限が拒否されました&amp;quot;)&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
UnityBridge.mm&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#import &amp;lt;UnityFramework/UnityFramework-Swift.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
extern &amp;quot;C&amp;quot; {&lt;br /&gt;
    // Unityから呼び出せるSwiftメソッドのラッパー&lt;br /&gt;
    bool _testStaticMethod(bool flag) {&lt;br /&gt;
        bool result = [UnityRenkei teststatic:flag];  // Swiftのstaticメソッドを呼び出す&lt;br /&gt;
        NSLog(@&amp;quot;result: %d&amp;quot;, result);&lt;br /&gt;
        return result;&lt;br /&gt;
    }&lt;br /&gt;
    bool _testMethod(bool flag) {&lt;br /&gt;
        UnityRenkei *renkei = [[UnityRenkei alloc] init];&lt;br /&gt;
        bool result = [renkei test:flag];  // Swiftのインスタンスメソッドを呼び出す&lt;br /&gt;
        NSLog(@&amp;quot;result: %d&amp;quot;, result);&lt;br /&gt;
        return result;&lt;br /&gt;
    }&lt;br /&gt;
    void _testExecMethod() {&lt;br /&gt;
        UnityRenkei *renkei = [[UnityRenkei alloc] init];&lt;br /&gt;
        [renkei testexec];  // Swiftのインスタンスメソッドを呼び出す&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    void _scheduleNotification(int second) {&lt;br /&gt;
        // Swift の NotificationManager クラスのメソッドを呼び出す&lt;br /&gt;
        // [NotificationManager scheduleNotification:hour minute:minute second:second];&lt;br /&gt;
        [NotificationManager scheduleNotification:second];&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
scheduleNotificationの引数を時分秒で渡したかったが、引数２つ以上の渡し方がわからず・・。とりあえず秒だけ渡した。&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>