Class BGTaskScheduler

  • All Implemented Interfaces:
    NSObject

    public class BGTaskScheduler
    extends NSObject
    BGTaskScheduler The object you use to schedule deferrable work to be done in the background.
    • Constructor Detail

      • BGTaskScheduler

        protected BGTaskScheduler​(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)
      • cancelAllTaskRequests

        public void cancelAllTaskRequests()
        Cancel all previously submitted task requests.
      • 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)
      • cancelTaskRequestWithIdentifier

        public void cancelTaskRequestWithIdentifier​(java.lang.String identifier)
        Cancel a previously submitted task request.
        Parameters:
        identifier - The identifier of the previously submitted task request to cancel.
      • 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()
      • getPendingTaskRequestsWithCompletionHandler

        public void getPendingTaskRequestsWithCompletionHandler​(BGTaskScheduler.Block_getPendingTaskRequestsWithCompletionHandler completionHandler)
        Returns a list of all task requests that have been submitted but not yet completed.
        Parameters:
        completionHandler - A block for processing task requests. This block may be executed on a background thread. The block has no return value and takes a single parameter, taskRequests, which is an array of BGTaskRequest objects. If there are no pending requests, this array is empty. The task request objects returned are copies and changing their property values will have no immediate effect. To modify the parameters of a pending task request, submit it again to the scheduler with submitTaskRequest:error:.
      • 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()
      • registerForTaskWithIdentifierUsingQueueLaunchHandler

        public boolean registerForTaskWithIdentifierUsingQueueLaunchHandler​(java.lang.String identifier,
                                                                            NSObject queue,
                                                                            BGTaskScheduler.Block_registerForTaskWithIdentifierUsingQueueLaunchHandler launchHandler)
        Register a handler to be called for tasks that launch the app. You must register launch handlers before your application finishes launching. Attempting to register a handler after launch or multiple handlers for the same identifier is an error. Although you may submit task requests from some extensions, only the host app will be launched to handle background work.
        Parameters:
        identifier - The identifier for the task that will be handled by the provided launch handler.
        queue - The queue on which the launch handler and the expiration handler for the task will be called. The queue should be serial to ensure consistent ordering. If you pass nil, handlers will be called on a background queue.
        launchHandler - The block that will be called when the app is launched for the specified task. The block has no return value and takes a single parameter, task, a BGTask object. Assign an expiration handler to the task's expirationHandler property and call setTaskCompletedWithSuccess: when the background work is complete.
        Returns:
        YES if the handler was registered, or NO if it was not because the provided identifier was not present in the BGTaskSchedulerPermittedIdentifiers array in the app's Info.plist.
      • 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)
      • submitTaskRequestError

        public boolean submitTaskRequestError​(BGTaskRequest taskRequest,
                                              org.moe.natj.general.ptr.Ptr<NSError> error)
        Submit a request to be launched in the background to perform work. Submitting a task request with the same identifier as an existing request will replace that request.
        Parameters:
        taskRequest - The task request object representing the parameters of the background task to be scheduled.
        error - If an error occurs, upon return contains an error object that indicates why the request was rejected.
        Returns:
        YES if the request was successfully submitted, NO if there was an error
      • superclass_static

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

        public static long version_static()