Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Share Intend #10

Open
luke- opened this issue Jan 12, 2023 · 15 comments · Fixed by #33
Open

Share Intend #10

luke- opened this issue Jan 12, 2023 · 15 comments · Fixed by #33

Comments

@luke-
Copy link
Collaborator

luke- commented Jan 12, 2023

TBD

@luke- luke- added this to the v0.3 milestone Jan 12, 2023
@luke- luke- added the Flutter label Jan 12, 2023
@PrimozRatej
Copy link
Collaborator

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

@luke-
Copy link
Collaborator Author

luke- commented Feb 1, 2023

@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).

@PrimozRatej
Copy link
Collaborator

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 PrimozRatej linked a pull request Feb 6, 2023 that will close this issue
@luke-
Copy link
Collaborator Author

luke- commented Feb 7, 2023

@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-
Copy link
Collaborator Author

luke- commented Feb 8, 2023

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

@luke- luke- reopened this Feb 8, 2023
@PrimozRatej
Copy link
Collaborator

Shure will disable the feature for now.

@luke- luke- changed the title Share Dialog Share Intend Feb 24, 2023
@luke- luke- removed this from the v0.3 milestone Feb 24, 2023
@luke- luke- added this to the v1.2 milestone Jul 2, 2023
@spoorun
Copy link

spoorun commented Sep 2, 2023

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...

@luke-
Copy link
Collaborator Author

luke- commented Sep 3, 2023

Good point.

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

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

@ArchBlood
Copy link

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

@luke- luke- removed this from the v1.2 milestone Jan 30, 2024
@marc-farre
Copy link
Collaborator

@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.

@luke-
Copy link
Collaborator Author

luke- commented May 30, 2024

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

@PrimozRatej
Copy link
Collaborator

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?

@marc-farre
Copy link
Collaborator

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
Copy link
Collaborator

marc-farre commented Jan 20, 2025

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

Image

@marc-farre
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants