<GNSPublication> Protocol
Stay organized with collections
Save and categorize content based on your preferences.
A publication object represents a message published to nearby devices.
As long as it lives, the messages library will do its best to make sure the message is being published, as long as the required conditions are met (e.g., the app must be in the foreground). When the publication object is deallocated, the message will no longer be published.
Inherits <NSObject>.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-12 UTC.
[null,null,["Last updated 2025-08-12 UTC."],[[["\u003cp\u003eGNSPublication objects represent messages that are broadcasted to nearby devices.\u003c/p\u003e\n"],["\u003cp\u003eMessages continue to be published while the publication object exists and conditions are met, like the app being in the foreground.\u003c/p\u003e\n"],["\u003cp\u003eDeallocation of the publication object stops further message broadcasting.\u003c/p\u003e\n"],["\u003cp\u003eGNSPublication inherits functionality from the NSObject class.\u003c/p\u003e\n"]]],["A publication object signifies a message broadcast to nearby devices. The message library ensures the message's publication while the object exists, provided necessary conditions are satisfied, such as the app being in the foreground. Upon deallocation of the publication object, the message is no longer published. This object is derived from the base class `\u003cNSObject\u003e`. It represents the lifecycle of message delivery.\n"],null,["# <GNSPublication> Protocol\n\n\\\u003cGNSPublication\\\u003e Protocol Reference \n\nOverview\n--------\n\nA publication object represents a message published to nearby devices.\n\nAs long as it lives, the messages library will do its best to make sure the message is being published, as long as the required conditions are met (e.g., the app must be in the foreground). When the publication object is deallocated, the message will no longer be published.\n\nInherits \\\u003cNSObject\\\u003e."]]