Skip to content

Commit 14aad24

Browse files
authored
Update FCM docs
Closes #456
1 parent 41f2f59 commit 14aad24

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

docs/delivery_methods/fcm.md

+2-8
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,8 @@ Firebase Cloud Messaging Notifications may fail delivery if the user has removed
131131

132132
```ruby
133133
class CommentNotification
134-
deliver_by :fcm
135-
136-
# Remove invalid device tokens
137-
#
138-
# token - the device token from iOS or FCM
139-
# platform - "iOS" or "fcm"
140-
def cleanup_device_token(token:, platform:)
141-
NotificationToken.where(token: token, platform: platform).destroy_all
134+
deliver_by :fcm do |config|
135+
config.invalid_token = ->(device_token) { device_token.destroy }
142136
end
143137
end
144138
```

0 commit comments

Comments
 (0)