uioporqwerty / capacitor-app-actions Goto Github PK
View Code? Open in Web Editor NEWCapacitor iOS and Android Plugin for App Actions
License: MIT License
Capacitor iOS and Android Plugin for App Actions
License: MIT License
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"
Hi ,
the app-action works with android emulator , but in production mode , the actions does not appear.
Any ideas ?
Best Regards
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.