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

Fixes small typo in README.md #1

Merged
merged 2 commits into from
Aug 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 35 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,41 +36,44 @@ import { AndroidShortcuts } from 'capacitor-android-shortcuts';
...

// Add dynamic shortcuts
if (AndroidShortcuts.isDynamicSupported()) {
AndroidShortcuts.addDynamic({
items: [
{
id: 'myfirstid',
shortLabel: 'My first short label',
longLabel: 'My first long label',
iconBitmap: 'BASE64DATA',
data: 'I am a simple string'
},
{
id: 'mysecondid',
shortLabel: 'My first short label',
longLabel: 'My first long label',
iconBitmap: 'BASE64DATA',
data: JSON.stringify({ myProperty: 'Pass a stringified JSON object' })
},
],
});
}

AndroidShortcuts.isDynamicSupported().then(({ result }) => {
if (result) {
AndroidShortcuts.addDynamic({
items: [
{
id: "myfirstid",
shortLabel: "My first short label",
longLabel: "My first long label",
iconBitmap: "BASE64DATA",
data: "I am a simple string",
},
{
id: "mysecondid",
shortLabel: "My first short label",
longLabel: "My first long label",
iconBitmap: "BASE64DATA",
data: JSON.stringify({
myProperty: "Pass a stringified JSON object",
}),
},
],
});
}
});
...

// Add pinned shortcuts
if (AndroidShortcuts.isPinnedSupported()) {
AndroidShortcuts.addPinned(
{
id: 'mypinnedid',
shortLabel: 'My pinned short label',
longLabel: 'My pinned long label',
iconBitmap: 'BASE64DATA',
data: 'I am a simple string'
}
});
}
AndroidShortcuts.isPinnedSupported().then(({ result }) => {
if (result) {
AndroidShortcuts.addPinned({
id: "mypinnedid",
shortLabel: "My pinned short label",
longLabel: "My pinned long label",
iconBitmap: "BASE64DATA",
data: "I am a simple string",
});
}
});

// Triggered when app is launched by a shortcut
AndroidShortcuts.addListener('shortcut', (response: any) => {
Expand Down