app icon indicating copy to clipboard operation
app copied to clipboard

Share Intend

Open luke- opened this issue 2 years ago • 11 comments

TBD

luke- avatar Jan 12 '23 13:01 luke-

@luke- could you elaborate the goals for this issue?

PrimozRatej avatar Feb 01 '23 12:02 PrimozRatej

@PrimozRatej I think we need to enhance the HumHub application a bit for this.

It's mainly about sharing a photo or text with HumHub. image

After one click, a space selection should be displayed. This probably has to be implemented natively (not WebView).

luke- avatar Feb 01 '23 13:02 luke-

Current impl.

image

We now obtain sharing intention of the device for images, I would recommend implementing a pop-up on the website using Web Message Channel where the base64-encoded image will be passed in. This way, all the implementation can be done on the web side.

PrimozRatej avatar Feb 06 '23 18:02 PrimozRatej

@PrimozRatej Thank you, I will check that.

Maybe we can then use the same solution here as for the PWA. (Not existing yet) https://developer.mozilla.org/en-US/docs/Web/Manifest/share_target

In the long run/in a later app version we should probably still develop a native selector of the HumHub Share target.

luke- avatar Feb 07 '23 10:02 luke-

@PrimozRatej Can we disable this until we finished the work on the HumHub side?

luke- avatar Feb 08 '23 19:02 luke-

Shure will disable the feature for now.

PrimozRatej avatar Feb 08 '23 19:02 PrimozRatej

We implemented this for our in-house app. We implemented two intends: Humhub post and Humhub messaging

Might be an idea for this app? As users might want to message an item to individual teammates as well as posting to spaces...

spoorun avatar Sep 02 '23 10:09 spoorun

Good point.

Probably it's useful to have one "HumHub" entry and then a dialog to select:

  • Post -> Space/Profile
  • Message -> Conversation

luke- avatar Sep 03 '23 19:09 luke-

Good point.

Probably it's useful to have one "HumHub" entry and then a dialog to select:

  • Post -> Space/Profile
  • Message -> Conversation

Could this be extended to be able to add other options as well? Such as usage for other modules?

Post -> Content Container

Or something a little more complex like the following;

Content -> Module Container -> Space/Profile/Custom

ArchBlood avatar Sep 04 '23 05:09 ArchBlood

@luke- do you think implementing this feature would be enough to apply again for Apple Store? If yes, then I think this could be the next work to be done, and I could try helping on it.

marc-farre avatar May 30 '24 13:05 marc-farre

This is definitely one of the next topics on the app development agenda. Ideally, the Sharing Intend can also be used for the PWA.

luke- avatar May 30 '24 14:05 luke-

Current suggestion on how we could implement this for both Android and iOS:

Sharing intents are defined by three components:

  • Data type: Specifies what is being shared (e.g., images, videos, text, links, etc.) [Handled at the native level].
  • Action trigger: Determines where we want to share the data type (e.g., as a popup or bottom panel). [Could be handled at the native or Flutter level].
  • Handle action: Defines how the data is shared. [Handled at the Flutter level]. Example (Google Photos):

Data type: Image Image

Action trigger: Intent with three action triggers. Image

Potentially, we could use a standard intent without action triggers and make this decision within a native popup or directly inside the WebView using JS channels.

We can also define custom icons and names for each action trigger. Image

Handle action: How we decide to handle the action is up to us. If we choose to have different types of triggers (e.g., share to spaces, chat, etc.), let's say for spaces, I would use a design similar to Google Photos: Image For chat maybe as Whatsapp or Insta. Image

We should also decide whether these action views should be implemented at the native level or within the specific Humhub web frontend (FE).

If we decide to implement this at the native level, the mobile app would need access to the instance API (e.g., when the user logs in via WebView, the access token is passed back to the app level). Alternatively, if we choose to implement this in the Humhub FE, the mobile app would simply pass the action_trigger_type, byteData, and mimeType to the FE.

@marc-farre , @luke- thoughts?

PrimozRatej avatar Jan 20 '25 09:01 PrimozRatej

Because we can potentially have many places in HumHub where files could be shared, and to make it clearer that we are sharing on HumHub, I would be in favour of the first idea:

Image

The modal box could be:

Share to:

  • a Space...
  • my Profile stream
  • a new Conversation (if the Messenger module is enabled)
  • my Profile picture (later)
  • my Profile banner (later)

We shouldn't use API because:

  • most of the HH instances don't have the rest API module, and it would be complicated to configure it
  • the next step would be to open the app to the related page to display the HH form, but with the content already uploaded

The user will then have to fill the form (e.g., if a post, add some text) and submit.

That's "easy" for the Profile stream and new Conversation. But for spaces, it's more complicated, because we need to choose which space, and which content type (Post, Poll, Event, Wiki page, etc.).

Do you think it would be possible for the app to have an updated array of Spaces and enables Modules(1) in each Space? This list should be updated each time the user join/quit a space, and each time a module is enabled/disabled in a space.

This way, after clicking on "a Space...", you could ask:

  1. "Choose the Space..."
  2. if more than one module is enabled(1): "Select the type..." (better wording to find!)

@PrimozRatej @luke- What do you think?

(1) Only modules allowing to create new Space content and having the possibility to join files to it.

marc-farre avatar Jan 20 '25 11:01 marc-farre

@PrimozRatej the app also must get the list of allowed file types from HumHub configuration, and max upload size:

Image

marc-farre avatar Jan 20 '25 11:01 marc-farre

@PrimozRatej The app should compress images, audio and video before sending it to HumHub.

marc-farre avatar Jan 21 '25 11:01 marc-farre

@marc-farre @luke- MVP of a feature. I still need to handle some edge cases and implement bulk loading for larger files, but overall it works ok.

https://github.com/user-attachments/assets/61e49b21-c070-4223-beee-153cf5bcad91

PrimozRatej avatar Mar 04 '25 19:03 PrimozRatej

@PrimozRatej Thanks really nice!

luke- avatar Mar 05 '25 10:03 luke-

Looks great

Would it be better to label it 'post in space' rather than 'create in space'? As the latter wording might confuse users.

Also, would it be possible for 'Send as message' to be an option? (For posting to a user or existing group conversation in the messages module.)

spoorun avatar Mar 15 '25 08:03 spoorun

@spoorun thanks for your suggestions. This is just a proof of concept. A designer is currently mocking it up, and it will look quite differently than what you see on the above video.

marc-farre avatar Mar 15 '25 08:03 marc-farre

Now working with latest mobile app version and HumHub 1.17.2 with latest Push Notifications module

marc-farre avatar Apr 14 '25 13:04 marc-farre