Overview
Shortcuts Manager adds app shortcuts to your Unity game: the menu the player gets by
long-pressing your app icon. On Android these are dynamic and pinned app shortcuts; on iOS, Home Screen quick
actions. Each shortcut opens your game, and the ShortcutLaunched event tells your code which one the
player tapped, so you can open the store, the daily reward or the latest event straight away.
On Android a shortcut can also run your own Intent: open a web page, write an email, or open the game with your own extras. Nothing needs to be added to your manifest, Gradle files or Info.plist.
Shortcuts in one line
Add a shortcut, then listen for the one that opened the game.
Android and iOS
App shortcuts on Android, Home Screen quick actions on iOS, one C# API.
Open anything
Android shortcuts can open a web page, write an email or run any Intent.
Works in the Editor
Shortcuts are simulated in the Editor, so your menus and the demo work without a device.
Requirements
| Item | Version | Notes |
|---|---|---|
| Unity | 6000.0+ | Android and/or iOS build support installed |
com.unity.ugui | 2.0+ | The demo's UI only |
| Android | 7.1+ launcher | App shortcuts need Android 7.1 (API 25); pinning needs a launcher that supports it (IsRequestPinShortcutSupported()). |
| iOS | 13+ for icons | Quick actions work on every supported iOS; SF Symbol icons need iOS 13. |
Quick start
- Import the package Everything lands in
Assets/hardarcore/Shortcuts. - Add a shortcut Create a
Shortcutwith an id and a label, and callShortcutsManager.Instance.AddDynamicShortcut(shortcut). Shortcuts stay until you remove them, so add or refresh them when the game starts. - Handle the launch Subscribe to
ShortcutsManager.Instance.ShortcutLaunchedand open the screen that matches the id.
using Hardartcore.Shortcuts;
using UnityEngine;
public class GameShortcuts : MonoBehaviour
{
private void Start()
{
var store = new Shortcut("store", "Store", "Today's offers", "hc_shortcut_store", 0)
{
IosSymbol = "cart.fill"
};
ShortcutsManager.Instance.AddDynamicShortcut(store);
ShortcutsManager.Instance.ShortcutLaunched += OpenScreen;
// The game may have started from a shortcut before this script subscribed.
if (ShortcutsManager.Instance.LaunchShortcutId != null) OpenScreen(ShortcutsManager.Instance.LaunchShortcutId);
}
private void OpenScreen(string shortcutId)
{
if (shortcutId == "store") { /* show the store */ }
ShortcutsManager.Instance.ReportShortcutUsed(shortcutId);
}
}
The shortcuts are kept in memory in the Editor and on other platforms: you can add, update, list and remove them, so your UI works. The launch event only fires on a device.
The demo
Open Demo/ShortcutsDemo and press Play. The left card shows the shortcut menu as the launcher would,
built from GetShortcuts(); the buttons add the game shortcuts (Profile, Daily rewards, Events, Store),
a website and an email shortcut, pin the Store shortcut, update the Daily rewards labels and remove everything. On a
device, open the game from a shortcut and the yellow chip shows which one. The layout adapts to portrait and
landscape.
API reference
Shortcut
- Id
- Unique id.
ShortcutLaunchedreports it; adding a shortcut with an existing id replaces it. - ShortLabel
- The title. Keep it short: launchers show about 10 characters.
- LongLabel
- Android: shown when there is room. iOS: the subtitle.
- IconName
- Android: the name of a drawable resource (see Icons).
- IconPath
- Android: a PNG or JPG file to use as the icon, e.g. made at runtime in
Application.persistentDataPath. Wins overIconName. - IosSymbol
- iOS: an SF Symbol name for the icon, such as
"cart.fill". - Rank
- Position in the menu, 0 next to the icon. When the menu is full, the shortcut with the highest rank makes room.
ShortcutsManager
ShortcutsManager.Instance works from anywhere: it creates itself when no scene has one, and survives scene loads.
- event ShortcutLaunched (string id)
- The player opened or resumed the game with a shortcut.
- LaunchShortcutId
- The id of the last shortcut that opened the game, or null.
- AddDynamicShortcut(shortcut)
- Adds a shortcut that opens the game, or replaces the one with the same id.
- AddDynamicShortcut(shortcut, intent)
- Android: a shortcut that runs your Intent (see Intents). iOS: as above.
- UpdateShortcut(shortcut)
- Updates the labels, icon and rank of the shortcut with the same id. Its action stays.
UpdateShortcuts(shortcuts)does several. - GetShortcuts()
- All dynamic shortcuts, by rank. Android does not give icons back.
- GetShortcutById(id), GetDynamicShortcutsSize()
- One shortcut, or how many there are.
- RemoveShortcutById(id), RemoveShortcutsById(ids), RemoveAllDynamicShortcuts()
- Removes shortcuts.
- GetMaxShortcutCountPerActivity()
- How many shortcuts the launcher shows. iOS: 4.
- ReportShortcutUsed(id)
- Android Tells the launcher a shortcut was used, so it can suggest it. Call it when the player opens the shortcut or does the same thing in the game.
- RequestPinShortcut(shortcut, intent), RequestPinShortcutById(id)
- Android Asks the launcher to pin a shortcut to the home screen; the launcher asks the player first.
intentmay be null. CheckIsRequestPinShortcutSupported(). - DisableShortcutById(id, message), EnableShortcutById(id)
- Android Disables a shortcut (a pinned copy shows
messagewhen tapped) or enables it again. - GetIconMaxWidth(), GetIconMaxHeight()
- Android The icon size the launcher uses, in pixels.
- RemoveLongLivedShortcut(id), RemoveLongLivedShortcuts(ids)
- Android Removes long-lived (sharing) shortcuts.
- GetCurrentAndroidActivity(), SetIntent(intent)
- Android The running activity, and a way to replace its intent after reading your own extras.
Intents (Android)
Intent wraps android.content.Intent: actions, data, flags, class names and typed extras,
with helpers for common shortcuts. Build Intents only on Android (inside
#if UNITY_ANDROID && !UNITY_EDITOR).
var website = new Shortcut("website", "Website", "Open hardartcore.com", "hc_shortcut_web", 0);
ShortcutsManager.Instance.AddDynamicShortcut(website, Intent.CreateOpenUrlIntent("https://hardartcore.com"));
var support = new Shortcut("support", "Support", "Email the team", "hc_shortcut_mail", 1);
ShortcutsManager.Instance.AddDynamicShortcut(support,
Intent.CreateEmailIntent(new[] { "support@example.com" }, "Hello"));
// Your own: open the game with extras, read them back with Intent.GetIntent(activity).
var intent = new Intent().SetAction(IntentActions.ACTION_VIEW).PutExtra("level", 12);
Every shortcut's intent carries its id, so ShortcutLaunched also fires for shortcuts with your own
Intents when they open the game. A shortcut without an Intent opens the game's own activity, whichever Unity runs
(UnityPlayerActivity or UnityPlayerGameActivity).
Icons
- Android, drawable
- Put PNGs in an Android library folder and use the file name (without extension) as
IconName.Demo/ShortcutIcons.androidlibis an example: copy it outside the package, rename it and itsnamespaceinbuild.gradle, and replace the PNGs. Give your icons a prefix so they never clash with other resources. Android recommends a 48dp icon (192 px works for every screen). - Android, file
- Set
IconPathto a PNG or JPG on the device, e.g. a texture you saved withEncodeToPNG(). - iOS
- Set
IosSymbolto an SF Symbol name (Apple's SF Symbols app lists them).
How it works
Android
Plugins/Android/Shortcuts.androidlib holds the Java side, built on
ShortcutManagerCompat from androidx.core:core:1.9.0 (downloaded by Gradle). New shortcuts
are pushed with pushDynamicShortcut, so a full menu drops its highest-ranked shortcut instead of
failing. The shortcut id travels as an intent extra and is cleared once read, so returning from Recents does not
report it twice. ProGuard keep rules are included.
iOS
Plugins/iOS/Shortcuts.mm sets UIApplication.shortcutItems and adds
application:performActionForShortcutItem:completionHandler: to Unity's app controller, plus a launch
options check for cold starts. iOS shows up to four quick actions; there is no pinning, no Intents and no
enable/disable, so those calls do nothing there.
Folder layout
Assets/hardarcore/Shortcuts/ ├── Documentation.html this documentation ├── Scripts/ ShortcutsManager, Shortcut, Intent and its constants │ └── Editor/ Help menu items ├── Plugins/ │ ├── Android/Shortcuts.androidlib/ build.gradle, ProGuard rules, Java (src/main) │ └── iOS/Shortcuts.mm quick actions bridge └── Demo/ ShortcutsDemo scene, its scripts, ShortcutIcons.androidlib, Nunito, icons
Upgrading from 1.x
- Delete the old libraries Remove
Plugins/Android/Shortcuts/shortcuts-lib-release.aar,Editor/AndroidDependencies.xmlandAssets/IconResourcesif they are still in the project: importing an update does not delete files. - Move your icons Your drawables lived in the IconResources AAR: put them in an Android library folder (see Icons).
- Prefab optional The ShortcutsManager prefab is gone;
ShortcutsManager.Instancecreates itself. Scenes that still have the component keep working. - Launch handling Reading your own extras still works;
ShortcutLaunchedis simpler and works on iOS too.
Troubleshooting
- The shortcut has no icon
- Android: no drawable with that
IconName(check logcat for "No drawable resource named"), or theIconPathfile is missing. iOS: the SF Symbol name is wrong, or the device runs iOS 12. - ShortcutLaunched does not fire
- It only fires on a device. Subscribe early, and also check
LaunchShortcutIdfor a launch that happened before you subscribed. - Pinning does nothing
- The launcher does not support it (
IsRequestPinShortcutSupported()), or the player declined. - Duplicate class androidx.core...
- Another plugin copied
androidx.coreAAR files intoAssets/Plugins/Android(External Dependency Manager without Gradle templates). Turn on EDM's Patch mainTemplate.gradle option and resolve again.
Third-party notices
The demo includes two third-party components. Everything else in the package is original work by HardArtcore.
| Component | Location | License |
|---|---|---|
| Nunito font Copyright 2014 The Nunito Project Authors (github.com/googlefonts/nunito) | Demo/UI/Fonts/ | SIL Open Font License 1.1 |
| Material Symbols icons Copyright Google LLC (github.com/google/material-design-icons) | Demo/UI/Icons/, Demo/ShortcutIcons.androidlib | Apache License 2.0 |
The full licence texts ship in the package's Documentation.html, and online: SIL Open Font License 1.1, Apache License 2.0.
Release notes
2.0.0
- iOS support: Home Screen quick actions with SF Symbol icons.
ShortcutLaunchedevent andLaunchShortcutId: which shortcut opened the game, on Android and iOS.AddDynamicShortcut(shortcut)without an Intent opens the game, includingUnityPlayerGameActivity.- Icons from PNG files (
Shortcut.IconPath), and a full menu makes room by rank instead of failing. - Shortcuts are simulated in the Editor;
ShortcutsManager.Instancecreates itself. - Zero setup on Android: the Java library is an Android library folder with its androidx dependency and ProGuard rules. No AARs, no Gradle templates, no External Dependency Manager.
- A new single-scene demo in portrait and landscape. Unity 6 or newer.
1.1
- Small improvements in code and documentation; namespace matches the other packages.
1.0
- First release.
Need help?
Questions, bug reports or feature requests: I usually reply within a day.
Last updated November 4, 2026.