I've been working on updating a feature in a game to allow a user to post an image of an in-game accomplishment on Facebook. I want to share an image that's slightly different from a screen shot the user might capture on their own. In my case I'd like a fishing game to show a fish image with a message along the lines of "I just caught this (size) (species) in Fly Fishing Simulator HD".
I understand the old Facebook plugin is not really functional, so I'm looking for other options. I'll save you the detailed story of the sytem I built uploading the images to a custom PHP server script and either posting links to those images on Facebook, or trying to have the server upload them to Facebook with their Graph API. The short version is that there are a lot of complications and drawbacks.
At least on Android, once the app has saved an image it can use the media plugin to save the image in the users gallery. Is there a simple way with Gideros to then have the device open that image in their gallery or whatever app is their default viewer for the file type? If I can trigger that, the user can easily share the image to social media, contacts, etc. The function mediamanager:getPicture() brings up the gallery to let the user select an image, but not actually open it in the gallery.
I also noticed that in Gideros 2025.2 the Media plugin shows up as available only for Android, but the documentation at
https://wiki.giderosmobile.com/index.php/Media lists it as available for other platforms.
Does anyone have an effective way to let users share game generated images, other than just manually taking a screenshot and opening their gallery to share it from there?
Comments
Likes: MoKaLux, PaulH
I got it working on my android with simple text but I need to test the other available functions.
There are also those listeners which I need to test.
I never used it before so this may be rough around the edges
Likes: PaulH
Likes: MoKaLux
Likes: MoKaLux, PaulH
So I made this page visible and I am still testing see if there are new functions/Events available.
https://wiki.gideros.rocks/index.php/Share
Likes: PaulH
I don't know where Buffers are saved to but this may not work no more.
I was working on the GMedia plugin and had some success moving from the data folder to the media folder. I need to go back to it
Likes: MoKaLux, PaulH
On iOS it failed with a message on the console saying "Client not entitled". Here's the full error:
59638328 Plugin query method called
Received port for identifier response: <(null)> with error:Error Domain=RBSServiceErrorDomain Code=1 "Client not entitled" UserInfo={RBSEntitlement=com.apple.runningboard.process-state, NSLocalizedFailureReason=Client not entitled, RBSPermanent=false}
elapsedCPUTimeForFrontBoard couldn't generate a task port
Received port for identifier response: <(null)> with error:Error Domain=RBSServiceErrorDomain Code=1 "Client not entitled" UserInfo={RBSEntitlement=com.apple.runningboard.process-state, NSLocalizedFailureReason=Client not entitled, RBSPermanent=false}
elapsedCPUTimeForFrontBoard couldn't generate a task port
<0x1065d1e00> Gesture: System gesture gate timed out.
Received port for identifier response: <(null)> with error:Error Domain=RBSServiceErrorDomain Code=1 "Client not entitled" UserInfo={RBSEntitlement=com.apple.runningboard.process-state, NSLocalizedFailureReason=Client not entitled, RBSPermanent=false}
elapsedCPUTimeForFrontBoard couldn't generate a task port
*** Terminating app due to uncaught exception 'NSGenericException', reason: 'UIPopoverPresentationController () should have a non-nil sourceView or barButtonItem set before the presentation occurs.'
*** First throw call stack:
(0x19849d5ec 0x195a19244 0x19b18c4b8 0x19aff7d5c 0x19af9d1c4 0x19ad2bd40 0x19ad2b894 0x19ad2b7a8 0x19ad2b4c8 0x19ad2b3d8 0x19ad28890 0x19ad28704 0x19ad2b034 0x19ad28c50 0x1984e3f3c 0x1984e3ed0 0x1984e6b30 0x1984e5d2c 0x198538274 0x1e56814c0 0x19b07a77c 0x19aca0e64 0x104128038 0x1be6f4de8)
libc++abi: terminating due to uncaught exception of type NSException
Likes: MoKaLux
Likes: MoKaLux, PaulH
Likes: PaulH
Likes: MoKaLux
Likes: MoKaLux
Likes: MoKaLux, pie
I also found out that if your image is in a folder you need to do:
Likes: MoKaLux
I can continue with the import share and getCapabilities functions of Share
Likes: PaulH
- Buffer is used here in lieu of a temporary file: this saves physical file I/O and file allocation and thus is faster. We still need to give a name to the buffer to distinguish it from others when used in file operations through |B|, and also since RenderTarget:save() uses the file name extension to figure out in which format to save the image.
- We could have saved it in ".png" format too, in which case the MIME type in the share() call would have been "image/png"
- You can share a stock file directly by loading it with io.open() / file:read("*all"), without the need for a RenderTarget or Buffer.
Likes: MoKaLux
On the other hand I was trying to add the other functions, listeners but no luck so far
Sorry!
Likes: MoKaLux
Likes: MoKaLux
Hopefully its wiki looks good
PS: with import and export you can use more than text and image. I tested with a wav file and that worked
Viva Gideros