As of April 10, 2018, Google has deprecated GCM. The GCM server and client APIs are deprecated and will be removed as soon as April 11, 2019. Migrate GCM apps to Firebase Cloud Messaging (FCM), which inherits the reliable and scalable GCM infrastructure, plus many new features. See the migration guide to learn more.

<GCMReceiverDelegate> Protocol

<GCMReceiverDelegate> Protocol Reference

Overview

Delegate for receiving status of upstream messages sent via Google Cloud Messaging.

Inherits <NSObject>.

Instance Method Summary

(void) - willSendDataMessageWithID:error:
 The callback is invoked once GCM processes the message. More...
 
(void) - didSendDataMessageWithID:
 This callback is invoked if GCM successfully sent the message upstream and the message was successfully received. More...
 
(void) - didDeleteMessagesOnServer
 Called when the GCM server deletes pending messages due to exceeded storage limits. More...
 

Method Detail

- (void) willSendDataMessageWithID: (NSString *)  messageID
error: (NSError *)  error 
optional

The callback is invoked once GCM processes the message.

If processing fails, the callback is invoked with a valid error object representing the error. Otherwise, the message is ready to be sent.

Parameters
messageIDThe messageID for the message that failed to be sent upstream.
errorThe error describing why the send operation failed.
- (void) didSendDataMessageWithID: (NSString *)  messageID
optional

This callback is invoked if GCM successfully sent the message upstream and the message was successfully received.

Parameters
messageIDThe messageID for the message sent.
- (void) didDeleteMessagesOnServer
optional

Called when the GCM server deletes pending messages due to exceeded storage limits.

This may occur, for example, when the device cannot be reached for an extended period of time.

It is recommended to retrieve any missing messages directly from the app server.

Send feedback about...

Cloud Messaging
Cloud Messaging