Skip to content

Commit b667f7a

Browse files
feat: added jsdoc
1 parent 8e579b1 commit b667f7a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/plugins/system/www/plugin.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,28 @@ module.exports = {
126126
openInBrowser: function (src) {
127127
cordova.exec(null, null, 'System', 'open-in-browser', [src]);
128128
},
129+
/**
130+
* Launch an Android application activity.
131+
*
132+
* @param {string} app - Package name of the application (e.g. `com.example.app`).
133+
* @param {string} className - Fully qualified activity class name (e.g. `com.example.app.MainActivity`).
134+
* @param {Object<string, (string|number|boolean)>} [extras] - Optional key-value pairs passed as Intent extras.
135+
* @param {(message: string) => void} [onSuccess] - Callback invoked when the activity launches successfully.
136+
* @param {(error: any) => void} [onFail] - Callback invoked if launching the activity fails.
137+
*
138+
* @example
139+
* System.launchApp(
140+
* "com.example.app",
141+
* "com.example.app.MainActivity",
142+
* {
143+
* user: "example",
144+
* age: 20,
145+
* premium: true
146+
* },
147+
* (msg) => console.log(msg),
148+
* (err) => console.error(err)
149+
* );
150+
*/
129151
launchApp: function (app, className, extras, onSuccess, onFail) {
130152
cordova.exec(onSuccess, onFail, 'System', 'launch-app', [app, className, extras]);
131153
},

0 commit comments

Comments
 (0)