You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: UPGRADE-8.0.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,32 @@ The `Kreait\Firebase\Contract\Messaging::BATCH_MESSAGE_LIMIT` constant has been
44
44
### Exception Handling Changes
45
45
Exception codes are no longer preserved when wrapping exceptions. If your code relies on specific exception codes for error handling, you should update it to use exception types or messages instead.
46
46
47
+
### Cloud Message Builder Method Renames
48
+
49
+
The `CloudMessage` builder methods for setting message targets have been renamed to follow the `with*` naming pattern for consistency with other builder methods in the SDK:
50
+
51
+
-`toToken()` -> `withToken()`
52
+
-`toTopic()` -> `withTopic()`
53
+
-`toCondition()` -> `withCondition()`
54
+
55
+
**Migration:**
56
+
57
+
Replace the old method names with the new ones:
58
+
59
+
```php
60
+
// Before (7.x)
61
+
$message = CloudMessage::new()
62
+
->toToken('device-token')
63
+
->withNotification(['title' => 'Hello']);
64
+
65
+
// After (8.0)
66
+
$message = CloudMessage::new()
67
+
->withToken('device-token')
68
+
->withNotification(['title' => 'Hello']);
69
+
```
70
+
71
+
The old methods are still available as deprecated aliases, so your code will continue to work during the transition period.
72
+
47
73
---
48
74
49
75
**See the complete list of breaking changes below** to identify any adjustments needed. Most changes should (hopefully)
0 commit comments