<اشتراک GNS> پروتکل
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
یک شیء اشتراک نشان دهنده عمل اشتراک در پیام هایی از نوع خاصی از دستگاه های مجاور است.
تا زمانی که کتابخانه پیام زنده است، تا زمانی که شرایط مورد نیاز وجود داشته باشد (مثلاً برنامه باید در پیش زمینه باشد) تمام تلاش خود را برای ارائه پیام هایی که با نوع اشتراک مطابقت دارند انجام می دهد. هنگامی که پیام ها کشف یا گم می شوند، کنترل کننده های پیام فراخوانی می شوند. هنگامی که شیء اشتراک واگذار شود، تحویل پیام متوقف خواهد شد.
<NSObject> را به ارث می برد.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-08-13 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-13 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eThe GNSSubscription protocol enables subscribing to specific message types from nearby devices.\u003c/p\u003e\n"],["\u003cp\u003eActive subscriptions trigger message delivery to the app, primarily when it's in the foreground, based on defined criteria.\u003c/p\u003e\n"],["\u003cp\u003eMessage handlers manage the discovery and loss of messages, ensuring appropriate actions are taken.\u003c/p\u003e\n"],["\u003cp\u003eDeallocation of the subscription object halts further message delivery to the application.\u003c/p\u003e\n"]]],["A subscription object enables receiving specific message types from nearby devices. The messages library actively delivers matching messages while the subscription is active, under certain conditions (e.g., app foreground). Message handlers are triggered upon message discovery or loss. Deallocating the subscription object stops message delivery. It inherits from `NSObject`.\n"],null,["# <GNSSubscription> Protocol\n\n\\\u003cGNSSubscription\\\u003e Protocol Reference \n\nOverview\n--------\n\nA subscription object represents the act of subscribing to messages of a certain type from nearby devices.\n\nAs long as it lives, the messages library will do its best to deliver messages that match the subscription's type, as long as the required conditions are met (e.g., the app must be in the foreground). Message handlers are called when messages are are discovered or lost. When the subscription object is deallocated, message delivery will cease.\n\nInherits \\\u003cNSObject\\\u003e."]]