Class MCNearbyServiceBrowser

  • All Implemented Interfaces:
    NSObject

    public class MCNearbyServiceBrowser
    extends NSObject
    MCNearbyServiceBrowser MCNearbyServiceBrowser looks for nearby peers, and connects them to sessions. To create the MCNearbyServiceBrowser object and start browsing for nearby peers, a new MCPeerID should be created to represent the local peer, and a service type needs to be specified. The serviceType parameter is a short text string used to describe the app's networking protocol. It should be in the same format as a Bonjour service type: up to 15 characters long and valid characters include ASCII lowercase letters, numbers, and the hyphen. A short name that distinguishes itself from unrelated services is recommended; for example, a text chat app made by ABC company could use the service type "abc-txtchat". For more detailed information about service type restrictions, see RFC 6335, Section 5.1. A delegate that conforms to the MCNearbyServiceBrowserDelegate protocol must also be provided. The delegate is notified when nearby peers are found and lost. No assumption should be made as to which queue the callbacks are called on. MCNearbyAdvertiser must be initialized with an MCPeerID object and a valid service type. See Bonjour APIs https://developer.apple.com/bonjour/ for more information about service types.
    • Constructor Detail

      • MCNearbyServiceBrowser

        protected MCNearbyServiceBrowser​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(java.lang.Object aTarget,
                                                                                 org.moe.natj.objc.SEL aSelector,
                                                                                 java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        public static org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • new_objc

        public static java.lang.Object new_objc()
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • version_static

        public static long version_static()
      • invitePeerToSessionWithContextTimeout

        public void invitePeerToSessionWithContextTimeout​(MCPeerID peerID,
                                                          MCSession session,
                                                          NSData context,
                                                          double timeout)
        The method -invitePeer:toSession:withContext:timeout: sends an invitation to a peer, and when the peer accepts the invitation, adds the peer to the specified session. The invited peer will receive a -advertiser: didReceiveInvitationFromPeer:withContext:invitationHandler: callback. The context is passed through to the invited peer. It can be used to describe the session or pass some additional identification information to the invitee. The timeout parameter is seconds and should be a positive value. If a timeout of <=0 is specified, a default value of 30 seconds will be used instead.
      • serviceType

        public java.lang.String serviceType()
      • startBrowsingForPeers

        public void startBrowsingForPeers()
        The methods -startBrowsingForPeers and -stopBrowsingForPeers are used to start and stop looking for nearby advertising peers.
      • stopBrowsingForPeers

        public void stopBrowsingForPeers()