GNSMessage Class

GNSMessage Class Reference

Overview

A message is a published object that is delivered between nearby devices.

Messages are delivered only between apps sharing the same Apiary Dev Console ID. See https://code.google.com/apis/console/

A message also has a type, which is used to match a published message with subscriptions.

See also
GNSMessageManager for more information about publications and subscriptions.

Inherits NSObject.

Instance Method Summary

((unavailable("Use
+messageWithContent.") 
- __attribute__
 

Class Method Summary

(instancetype) + messageWithContent:
 Message with the default type. More...
 
(instancetype) + messageWithContent:type:
 Message with the specified type. More...
 

Property Summary

NSString * messageNamespace
 The namespace of the message type. More...
 
NSString * type
 The type of the message. More...
 
NSData * content
 The content of the message. More...
 

Method Detail

+ (instancetype) messageWithContent: (NSData *)  content

Message with the default type.

See also
GNSMessage.content for more information about the content.
+ (instancetype) messageWithContent: (NSData *)  content
type: (NSString *)  type 

Message with the specified type.

See also
GNSMessage.content for more information about the content.
GNSMessage.type for more information about the type.

Property Detail

- (NSString*) messageNamespace
readnonatomiccopy

The namespace of the message type.

The empty string is the default namespace, and is private to each app (or apps sharing a Google Developer Console project). Note that currently, only beacon attachments will have a namespace other than the default.

- (NSString*) type
readnonatomiccopy

The type of the message.

Cannot be longer than kGNSMessageMaximumLength Unicode characters. Attempting to use a longer type will cause the library to assert if assertions are enabled and not publish the message if assertions are disabled.

- (NSData*) content
readnonatomiccopy

The content of the message.

The format of the data is application-specific, and must be agreed upon by all publishers and subscribers of the data. Cannot be longer than kGNSMessageMaximumContentSize. Attempting to use an object larger than this will cause the library to assert if assertions are enabled and not publish the message if assertions are disabled.