Code Monkey home page Code Monkey logo

capacitor-app-actions's People

Contributors

ggaabe avatar uioporqwerty avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

capacitor-app-actions's Issues

Dependencies problem android

There is a problem with dependencies: implementation "androidx.core:core-ktx:+" , make depedency 1.8.0-alpha0 ,we work SDK31 (Android 12).
I Think this declaration is better : implementation "androidx.core:core-ktx:$kotlin_version"

Android & Production

Hi ,
the app-action works with android emulator , but in production mode , the actions does not appear.
Any ideas ?
Best Regards

Support didFinishLaunchingWithOptions mode

Hey, thanks for the plugin.

The current logic doesn't support didFinishLaunchingWithOptions correctly, when the app doesn't launch and a user tries to launch it via quick actions first.

I found the solution here: https://medium.com/msapps-development/quick-actions-ios-180e79942595
And adapted it for the plugin in the ionic/capacitor app.

AppDelegate.swift

    var shortcutItemToProcess: UIApplicationShortcutItem?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        if let shortcutItem = launchOptions?[UIApplication.LaunchOptionsKey.shortcutItem] as? UIApplicationShortcutItem {
            shortcutItemToProcess = shortcutItem
        }
        
        return true
    }
    
    func application(_ application: UIApplication, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) {
        shortcutItemToProcess = shortcutItem
    }

    func applicationDidBecomeActive(_ application: UIApplication) {
                
        if let shortcutItem = shortcutItemToProcess {
            DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { // delay to be sure that app.component is ready
                NotificationCenter.default.post(name: NSNotification.Name("appActionReceived"), object: nil, userInfo: ["actionId" : shortcutItem.type])
            }

            // alert
            // var message = shortcutItem.type

            // let alertController = UIAlertController(title: "Quick Action Selected", message: message, preferredStyle: .alert)
            // alertController.addAction(UIAlertAction(title: "Close", style: .default, handler: nil))
            // DispatchQueue.main.async { [unowned self] in
            //     self.window?.rootViewController?.present(alertController, animated: true, completion: nil)
            // }
                        
            //reset the shortcut item
            shortcutItemToProcess = nil
        }
    }

I hope it'll help.

Installation Error

Running: npm install capacitor-app-actions npx cap sync

Gives error: No podspec found for CapacitorAppActions

I fixed it by creating "CapacitorAppActions.podspec" file, with the following config

require 'json'

package = JSON.parse(File.read(File.join(__dir__, 'package.json')))

Pod::Spec.new do |s|
  s.name = 'CapacitorAppActions'
  s.version = package['version']
  s.summary = package['description']
  s.license = package['license']
  s.homepage = package['repository']['url']
  s.author = package['author']
  s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
  s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
  s.ios.deployment_target  = '13.0'
  s.dependency 'Capacitor'
  s.swift_version = '5.1'
end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.