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

No implementation found for method init on channel dropbox #15

Open
emmggi opened this issue Feb 13, 2022 · 1 comment
Open

No implementation found for method init on channel dropbox #15

emmggi opened this issue Feb 13, 2022 · 1 comment

Comments

@emmggi
Copy link

emmggi commented Feb 13, 2022

I get this error for init method in my flutter app.

MissingPluginException (MissingPluginException(No implementation found for method init on channel dropbox))

this is my code

void main(List<String> args) async {
  WidgetsFlutterBinding.ensureInitialized();

  await Dropbox.init("myapp", "key", "secret");
  await Dropbox.authorize();
  accessToken = await Dropbox.getAccessToken();

  if (accessToken != null) {
    await Dropbox.authorizeWithAccessToken(accessToken!);
  }

  runApp(const ProviderScope(child: MyApp()));
}
@BenelliFurtado
Copy link

I had the same problem. It was a problem with the AppDelegate.swift which now looks like this:

import UIKit
import Flutter
import ObjectiveDropboxOfficial

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
            
    override func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
      ) -> Bool {
        GeneratedPluginRegistrant.register(with: self)
        return super.application(application, didFinishLaunchingWithOptions: launchOptions)
    }
    
    
    override func application(
        _ app: UIApplication,
        open url: URL,
        options: [UIApplication.OpenURLOptionsKey : Any] = [:]
    ) -> Bool {
          DBClientsManager.handleRedirectURL(url, completion:{ (authResult) in
            if let authResult = authResult {
                if authResult.isSuccess() {
                    print("dropbox auth success")
                } else if (authResult.isCancel()) {
                    print("dropbox auth cancel")
                } else if (authResult.isError()) {
                    print("dropbox auth error \(authResult.errorDescription)")
                }
            }
          });
          return true
        }
}


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

2 participants