GNSSubscriptionParams Class

GNSSubscriptionParams Class Reference

Overview

Optional parameters for a subscription.

See the property declarations below for explanations of each parameter.

Inherits NSObject.

Property Summary

GNSDeviceTypes deviceTypesToDiscover
 The types of devices to discover. More...
 
NSString * messageNamespace
 The message namespace to match. More...
 
NSString * type
 The message type to match. Must not be nil. The empty string is the default type. More...
 
GNSStrategystrategy
 The strategy to use for discovering Nearby devices (non-beacons). More...
 
GNSBeaconStrategybeaconStrategy
 The strategy to use for beacon scanning. More...
 
GNSOperationStatusHandler statusHandler
 A handler for subscription status. More...
 
GNSPermissionRequestHandler permissionRequestHandler
 A handler for requesting user permission to use Nearby. More...
 

Property Detail

- (GNSDeviceTypes) deviceTypesToDiscover
readwritenonatomicassign

The types of devices to discover.

The default is kGNSDeviceUsingNearby.

- (NSString*) messageNamespace
readwritenonatomicassign

The message namespace to match.

The empty string is the default namespace, and is private to each app (or apps sharing a Google Developer Console project).

- (NSString*) type
readwritenonatomicassign

The message type to match. Must not be nil. The empty string is the default type.

- (GNSStrategy*) strategy
readwritenonatomicassign

The strategy to use for discovering Nearby devices (non-beacons).

- (GNSBeaconStrategy*) beaconStrategy
readwritenonatomicassign

The strategy to use for beacon scanning.

- (GNSOperationStatusHandler) statusHandler
readwritenonatomiccopy

A handler for subscription status.

It can be used for tracking the status of a newly created subscription.

- (GNSPermissionRequestHandler) permissionRequestHandler
readwritenonatomiccopy

A handler for requesting user permission to use Nearby.

This handler overrides the default dialog used by Nearby; if you supply this handler, Nearby will not show its permission dialog.

In your request handler, you should request the user's permission to perform the task that requires the use of Nearby, explaining why it's being used. When the user has given or denied consent, you must call the block that's passed into your request handler. If you pass YES into the block, it means the user has consented to allow Nearby to function. If you pass NO, it means the user has not consented; your publications and subscriptions will not work until consent has been given.

The handler can also be used as a method of "preflighting" for the iOS permission dialogs. You can use it to explain why the user is expected to consent to the iOS permissions before your app can perform its Nearby related functions.