在Cordova应用程序中添加到Android主屏幕

时间:2018-11-27 06:59:37

标签: android cordova cordova-plugins

我正在尝试在带有动态图标的不同页面的Cordova应用程序中创建按钮。 我正在使用以下技术和插件。

Cordova 8.1.2 (cordova-lib@8.1.1)    
android@7.1.4

插件

cordova-plugin-shortcuts-android 0.1.0 "Android Shortcuts"

它工作正常,但是我需要添加动态图标。我的代码如下:

var shortcut = {
                    id: '123456,
                    shortLabel: lblSmall,
                    longLabel: lblBig,
                    iconBitmap: 'Path to png File',
                    intent: {
                         action: 'android.intent.action.RUN',
                         data: 'Path to app page' // Must be a well-formed URI
                            }
                }

执行时出现以下错误

Bitmap must Not be null

有人可以帮我设置快捷方式插件的动态图标吗?

谢谢。

0 个答案:

没有答案