Skip to content

Commit af933c1

Browse files
committed
Omit gcm message key in snippets
1 parent fdc508b commit af933c1

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

messaging/MessagingExample/AppDelegate.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,12 @@ - (void)application:(UIApplication *)application didReceiveRemoteNotification:(N
7373
// With swizzling disabled you must let Messaging know about the message, for Analytics
7474
// [[FIRMessaging messaging] appDidReceiveMessage:userInfo];
7575

76+
// [START_EXCLUDE]
7677
// Print message ID.
7778
if (userInfo[kGCMMessageIDKey]) {
7879
NSLog(@"Message ID: %@", userInfo[kGCMMessageIDKey]);
7980
}
81+
// [END_EXCLUDE]
8082

8183
// Print full message.
8284
NSLog(@"%@", userInfo);
@@ -92,10 +94,12 @@ - (void)application:(UIApplication *)application didReceiveRemoteNotification:(N
9294
// With swizzling disabled you must let Messaging know about the message, for Analytics
9395
// [[FIRMessaging messaging] appDidReceiveMessage:userInfo];
9496

97+
// [START_EXCLUDE]
9598
// Print message ID.
9699
if (userInfo[kGCMMessageIDKey]) {
97100
NSLog(@"Message ID: %@", userInfo[kGCMMessageIDKey]);
98101
}
102+
// [END_EXCLUDE]
99103

100104
// Print full message.
101105
NSLog(@"%@", userInfo);
@@ -115,10 +119,12 @@ - (void)userNotificationCenter:(UNUserNotificationCenter *)center
115119
// With swizzling disabled you must let Messaging know about the message, for Analytics
116120
// [[FIRMessaging messaging] appDidReceiveMessage:userInfo];
117121

122+
// [START_EXCLUDE]
118123
// Print message ID.
119124
if (userInfo[kGCMMessageIDKey]) {
120125
NSLog(@"Message ID: %@", userInfo[kGCMMessageIDKey]);
121126
}
127+
// [END_EXCLUDE]
122128

123129
// Print full message.
124130
NSLog(@"%@", userInfo);

messaging/MessagingExampleSwift/AppDelegate.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,12 @@ extension AppDelegate : UNUserNotificationCenterDelegate {
125125
// With swizzling disabled you must let Messaging know about the message, for Analytics
126126
// Messaging.messaging().appDidReceiveMessage(userInfo)
127127

128+
// [START_EXCLUDE]
128129
// Print message ID.
129130
if let messageID = userInfo[gcmMessageIDKey] {
130131
print("Message ID: \(messageID)")
131132
}
133+
// [END_EXCLUDE]
132134

133135
// Print full message.
134136
print(userInfo)
@@ -141,10 +143,13 @@ extension AppDelegate : UNUserNotificationCenterDelegate {
141143
didReceive response: UNNotificationResponse,
142144
withCompletionHandler completionHandler: @escaping () -> Void) {
143145
let userInfo = response.notification.request.content.userInfo
146+
147+
// [START_EXCLUDE]
144148
// Print message ID.
145149
if let messageID = userInfo[gcmMessageIDKey] {
146150
print("Message ID: \(messageID)")
147151
}
152+
// [END_EXCLUDE]
148153

149154
// With swizzling disabled you must let Messaging know about the message, for Analytics
150155
// Messaging.messaging().appDidReceiveMessage(userInfo)

0 commit comments

Comments
 (0)