1+ {
2+ "author" : " " ,
3+ "category" : " User interface" ,
4+ "extensionNamespace" : " " ,
5+ "fullName" : " Share dialog and sharing options" ,
6+ "helpPath" : " " ,
7+ "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXNoYXJlLXZhcmlhbnQiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTgsMTYuMDhDMTcuMjQsMTYuMDggMTYuNTYsMTYuMzggMTYuMDQsMTYuODVMOC45MSwxMi43QzguOTYsMTIuNDcgOSwxMi4yNCA5LDEyQzksMTEuNzYgOC45NiwxMS41MyA4LjkxLDExLjNMMTUuOTYsNy4xOUMxNi41LDcuNjkgMTcuMjEsOCAxOCw4QTMsMyAwIDAsMCAyMSw1QTMsMyAwIDAsMCAxOCwyQTMsMyAwIDAsMCAxNSw1QzE1LDUuMjQgMTUuMDQsNS40NyAxNS4wOSw1LjdMOC4wNCw5LjgxQzcuNSw5LjMxIDYuNzksOSA2LDlBMywzIDAgMCwwIDMsMTJBMywzIDAgMCwwIDYsMTVDNi43OSwxNSA3LjUsMTQuNjkgOC4wNCwxNC4xOUwxNS4xNiwxOC4zNEMxNS4xMSwxOC41NSAxNS4wOCwxOC43NyAxNS4wOCwxOUMxNS4wOCwyMC42MSAxNi4zOSwyMS45MSAxOCwyMS45MUMxOS42MSwyMS45MSAyMC45MiwyMC42MSAyMC45MiwxOUEyLjkyLDIuOTIgMCAwLDAgMTgsMTYuMDhaIiAvPjwvc3ZnPg==",
8+ "name" : " Share" ,
9+ "previewIconUrl" : " https://resources.gdevelop-app.com/assets/Icons/share-variant.svg" ,
10+ "shortDescription" : " Allows to share content via the system share dialog. Works only on mobile (browser or mobile app)." ,
11+ "version" : " 0.0.1" ,
12+ "description" : [
13+ " Actions and conditions to share a text and/or URL via the operating system share dialog." ,
14+ " " ,
15+ " This will work for Android and iOS on browsers (Google Chrome, Safari...) and on mobile apps."
16+ ],
17+ "tags" : [
18+ " share" ,
19+ " mobile"
20+ ],
21+ "authorIds" : [
22+ " wWP8BSlAW0UP4NeaHa2LcmmDzmH2" ,
23+ " ZgrsWuRTAkXgeuPV9bo0zuEcA2w1"
24+ ],
25+ "dependencies" : [
26+ {
27+ "exportName" : " cordova-plugin-web-share" ,
28+ "name" : " cordova-plugin-web-share" ,
29+ "type" : " cordova" ,
30+ "version" : " https://github.com/arthuro555/cordova-webshare-api.git"
31+ }
32+ ],
33+ "eventsFunctions" : [
34+ {
35+ "async" : true ,
36+ "description" : " Share a link or text via another app using the system share dialog." ,
37+ "fullName" : " Share" ,
38+ "functionType" : " Action" ,
39+ "name" : " Share" ,
40+ "sentence" : " Share text: _PARAM1_ and url: _PARAM2_ with title _PARAM3_" ,
41+ "events" : [
42+ {
43+ "type" : " BuiltinCommonInstructions::JsCode" ,
44+ "inlineCode" : [
45+ " gdjs._shareExtension = gdjs._shareExtension || {\r " ,
46+ " lastShareResult: '',\r " ,
47+ " };\r " ,
48+ " \r " ,
49+ " if (!navigator.share) {\r " ,
50+ " gdjs._shareExtension.lastShareResult = 'unsupported';\r " ,
51+ " eventsFunctionContext.task.resolve()\r " ,
52+ " return;\r " ,
53+ " }\r " ,
54+ " \r " ,
55+ " navigator.share({\r " ,
56+ " title: eventsFunctionContext.getArgument(\" title\" ) || undefined,\r " ,
57+ " text: eventsFunctionContext.getArgument(\" text\" ) || undefined,\r " ,
58+ " url: eventsFunctionContext.getArgument(\" url\" ) || undefined,\r " ,
59+ " })\r " ,
60+ " .then(() => {\r " ,
61+ " gdjs._shareExtension.lastShareResult = 'ok';\r " ,
62+ " eventsFunctionContext.task.resolve();\r " ,
63+ " })\r " ,
64+ " .catch(() => {\r " ,
65+ " gdjs._shareExtension.lastShareResult = 'canceled';\r " ,
66+ " eventsFunctionContext.task.resolve();\r " ,
67+ " });\r " ,
68+ " \r " ,
69+ " "
70+ ],
71+ "parameterObjects" : " " ,
72+ "useStrict" : true ,
73+ "eventsSheetExpanded" : true
74+ }
75+ ],
76+ "parameters" : [
77+ {
78+ "description" : " Text to share" ,
79+ "name" : " text" ,
80+ "type" : " string"
81+ },
82+ {
83+ "description" : " Url to share" ,
84+ "name" : " url" ,
85+ "type" : " string"
86+ },
87+ {
88+ "description" : " Title to show in the Share dialog" ,
89+ "name" : " title" ,
90+ "type" : " string"
91+ }
92+ ],
93+ "objectGroups" : []
94+ },
95+ {
96+ "description" : " Check if the browser/operating system of the device supports sharing. Sharing is typically not supported on desktop browsers or desktop apps." ,
97+ "fullName" : " Sharing is supported" ,
98+ "functionType" : " Condition" ,
99+ "name" : " IsSharingSupported" ,
100+ "sentence" : " The browser or system supports sharing" ,
101+ "events" : [
102+ {
103+ "type" : " BuiltinCommonInstructions::JsCode" ,
104+ "inlineCode" : " eventsFunctionContext.returnValue = !!navigator.share;" ,
105+ "parameterObjects" : " " ,
106+ "useStrict" : true ,
107+ "eventsSheetExpanded" : false
108+ }
109+ ],
110+ "parameters" : [],
111+ "objectGroups" : []
112+ },
113+ {
114+ "description" : " the result of the last share dialog." ,
115+ "fullName" : " Result of the last share dialog" ,
116+ "functionType" : " ExpressionAndCondition" ,
117+ "name" : " LastShareResult" ,
118+ "sentence" : " the result of the last share dialog" ,
119+ "events" : [
120+ {
121+ "type" : " BuiltinCommonInstructions::JsCode" ,
122+ "inlineCode" : [
123+ " gdjs._shareExtension = gdjs._shareExtension || {" ,
124+ " lastShareResult: ''," ,
125+ " };" ,
126+ " " ,
127+ " eventsFunctionContext.returnValue = gdjs._shareExtension.lastShareResult;"
128+ ],
129+ "parameterObjects" : " " ,
130+ "useStrict" : true ,
131+ "eventsSheetExpanded" : false
132+ }
133+ ],
134+ "expressionType" : {
135+ "supplementaryInformation" : " [\" unsupported\" ,\" ok\" ,\" canceled\" ]" ,
136+ "type" : " stringWithSelector"
137+ },
138+ "parameters" : [],
139+ "objectGroups" : []
140+ }
141+ ],
142+ "eventsBasedBehaviors" : [],
143+ "eventsBasedObjects" : []
144+ }
0 commit comments