NativePlugin.java 872 B

123456789101112131415161718192021222324252627282930313233
  1. package com.getcapacitor;
  2. import java.lang.annotation.Retention;
  3. import java.lang.annotation.RetentionPolicy;
  4. /**
  5. * Base annotation for all Plugins
  6. */
  7. @Retention(RetentionPolicy.RUNTIME)
  8. public @interface NativePlugin {
  9. /**
  10. * Request codes this plugin uses and responds to, in order to tie
  11. * Android events back the plugin to handle
  12. */
  13. int[] requestCodes() default {};
  14. /**
  15. * Permissions this plugin needs, in order to make permission requests
  16. * easy if the plugin only needs basic permission prompting
  17. */
  18. String[] permissions() default {};
  19. /**
  20. * The request code to use when automatically requesting permissions
  21. */
  22. int permissionRequestCode() default PluginRequestCodes.DEFAULT_CAPACITOR_REQUEST_PERMISSIONS;
  23. /**
  24. * A custom name for the plugin, otherwise uses the
  25. * simple class name.
  26. */
  27. String name() default "";
  28. }