質問編集履歴
5
ソースコードの記述方法を変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -27,6 +27,8 @@
|
|
27
27
|
|
28
28
|
|
29
29
|
###該当のソースコード
|
30
|
+
|
31
|
+
```
|
30
32
|
|
31
33
|
■rails側
|
32
34
|
|
@@ -154,7 +156,7 @@
|
|
154
156
|
|
155
157
|
}
|
156
158
|
|
157
|
-
|
159
|
+
```
|
158
160
|
|
159
161
|
Xcodeの設定は以下の通りにしています。
|
160
162
|
|
4
タイトルを修正
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
iPhoneがバックグラウンドにいる際にバッジ数が増えない件
|
test
CHANGED
File without changes
|
3
タイトルを修正
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
iPhoneがバックグラウンドにいる際にバッジ
|
1
|
+
いとるiPhoneがバックグラウンドにいる際にバッジ数が増えない件
|
test
CHANGED
File without changes
|
2
ハッシュタグを修正
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
1
追記;プッシュ通知許可のダイアログを記載してあるコード
test
CHANGED
File without changes
|
test
CHANGED
@@ -54,7 +54,7 @@
|
|
54
54
|
|
55
55
|
■swift側
|
56
56
|
|
57
|
-
◯バックグラウンド時にバッジ通知を送ろうしている箇所
|
57
|
+
◯バックグラウンド時にバッジ通知を送ろうしている箇所(AppDelegate内)
|
58
58
|
|
59
59
|
func application(_ application: UIApplication,
|
60
60
|
|
@@ -68,7 +68,7 @@
|
|
68
68
|
|
69
69
|
|
70
70
|
|
71
|
-
◯devicetokenをサーバーに送る処理を書いている箇所
|
71
|
+
◯devicetokenをサーバーに送る処理を書いている箇所(AppDelegate内)
|
72
72
|
|
73
73
|
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
|
74
74
|
|
@@ -128,6 +128,32 @@
|
|
128
128
|
|
129
129
|
|
130
130
|
|
131
|
+
◯プッシュ通知許可のダイアログを表示している箇所(viewcontorller内)
|
132
|
+
|
133
|
+
UNUserNotificationCenter.current().requestAuthorization(
|
134
|
+
|
135
|
+
options: [.badge, .alert, .sound]) {(accepted, error) in
|
136
|
+
|
137
|
+
if accepted {
|
138
|
+
|
139
|
+
print("Notification access accepted !")
|
140
|
+
|
141
|
+
DispatchQueue.main.async {
|
142
|
+
|
143
|
+
UIApplication.shared.registerForregisters()
|
144
|
+
|
145
|
+
}
|
146
|
+
|
147
|
+
}
|
148
|
+
|
149
|
+
else{
|
150
|
+
|
151
|
+
print("Notification access denied.")
|
152
|
+
|
153
|
+
}
|
154
|
+
|
155
|
+
}
|
156
|
+
|
131
157
|
|
132
158
|
|
133
159
|
Xcodeの設定は以下の通りにしています。
|