Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using this package app was not build in android or IOS both #587

Open
ps108developer opened this issue Feb 4, 2025 · 0 comments
Open

using this package app was not build in android or IOS both #587

ps108developer opened this issue Feb 4, 2025 · 0 comments

Comments

@ps108developer
Copy link

`import UIKit
import Flutter
import workmanager
import flutter_background_service_ios

@UIApplicationMain

@objc class AppDelegate: FlutterAppDelegate {

override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    
    SwiftFlutterBackgroundServicePlugin.taskIdentifier = "your.custom.task.identifier"

    GeneratedPluginRegistrant.register(with: self)
    UNUserNotificationCenter.current().delegate = self

    WorkmanagerPlugin.setPluginRegistrantCallback { registry in
        GeneratedPluginRegistrant.register(with: registry)
    }

    WorkmanagerPlugin.registerBGProcessingTask(withIdentifier: "be.tramckrijte.workmanagerExample.taskId")
    WorkmanagerPlugin.registerBGProcessingTask(withIdentifier: "be.tramckrijte.workmanagerExample.rescheduledTask")
    WorkmanagerPlugin.registerBGProcessingTask(withIdentifier: "be.tramckrijte.workmanagerExample.simpleDelayedTask")
    WorkmanagerPlugin.registerBGProcessingTask(withIdentifier: "be.tramckrijte.workmanagerExample.iOSBackgroundProcessingTask")

    WorkmanagerPlugin.registerPeriodicTask(withIdentifier: "be.tramckrijte.workmanagerExample.iOSBackgroundAppRefresh", frequency: NSNumber(value: 20 * 60))

    return super.application(application, didFinishLaunchingWithOptions: launchOptions)

}

override func userNotificationCenter(
    _ center: UNUserNotificationCenter,
    willPresent notification: UNNotification,
    withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
    completionHandler(.alert)
 }

}
`

Errors ::

/Users/nikunj/Flutter Project.O/PrishuSoft/ZuguMobileAppLatest/zugu-ring/ios/Runner/AppDelegate.swift:23:27 Type 'WorkmanagerPlugin' has no member 'registerBGProcessingTask'

/Users/nikunj/Flutter Project.O/PrishuSoft/ZuguMobileAppLatest/zugu-ring/ios/Runner/AppDelegate.swift:24:27 Type 'WorkmanagerPlugin' has no member 'registerBGProcessingTask'

/Users/nikunj/Flutter Project.O/PrishuSoft/ZuguMobileAppLatest/zugu-ring/ios/Runner/AppDelegate.swift:25:27 Type 'WorkmanagerPlugin' has no member 'registerBGProcessingTask'

/Users/nikunj/Flutter Project.O/PrishuSoft/ZuguMobileAppLatest/zugu-ring/ios/Runner/AppDelegate.swift:26:27 Type 'WorkmanagerPlugin' has no member 'registerBGProcessingTask'

/Users/nikunj/Flutter Project.O/PrishuSoft/ZuguMobileAppLatest/zugu-ring/ios/Runner/AppDelegate.swift:28:27 Type 'WorkmanagerPlugin' has no member 'registerPeriodicTask'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant