Class ContentPeer
Class defined in:content-hub.js:230
ContentPeer is an object returned by the ContentHub. It represents a remote peer that can be used in a request to import, export or share content.
ContentPeer( )
content-hub.js:230
Example
var api = external.getUnityObject('1.0');
var hub = api.ContentHub;
var pictureContentType = hub.ContentType.Pictures;
hub.defaultSourceForType(
pictureContentType
, function(peer) {
[do something with the peer]
});
appId( callback )
content-hub.js:281
Retrieves the app Id of the associated peer.
If the callback parameter is not set, the current "local" value is retrieved.
Parameters:-
callback<Function(String)>(optional)
Application Id for this peer
contentType( callback )
content-hub.js:335
Retrieves the specific ContentType for this peer.
If the callback parameter is not set, the current "local" value is retrieved.
Parameters:-
callback<Function(String)>(optional)
ContentType for this peer
handler( callback )
content-hub.js:308
Retrieves the specific ContentHandler for this peer.
If the callback parameter is not set, the current "local" value is retrieved.
Parameters:-
callback<Function(String)>(optional)
ContentHandler for this peer
isDefaultPeer( callback )
content-hub.js:405
Returns true if the peer is a default one, false otherwise.
If the callback parameter is not set, the current "local" value is retrieved.
Parameters:-
callback<Function(Bool)>(optional)
name( callback )
content-hub.js:389
Retrieves the name of the associated peer.
If the callback parameter is not set, the current "local" value is retrieved.
Parameters:-
callback<Function(String)>(optional)
request( callback )
content-hub.js:423
Request to exchange content with this ContentPeer.
Parameters:-
callback<Function(ContentTransfer)>Called with the resulting content transfer
requestForStore( store, callback )
content-hub.js:433
Request to import content from this ContentPeer and use a ContentStore for permanent storage.
Parameters:-
store<ContentStore>Store used as a permanent storage
-
callback<Function(ContentTransfer)>Called with the resulting content transfer
selectionType( callback )
content-hub.js:362
Retrieves the specific SelectionType for this peer.
If the callback parameter is not set, the current "local" value is retrieved.
Parameters:-
callback<Function(String)>(optional)
ContentTransfer.SelectionType for this peer
setAppId( appId, callback )
content-hub.js:297
Sets the app Id of the associated peer.
Parameters:-
appId<String> -
callback<Function()>called when the appId has been updated
setContentType( contentType, callback )
content-hub.js:351
Sets specific ContentType for this peer.
Parameters:-
contentType<ContentType> -
callback<Function()>called when the content type has been updated
setHandler( handler, callback )
content-hub.js:324
Sets specific ContentHandler for this peer.
Parameters:-
handler<ContentHandler> -
callback<Function()>called when the appId has been updated
setSelectionType( selectionType, callback )
content-hub.js:378
Sets specific SelectionType for this peer.
Parameters:-
selectionType<ContentTransfer.SelectionType> -
callback<Function()>called when the content type has been updated
Content Hub JS API: ContentPeer