質問編集履歴
2
文章の追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -38,4 +38,20 @@
|
|
38
38
|
##開発環境
|
39
39
|
MacOS Mojave 10.14
|
40
40
|
Xcode 10.0
|
41
|
-
Swift 3.0
|
41
|
+
Swift 3.0
|
42
|
+
|
43
|
+
##書き込みデータのCODE
|
44
|
+
```swift
|
45
|
+
Database.database().reference().child((Api.User.CURRENT_USER!.uid)).observeSingleEvent(of: .value, with: { snapshot in
|
46
|
+
let arraySnapshot = snapshot.children.allObjects as! [DataSnapshot]
|
47
|
+
|
48
|
+
// 書き込みデータ
|
49
|
+
arraySnapshot.forEach({ (child) in
|
50
|
+
guard let postId = newPostId else { return }
|
51
|
+
let newNotificationId = Api.Notification.REF_NOTIFICATION.child(child.key).childByAutoId().key
|
52
|
+
guard let notificationId = newNotificationId else { return }
|
53
|
+
let newNotificationReference = Api.Notification.REF_NOTIFICATION.child(child.key).child(notificationId)
|
54
|
+
newNotificationReference.setValue(["from": Api.User.CURRENT_USER!.uid, "type": "feed", "objectId": postId, "timestamp": timestamp])
|
55
|
+
})
|
56
|
+
})
|
57
|
+
```
|
1
title
CHANGED
File without changes
|
body
CHANGED
@@ -32,4 +32,10 @@
|
|
32
32
|
**Firebaseに接続できているけど、snapshotの値が帰ってきていない**
|
33
33
|
ということでしょうか?
|
34
34
|
**また、どうやって解決したら良いでしょうか?**
|
35
|
-
すみませんが、よろしくお願いします。
|
35
|
+
すみませんが、よろしくお願いします。
|
36
|
+
|
37
|
+
|
38
|
+
##開発環境
|
39
|
+
MacOS Mojave 10.14
|
40
|
+
Xcode 10.0
|
41
|
+
Swift 3.0
|