Class NSUserActivity

  • All Implemented Interfaces:
    NSItemProviderReading, NSItemProviderWriting, NSObject

    public class NSUserActivity
    extends NSObject
    implements NSItemProviderReading, NSItemProviderWriting
    NSUserActivity encapsulates the state of a user activity in an application on a particular device, in a way that allows the same activity to be continued on another device in a corresponding application from the same developer. Examples of user user activities include editing a document, viewing a web page, or watching a video.
    • Constructor Detail

      • NSUserActivity

        protected NSUserActivity​(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()
      • activityType

        public java.lang.String activityType()
        The activityType the user activity was created with.
      • addUserInfoEntriesFromDictionary

        public void addUserInfoEntriesFromDictionary​(NSDictionary<?,​?> otherDictionary)
        Adds to the userInfo dictionary the entries from otherDictionary. The keys and values must be of the types allowed in the userInfo
      • becomeCurrent

        public void becomeCurrent()
        Marks the receiver as the activity currently in use by the user, for example, the activity associated with the active window. A newly created activity is eligible for continuation on another device after the first time it becomes current.
      • delegate

        public NSUserActivityDelegate delegate()
        The user activity delegate is informed when the activity is being saved or continued (see NSUserActivityDelegate, below)
      • expirationDate

        public NSDate expirationDate()
        If non-nil, then an absolute date after which this activity is no longer eligible to be indexed or handed off.
      • getContinuationStreamsWithCompletionHandler

        public void getContinuationStreamsWithCompletionHandler​(NSUserActivity.Block_getContinuationStreamsWithCompletionHandler completionHandler)
        When an app is launched for a continuation event it can request streams back to the originating side. Streams can only be successfully retrieved from the NSUserActivity in the NS/UIApplication delegate that is called for a continuation event. This functionality is optional and is not expected to be needed in most continuation cases. The streams returned in the completion handler will be in an unopened state. The streams should be opened immediately to start requesting information from the other side.
      • init

        public NSUserActivity init()
        Initializes and returns a newly created NSUserActivity with the first activityType from the NSUserActivityTypes key in the application’s Info.plist.
        Overrides:
        init in class NSObject
      • initWithActivityType

        public NSUserActivity initWithActivityType​(java.lang.String activityType)
        Initializes and returns a newly created NSUserActivity with the given activityType. A user activity may be continued only in an application that (1) has the same developer Team ID as the activity's source application and (2) supports the activity's type. Supported activity types are specified in the application's Info.plist under the NSUserActivityTypes key. When receiving a user activity for continuation, the system locates the appropriate application to launch by finding applications with the target Team ID, then filtering on the incoming activity's type identifier.
      • invalidate

        public void invalidate()
        Invalidate an activity when it's no longer eligible for continuation, for example, when the window associated with an activity is closed. An invalid activity cannot become current.
      • isEligibleForHandoff

        public boolean isEligibleForHandoff()
        Set to YES if this user activity should be eligible to be handed off to another device
      • setEligibleForHandoff

        public void setEligibleForHandoff​(boolean value)
        Set to YES if this user activity should be eligible to be handed off to another device
      • isEligibleForPublicIndexing

        public boolean isEligibleForPublicIndexing()
        Set to YES if this user activity should be eligible for indexing for any user of this application, on any device, or NO if the activity contains private or sensitive information or which would not be useful to other users if indexed. The activity must also have requiredUserActivityKeys or a webpageURL
      • setEligibleForPublicIndexing

        public void setEligibleForPublicIndexing​(boolean value)
        Set to YES if this user activity should be eligible for indexing for any user of this application, on any device, or NO if the activity contains private or sensitive information or which would not be useful to other users if indexed. The activity must also have requiredUserActivityKeys or a webpageURL
      • isEligibleForSearch

        public boolean isEligibleForSearch()
        Set to YES if this user activity should be indexed by App History
      • setEligibleForSearch

        public void setEligibleForSearch​(boolean value)
        Set to YES if this user activity should be indexed by App History
      • keywords

        public NSSet<java.lang.String> keywords()
        A set of NSString* keywords, representing words or phrases in the current user's language that might help the user to find this activity in the application history.
      • needsSave

        public boolean needsSave()
        If set to YES, then the delegate for this user activity will receive a userActivityWillSave: callback before being sent for continuation on another device.
      • requiredUserInfoKeys

        public NSSet<java.lang.String> requiredUserInfoKeys()
        The keys from the userInfo property which represent the minimal information about this user activity that should be stored for later restoration. A nil value means all keys in .userInfo are required.
      • resignCurrent

        public void resignCurrent()
        If this activity is the current activity, it should stop being so and set the current activity to nothing.
      • setDelegate_unsafe

        public void setDelegate_unsafe​(NSUserActivityDelegate value)
        The user activity delegate is informed when the activity is being saved or continued (see NSUserActivityDelegate, below)
      • setDelegate

        public void setDelegate​(NSUserActivityDelegate value)
        The user activity delegate is informed when the activity is being saved or continued (see NSUserActivityDelegate, below)
      • setExpirationDate

        public void setExpirationDate​(NSDate value)
        If non-nil, then an absolute date after which this activity is no longer eligible to be indexed or handed off.
      • setKeywords

        public void setKeywords​(NSSet<java.lang.String> value)
        A set of NSString* keywords, representing words or phrases in the current user's language that might help the user to find this activity in the application history.
      • setMapItem

        public void setMapItem​(MKMapItem value)
      • setNeedsSave

        public void setNeedsSave​(boolean value)
        If set to YES, then the delegate for this user activity will receive a userActivityWillSave: callback before being sent for continuation on another device.
      • setRequiredUserInfoKeys

        public void setRequiredUserInfoKeys​(NSSet<java.lang.String> value)
        The keys from the userInfo property which represent the minimal information about this user activity that should be stored for later restoration. A nil value means all keys in .userInfo are required.
      • setSupportsContinuationStreams

        public void setSupportsContinuationStreams​(boolean value)
        When used for continuation, the user activity can allow the continuing side to connect back for more information using streams. This value is set to NO by default. It can be dynamically set to YES to selectively support continuation streams based on the state of the user activity.
      • setTitle

        public void setTitle​(java.lang.String value)
        An optional, user-visible title for this activity, such as a document name or web page title.
      • setUserInfo

        public void setUserInfo​(NSDictionary<?,​?> value)
        The userInfo dictionary contains application-specific state needed to continue an activity on another device. Each key and value must be of the following types: NSArray, NSData, NSDate, NSDictionary, NSNull, NSNumber, NSSet, NSString, NSURL, or NSUUID. File scheme URLs which refer to iCloud documents may be translated to valid file URLs on a receiving device.
      • setWebpageURL

        public void setWebpageURL​(NSURL value)
        When no suitable application is installed on a resuming device and the webpageURL is set, the user activity will instead be continued in a web browser by loading this resource.
      • supportsContinuationStreams

        public boolean supportsContinuationStreams()
        When used for continuation, the user activity can allow the continuing side to connect back for more information using streams. This value is set to NO by default. It can be dynamically set to YES to selectively support continuation streams based on the state of the user activity.
      • title

        public java.lang.String title()
        An optional, user-visible title for this activity, such as a document name or web page title.
      • userInfo

        public NSDictionary<?,​?> userInfo()
        The userInfo dictionary contains application-specific state needed to continue an activity on another device. Each key and value must be of the following types: NSArray, NSData, NSDate, NSDictionary, NSNull, NSNumber, NSSet, NSString, NSURL, or NSUUID. File scheme URLs which refer to iCloud documents may be translated to valid file URLs on a receiving device.
      • webpageURL

        public NSURL webpageURL()
        When no suitable application is installed on a resuming device and the webpageURL is set, the user activity will instead be continued in a web browser by loading this resource.
      • externalMediaContentIdentifier

        public java.lang.String externalMediaContentIdentifier()
        A unique identifier relative to the app's media content catalog for the displayed media item.
      • referrerURL

        public NSURL referrerURL()
        The URL of the webpage that referred (linked to) webpageURL.
      • setExternalMediaContentIdentifier

        public void setExternalMediaContentIdentifier​(java.lang.String value)
        A unique identifier relative to the app's media content catalog for the displayed media item.
      • setReferrerURL

        public void setReferrerURL​(NSURL value)
        The URL of the webpage that referred (linked to) webpageURL.
      • detectedBarcodeDescriptor

        public CIBarcodeDescriptor detectedBarcodeDescriptor()
        The scanned code in the user activity passed in by system scanner.
      • isEligibleForPrediction

        public boolean isEligibleForPrediction()
      • itemProviderVisibilityForRepresentationWithTypeIdentifier_static

        public static long itemProviderVisibilityForRepresentationWithTypeIdentifier_static​(java.lang.String typeIdentifier)
      • itemProviderVisibilityForRepresentationWithTypeIdentifier

        public long itemProviderVisibilityForRepresentationWithTypeIdentifier​(java.lang.String typeIdentifier)
      • objectWithItemProviderDataTypeIdentifierError

        public static java.lang.Object objectWithItemProviderDataTypeIdentifierError​(NSData data,
                                                                                     java.lang.String typeIdentifier,
                                                                                     org.moe.natj.general.ptr.Ptr<NSError> outError)
      • persistentIdentifier

        public java.lang.String persistentIdentifier()
      • readableTypeIdentifiersForItemProvider

        public static NSArray<java.lang.String> readableTypeIdentifiersForItemProvider()
      • setEligibleForPrediction

        public void setEligibleForPrediction​(boolean value)
      • setPersistentIdentifier

        public void setPersistentIdentifier​(java.lang.String value)
      • setSuggestedInvocationPhrase

        public void setSuggestedInvocationPhrase​(java.lang.String value)
        A human-understandable string that can be used to suggest a voice shortcut phrase to the user
      • setTargetContentIdentifier

        public void setTargetContentIdentifier​(java.lang.String value)
        A string that identifies the content of this NSUserActivity, for matching against existing documents when re-opening to see if they are the same. Setting this property is optional and does not automatically set .needsSave to YES.
      • suggestedInvocationPhrase

        public java.lang.String suggestedInvocationPhrase()
        A human-understandable string that can be used to suggest a voice shortcut phrase to the user
      • targetContentIdentifier

        public java.lang.String targetContentIdentifier()
        A string that identifies the content of this NSUserActivity, for matching against existing documents when re-opening to see if they are the same. Setting this property is optional and does not automatically set .needsSave to YES.
      • writableTypeIdentifiersForItemProvider_static

        public static NSArray<java.lang.String> writableTypeIdentifiersForItemProvider_static()
      • writableTypeIdentifiersForItemProvider

        public NSArray<java.lang.String> writableTypeIdentifiersForItemProvider()
      • contextIdentifierPath

        public NSArray<java.lang.String> contextIdentifierPath()
        Returns the context identifier path you should deep link to. For example for the context identifier path @c @["swift-programming-book", @c "chapter1"], your app should direct the user to @em chapter1 in @em swift-programming-book.
      • isClassKitDeepLink

        public boolean isClassKitDeepLink()
        Returns whether the user activity is a ClassKit deep link.
      • ndefMessagePayload

        public NFCNDEFMessage ndefMessagePayload()
        [@property] ndefMessagePayload The NFC NDEF message with an Universial Link object that triggers the application launch.
      • setShortcutAvailability

        public void setShortcutAvailability​(long value)
        Defines additional contexts in which this user activity is relevant to be suggested to the user.
      • shortcutAvailability

        public long shortcutAvailability()
        Defines additional contexts in which this user activity is relevant to be suggested to the user.