Skip to content
This repository was archived by the owner on Dec 30, 2024. It is now read-only.

Commit 8c29322

Browse files
committed
All platforms snippet
1 parent f7704cf commit 8c29322

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

admin/src/main/java/com/google/firebase/example/FirebaseMessagingSnippets.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,30 @@ public Message webpushMessage() {
165165
return message;
166166
}
167167

168+
public Message allPlatformsMessage() {
169+
// [START multi_platforms_message]
170+
Message message = Message.builder()
171+
.setNotification(new Notification(
172+
"$GOOG up 1.43% on the day",
173+
"$GOOG gained 11.80 points to close at 835.67, up 1.43% on the day."))
174+
.setAndroidConfig(AndroidConfig.builder()
175+
.setTtl(3600 * 1000)
176+
.setNotification(AndroidNotification.builder()
177+
.setIcon("stock_ticker_update")
178+
.setColor("#f45342")
179+
.build())
180+
.build())
181+
.setApnsConfig(ApnsConfig.builder()
182+
.setAps(Aps.builder()
183+
.setBadge(42)
184+
.build())
185+
.build())
186+
.setTopic("industry-tech")
187+
.build();
188+
// [END multi_platforms_message]
189+
return message;
190+
}
191+
168192
public void subscribeToTopic() throws Exception {
169193
String topic = "highScores";
170194
// [START subscribe]

0 commit comments

Comments
 (0)